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

Add public dashboards support #1026

Merged
merged 11 commits into from
Nov 1, 2023

Conversation

evictorero
Copy link
Contributor

@evictorero evictorero commented Sep 8, 2023

@evictorero evictorero self-assigned this Sep 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. To do so, a Grafana Labs employee must promote the Drone build.

For maintainers, it's better to run only the Cloud tests you need, rather than all of them. You can do so by setting the following parameter when promoting:

TESTARGS='-run=<testname>'

@evictorero evictorero marked this pull request as ready for review September 8, 2023 18:44
@evictorero evictorero requested a review from a team as a code owner September 8, 2023 18:44
go.mod Outdated Show resolved Hide resolved
}

func CreatePublicDashboard(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(*common.Client).GrafanaAPI
Copy link
Member

Choose a reason for hiding this comment

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

Is this an org-scoped or instance-scoped resource? If it's org-scoped, you'll need to add the org_id attribute and handle it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is an instance-scoped resource but It has an orgId associated because it has a foreign key to a dashboard which PK is uid + orgId

Copy link
Member

Choose a reason for hiding this comment

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

Then in that case, you'll probably need to add the org_id attribute (see dashboard for example) and instantiate an org-specific client (see dashboard again for example)

Otherwise, this won't support dashboards in any org other than the default one

An additional test that checks that you this new resource works in an org might be nice too!

internal/resources/grafana/resource_dashboard_public.go Outdated Show resolved Hide resolved
internal/resources/grafana/resource_dashboard_public.go Outdated Show resolved Hide resolved
@julienduchesne
Copy link
Member

LGTM, but I'd say we can't merge until 10.2.0 is actually available: https://grafana.com/grafana/download. Right now, the tests aren't running in CI

@evictorero
Copy link
Contributor Author

LGTM, but I'd say we can't merge until 10.2.0 is actually available: https://grafana.com/grafana/download. Right now, the tests aren't running in CI

Great, I will wait until 10.2.0 is released. Thanks @julienduchesne !

julienduchesne
julienduchesne previously approved these changes Sep 22, 2023
@julienduchesne julienduchesne marked this pull request as draft September 22, 2023 01:12
@julienduchesne
Copy link
Member

Turned it back to draft until Grafana 10.2 is released

@evictorero
Copy link
Contributor Author

@julienduchesne Grafana 10.2 was released last week. We can merge this PR now.

@evictorero evictorero marked this pull request as ready for review October 30, 2023 18:47
@julienduchesne julienduchesne force-pushed the evictorero/public-dashboards-support branch from 5ccfbd7 to ad7ee1f Compare November 1, 2023 20:13
@julienduchesne julienduchesne merged commit 633b640 into master Nov 1, 2023
4 of 5 checks passed
@julienduchesne julienduchesne deleted the evictorero/public-dashboards-support branch November 1, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task: Add public dashboard resource in the terraform provider
2 participants