Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibraryPanels: Expose library panels in dashboard apiserver #92213

Merged
merged 19 commits into from
Aug 27, 2024

Conversation

ryantxu
Copy link
Member

@ryantxu ryantxu commented Aug 21, 2024

This updates the dashboard apiserver so it also returns library panels.

http://localhost:3000/apis/dashboard.grafana.app/v0alpha1/namespaces/default/librarypanels

This includes a slightly improved schema for library panels in k8s -- we can consider using this as a foundation for dashboard panels.

Note: this still requires dev mode and:

[feature_toggles]
grafanaAPIServerWithExperimentalAPIs = true

@ryantxu ryantxu added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Aug 21, 2024
@ryantxu ryantxu changed the title WIP/LibraryPanels: Expose library panels in dashboard apiserver LibraryPanels: Expose library panels in dashboard apiserver Aug 27, 2024
@ryantxu ryantxu marked this pull request as ready for review August 27, 2024 06:22
@ryantxu ryantxu requested a review from a team as a code owner August 27, 2024 06:22
@github-actions github-actions bot added this to the 11.3.x milestone Aug 27, 2024
@@ -17,6 +17,9 @@ func GetOpenAPIDefinitions(builders []APIGroupBuilder) common.GetOpenAPIDefiniti
return func(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
defs := v0alpha1.GetOpenAPIDefinitions(ref) // common grafana apis
maps.Copy(defs, data.GetOpenAPIDefinitions(ref))
maps.Copy(defs, map[string]common.OpenAPIDefinition{ // TODO -- move to SDK definition above
Copy link
Member Author

Choose a reason for hiding this comment

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

This can be removed when grafana/grafana-plugin-sdk-go#1062 is merged

@ryantxu ryantxu requested a review from JohnnyQQQQ August 27, 2024 06:49
Copy link
Member

@JohnnyQQQQ JohnnyQQQQ left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/registry/apis/dashboard/legacy/sql_dashboards.go Outdated Show resolved Hide resolved
Comment on lines 78 to 79
// The dashboard body (unstructured for now)
Spec LibraryPanelSpec `json:"spec"`
Copy link
Member

Choose a reason for hiding this comment

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

Question: Not sure what you mean by unstructured here, as it seems to have a structure with specific fields?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll update the comment! it was unstructured at first... then I got more ambitious

@ryantxu ryantxu enabled auto-merge (squash) August 27, 2024 08:31
@ryantxu ryantxu merged commit 419edef into main Aug 27, 2024
14 checks passed
@ryantxu ryantxu deleted the library-panels-apiserver branch August 27, 2024 09:12
@joshhunt joshhunt modified the milestones: 11.3.x, 11.3.0 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants