Skip to content

feat!: add sections parameter to template insights#10010

Merged
mtojek merged 6 commits into
mainfrom
9495-sections
Oct 3, 2023
Merged

feat!: add sections parameter to template insights#10010
mtojek merged 6 commits into
mainfrom
9495-sections

Conversation

@mtojek

@mtojek mtojek commented Oct 3, 2023

Copy link
Copy Markdown
Member

Related #9495

This PR adds sections parameter to template insights. The idea is to shrink the endpoint response, and reduce the number of DB calls.

Changes:

  • API breaking change: report and interval_reports can be omitted in /insights/templates
  • expose sections HTTP parameter for /insights/templates (values: report, interval_reports)
  • golden files for testing purposes
  • FE adjustments to allow for undefined report

@mtojek mtojek self-assigned this Oct 3, 2023
@mtojek mtojek changed the title feat: add sections parameter to template insights feat!: add sections parameter to template insights Oct 3, 2023
@mtojek
mtojek marked this pull request as ready for review October 3, 2023 12:59

@mafredri mafredri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a few small comments.

Comment thread coderd/insights.go
Comment thread codersdk/insights.go Outdated
<TemplateUsagePanel
sx={{ gridColumn: "span 3" }}
data={templateInsights?.report.apps_usage}
data={templateInsights?.report?.apps_usage}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we not need any change for interval_reports which is now possibly also undefined?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave it for @BrunoQuaresma to polish the FE side.

@mtojek
mtojek merged commit f62f45a into main Oct 3, 2023
@mtojek
mtojek deleted the 9495-sections branch October 3, 2023 13:44
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants