grafanactl: reconcile ADX datasources#228
Open
swiencki wants to merge 4 commits intoAzure:mainfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new grafanactl modify datasource reconcile-adx subcommand to create/update a single Azure Data Explorer (ADX) Grafana datasource via the Grafana REST API (rather than relying on Azure CLI datasource commands), along with supporting Grafana client capabilities and tests.
Changes:
- Introduces ADX reconcile command + option parsing/validation/completion flow.
- Extends the internal Grafana client with datasource type listing and status-aware create/update requests.
- Updates docs and adds unit tests for the new ADX logic and client behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/grafanactl/internal/grafana/client.go | Adds status-aware datasource create/update helpers and datasource type listing. |
| tools/grafanactl/internal/grafana/client_test.go | Adds tests for create/update request behavior and error reporting. |
| tools/grafanactl/cmd/modify/cmd.go | Registers the new modify datasource reconcile-adx subcommand. |
| tools/grafanactl/cmd/modify/adx_options.go | Implements flags, validation, and completion for ADX reconcile options. |
| tools/grafanactl/cmd/modify/adx.go | Implements reconcile logic (create vs update) and desired datasource payload generation. |
| tools/grafanactl/cmd/modify/adx_options_test.go | Adds unit tests covering validation and reconcile create/update paths. |
| tools/grafanactl/README.md | Documents ADX datasource reconcile usage and common flag alternative. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
swiencki
added a commit
to Azure/ARO-HCP
that referenced
this pull request
Apr 28, 2026
Replace the temporary shell datasource script with a direct grafanactl invocation and keep cleanup datasource deletion out of this rollout scope. Depends on Azure/ARO-Tools#228.
swiencki
added a commit
to Azure/ARO-HCP
that referenced
this pull request
Apr 30, 2026
Replace the temporary shell datasource script with a direct grafanactl invocation and keep cleanup datasource deletion out of this rollout scope. Depends on Azure/ARO-Tools#228.
2b887f7 to
73394d8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the existing
GrafanaDatasourcestyped step andgrafanactl modify datasource reconcileflow with optional ADX/Kusto datasource support.This keeps Azure Monitor datasource reconciliation as the default path, adds ADX flags only when configured, and supports create/update/delete desired-state behavior for the named ADX datasource.
Why
ARO-HCP needs to provision ADX datasources through the existing typed/prebuilt-binary rollout pattern instead of introducing an ADX-only EV2 shell path or rollout-time
go run.Testing
go test ./pipelines/types ./tools/grafanactl/...make lintCross-repo rollout
Merge order is required: