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

feat: generate Grafonnet for Grafana v11.0.0 #199

Merged
merged 17 commits into from
May 24, 2024
Merged

feat: generate Grafonnet for Grafana v11.0.0 #199

merged 17 commits into from
May 24, 2024

Conversation

Duologic
Copy link
Member

@Duologic Duologic commented May 13, 2024

Update the generator to use foundation-sdk, this means the generator now only works for generating Grafonnet for Grafana v11+. If older generated libraries need updates/backporting, this'll require manual intervention.

Notable changes:

There are a bunch more minor changes and docs updates.


Diff hint for the reviewer:

➜ git diff --stat main..HEAD -- . ':(exclude)gen' ':(exclude)docs'
 Makefile                                     |   2 +-
 custom/dashboard.libsonnet                   |   5 ++++
 custom/query/azureMonitor.libsonnet          |  17 +++++++++++++
 custom/query/cloudWatch.libsonnet            |  23 +++++++++++++++++
 custom/query/elasticsearch.libsonnet         |  20 +++++++++++++++
 custom/query/expr.libsonnet                  |  12 +++++++++
 custom/query/googleCloudMonitoring.libsonnet |  17 +++++++++++++
 custom/query/grafanaPyroscope.libsonnet      |  17 +++++++++++++
 custom/query/loki.libsonnet                  |   1 +
 custom/query/parca.libsonnet                 |  17 +++++++++++++
 custom/query/prometheus.libsonnet            |   1 +
 custom/query/tempo.libsonnet                 |   1 +
 custom/query/testData.libsonnet              |  17 +++++++++++++
 examples/redMethod/output.json               |   8 +++---
 examples/runtimeDashboard/output.json        |  22 ++++++++--------
 examples/runtimeDashboard/panels.libsonnet   |   6 ++---
 examples/simple/output.json                  |   2 +-
 generator/alerting.libsonnet                 |  10 +++++---
 generator/core.libsonnet                     |  86 ++++++++++++++++++++------------------------------------------
 generator/jsonnetfile.lock.json              |   4 +--
 generator/panel.libsonnet                    | 114 ++++++++++++++++++++++++++++++++++++++--------------------------------------------
 generator/patches/custom_schemas/folder.json |   8 ++++--
 generator/patches/schemas.libsonnet          | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------
 generator/patches/spec.libsonnet             |  18 ++++++++++++-
 generator/query.libsonnet                    | 113 ++++++++++++++++++++++++++++++++++++----------------------------------------------
 generator/row.libsonnet                      |  15 +++++------
 generator/utils.libsonnet                    |  22 +---------------
 scripts/generate.sh                          |  10 +++++---
 scripts/generate_latest.sh                   |   1 -
 29 files changed, 421 insertions(+), 359 deletions(-)

BREAKING CHANGE: This will drop support for regenerating <v11.0.0 versions of Grafonnet, any backports will need manual intervention from here on.
@Duologic

This comment was marked as outdated.

@Duologic

This comment was marked as outdated.

@Duologic

This comment was marked as outdated.

@Duologic

This comment was marked as outdated.

@Duologic

This comment was marked as outdated.

@Duologic

This comment was marked as outdated.

@Duologic Duologic changed the title WIP g11 feat: generate Grafonnet for Grafana v11.0.0 May 24, 2024
@Duologic Duologic marked this pull request as ready for review May 24, 2024 08:59
@Duologic Duologic requested a review from a team as a code owner May 24, 2024 08:59
@Duologic Duologic marked this pull request as draft May 24, 2024 09:02
@Duologic

This comment was marked as resolved.

@Duologic Duologic marked this pull request as ready for review May 24, 2024 09:30
@@ -282,7 +282,7 @@ PARAMETERS:
* **value** (`boolean`)
- default value: `true`


?? default is missing or false ??
Copy link
Contributor

Choose a reason for hiding this comment

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

huh?

Copy link
Member Author

Choose a reason for hiding this comment

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

That comes from the schemas, I just scanned for that sentence but can't find the source immediately, cc/ @K-Phoen, do you know?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I'll leave it as such.

@@ -378,6 +380,28 @@ PARAMETERS:
* **value** (`object`)

TODO docs
Copy link
Contributor

Choose a reason for hiding this comment

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

todo? We've now got docs?

Copy link
Member Author

Choose a reason for hiding this comment

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

That comes from the upstream schemas in grafana/grafana, authors of that panel should document this.

@@ -19,7 +19,6 @@ jb init
cp -r "${REPO_DIR}/generator" generator
cp -r "${REPO_DIR}/generator/jsonnetfile.lock.json" .
jb install
jb install "github.com/grafana/grok/jsonnet/${VERSION}@main"
Copy link
Contributor

Choose a reason for hiding this comment

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

yay!

@Duologic Duologic merged commit 40f903c into main May 24, 2024
2 checks passed
@Duologic Duologic deleted the wip_g11 branch May 24, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants