refactor(grafanaplane): split modules into directories and add new ProviderConfig helpers#105
Merged
refactor(grafanaplane): split modules into directories and add new ProviderConfig helpers#105
Conversation
Split the monolithic oss.libsonnet into separate files per top-level group, matching the established pattern from oncall/ and alerting/: - oss/main.libsonnet (entry point) - oss/team.libsonnet - oss/folder.libsonnet - oss/folderpermission.libsonnet - oss/dashboard.libsonnet - oss/datasource.libsonnet
…irectory Split the monolithic enterprise.libsonnet into separate files per top-level group, matching the established pattern: - enterprise/main.libsonnet (entry point) - enterprise/role.libsonnet - enterprise/roleassignment.libsonnet The doc headings now use fully qualified package names (enterprise.role, enterprise.roleAssignment) consistent with other split modules.
Split the monolithic cloud.libsonnet into separate files per top-level group, matching the established pattern: - cloud/main.libsonnet (entry point) - cloud/stack.libsonnet - cloud/stackserviceaccount.libsonnet - cloud/stackserviceaccounttoken.libsonnet - cloud/accesspolicy.libsonnet - cloud/accesspolicytoken.libsonnet Cross-references that previously used 'local root = self' now use 'local main = import ./main.libsonnet' to access sibling groups.
Split the monolithic sm.libsonnet into separate files per top-level group, matching the established pattern: - sm/main.libsonnet (entry point) - sm/check.libsonnet (with nested settings.http and settings.grpc)
Split global.libsonnet into global/ directory (matching the pattern used by cloud/, oss/, etc.) and add ClusterProviderConfig and namespaced ProviderConfig helpers using the crossplane-provider-grafana-libsonnet vendored library.
cindy
approved these changes
Mar 31, 2026
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.
Summary
oss.libsonnet,cloud.libsonnet,enterprise.libsonnet,sm.libsonnet, andglobal.libsonnetinto subdirectories with individual files per resource (matching the existing pattern used by other modules)clusterProviderConfighelper using the vendoredcrossplane-provider-grafana-libsonnetlibrary (grafana.m.crossplane.io/v1beta1/ClusterProviderConfig)namespacedProviderConfighelper using the same vendored library (grafana.m.crossplane.io/v1beta1/ProviderConfig, withouttanka.dev/namespaced: false)crossplane-provider-grafana-libsonnetas a new jsonnet-bundler dependencyReview guide
Everything under
docs/is generated (make -B docs) and does not need manual review. Focus review on thegrafanaplane/directory:grafanaplane/global/— the new directory structure, split from the formergrafanaplane/global.libsonnet:main.libsonnet— entrypoint that imports the sub-modulesproviderconfig.libsonnet— existingproviderConfighelper (moved, unchanged)clusterproviderconfig.libsonnet— new, createsClusterProviderConfigresourcesnamespacedproviderconfig.libsonnet— new, creates namespacedProviderConfigresourcesgrafanaplane/jsonnetfile.json— addscrossplane-provider-grafana-libsonnetdependency, switcheslegacyImportstofalsegrafanaplane/main.libsonnetandgrafanaplane/cloud/stack.libsonnet— import path updates (global.libsonnet→global/main.libsonnet)oss/,cloud/,enterprise/,sm/) are pure refactors with no logic changesTODO