Skip to content

refactor(grafanaplane): split modules into directories and add new ProviderConfig helpers#105

Merged
Duologic merged 5 commits intomainfrom
duologic/split-oss
Mar 31, 2026
Merged

refactor(grafanaplane): split modules into directories and add new ProviderConfig helpers#105
Duologic merged 5 commits intomainfrom
duologic/split-oss

Conversation

@Duologic
Copy link
Copy Markdown
Contributor

@Duologic Duologic commented Mar 30, 2026

Summary

  • Split monolithic oss.libsonnet, cloud.libsonnet, enterprise.libsonnet, sm.libsonnet, and global.libsonnet into subdirectories with individual files per resource (matching the existing pattern used by other modules)
  • Add clusterProviderConfig helper using the vendored crossplane-provider-grafana-libsonnet library (grafana.m.crossplane.io/v1beta1 / ClusterProviderConfig)
  • Add namespacedProviderConfig helper using the same vendored library (grafana.m.crossplane.io/v1beta1 / ProviderConfig, without tanka.dev/namespaced: false)
  • Add crossplane-provider-grafana-libsonnet as a new jsonnet-bundler dependency
  • Regenerate docs to reflect the new directory structure

Review guide

Everything under docs/ is generated (make -B docs) and does not need manual review. Focus review on the grafanaplane/ directory:

  • grafanaplane/global/ — the new directory structure, split from the former grafanaplane/global.libsonnet:
    • main.libsonnet — entrypoint that imports the sub-modules
    • providerconfig.libsonnet — existing providerConfig helper (moved, unchanged)
    • clusterproviderconfig.libsonnetnew, creates ClusterProviderConfig resources
    • namespacedproviderconfig.libsonnetnew, creates namespaced ProviderConfig resources
  • grafanaplane/jsonnetfile.json — adds crossplane-provider-grafana-libsonnet dependency, switches legacyImports to false
  • grafanaplane/main.libsonnet and grafanaplane/cloud/stack.libsonnet — import path updates (global.libsonnetglobal/main.libsonnet)
  • The other directory splits (oss/, cloud/, enterprise/, sm/) are pure refactors with no logic changes

TODO

  • Try out on internal repository to verify the changes are non-breaking

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.
@Duologic Duologic requested a review from a team as a code owner March 30, 2026 21:55
@Duologic Duologic enabled auto-merge (squash) March 31, 2026 21:22
@Duologic Duologic merged commit e9c3b11 into main Mar 31, 2026
12 checks passed
@Duologic Duologic deleted the duologic/split-oss branch March 31, 2026 21:24
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.

2 participants