-
Notifications
You must be signed in to change notification settings - Fork 4.8k
chore(helm): generate values.schema.json from values.yaml #41780
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0ab3c34
chore(helm): generate values.schema.json from values.yaml
wyattwalter 0b239e3
chore(helm): use helm.appsmith.com as values schema $id
wyattwalter 329f5a2
chore(helm): link to env vars docs in applicationConfig description
wyattwalter 726f37f
chore(cursor): add rule for regenerating helm values.schema.json
wyattwalter e4c06b9
test(helm): add helm-unittest cases for values.schema.json
wyattwalter b007fd0
fix(helm): unblock unittest + helm-schema CI on Helm 4
wyattwalter 4a88eba
chore(helm): drop accidentally committed Chart.lock
wyattwalter 46fa344
fix(helm): accept boolean and integer applicationConfig values
wyattwalter 7594b40
ci(helm): branch-driven publish with PR pre-flight version check
wyattwalter 1f15647
fix(helm): address CodeRabbit review feedback
wyattwalter 2655f88
ci(helm): fix tagging, dedupe paths, exclude subchart tarballs from i…
wyattwalter 9ad4303
chore(helm): bump chart version to 3.8.0
wyattwalter f2fc338
test(helm): refresh chart label snapshot for 3.8.0 bump
wyattwalter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| --- | ||
| description: Regenerate the Helm chart's values.schema.json after editing deploy/helm/values.yaml or when the Helm Values Schema CI check is failing. | ||
| globs: deploy/helm/values.yaml,deploy/helm/values.schema.json | ||
| alwaysApply: false | ||
| --- | ||
| # Regenerate the Helm chart values schema | ||
|
|
||
| The Helm chart's `values.schema.json` is auto-generated from `values.yaml` via inline `# @schema` annotations. The CI workflow `.github/workflows/helm-schema.yml` regenerates it on PR and fails if the committed copy drifts. | ||
|
|
||
| ## When this rule applies | ||
|
|
||
| - After editing `deploy/helm/values.yaml` (annotations or default values) | ||
| - When the `Helm Values Schema` GitHub check is failing on a PR | ||
| - When asked to regenerate, update, or refresh the chart's values schema | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Install the [helm-values-schema-json](https://github.com/losisin/helm-values-schema-json) plugin once: | ||
|
|
||
| ```bash | ||
| helm plugin list | grep -q '^schema' || \ | ||
| helm plugin install https://github.com/losisin/helm-values-schema-json.git | ||
| ``` | ||
|
|
||
| ## Regenerate | ||
|
|
||
| From the repo root: | ||
|
|
||
| ```bash | ||
| cd deploy/helm && helm schema \ | ||
| --schema-root.title "Appsmith Helm chart values" \ | ||
| --schema-root.id "https://helm.appsmith.com/values.schema.json" \ | ||
| -o values.schema.json | ||
| ``` | ||
|
|
||
| The flags must match `.github/workflows/helm-schema.yml` exactly or CI will report drift. | ||
|
|
||
| ## After regenerating | ||
|
|
||
| 1. `git diff deploy/helm/values.schema.json` — review the diff | ||
| 2. If it reflects only the intended `values.yaml` edits, commit it alongside them | ||
| 3. If unexpected fields changed, double-check the annotations you added — likely a typo | ||
|
|
||
| ## Annotation gotchas | ||
|
|
||
| - Descriptions cannot contain `;` — it's the annotation separator inside `# @schema`. Rephrase. | ||
| - Item-level enums for arrays use `item: <type>; itemEnum: [...]`, **not** the nested `item: {enum: [...]}` form. | ||
| - Dependency pass-throughs (`redis`, `mongodb`, `postgresql`, `prometheus`, `mongodbOperator`) use the pattern: `# @schema additionalProperties: true` on the parent + `# @schema hidden: true` on each child the chart doesn't own. Each chart-owned `enabled` flag is left typed (boolean) since `Chart.yaml` uses it as a `condition`. | ||
|
|
||
| ## Reference | ||
|
|
||
| - Plugin docs: https://github.com/losisin/helm-values-schema-json | ||
| - Annotation reference (after plugin install): `~/Library/helm/plugins/helm-values-schema-json.git/docs/README.md` | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Helm Values Schema | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - release | ||
| paths: | ||
| - "deploy/helm/values.yaml" | ||
| - "deploy/helm/values.schema.json" | ||
| - ".github/workflows/helm-schema.yml" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: deploy/helm | ||
| shell: bash | ||
|
|
||
| steps: | ||
| - name: Checkout the code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Helm | ||
| uses: azure/setup-helm@v4 | ||
| with: | ||
| # Helm 4 — pinned so we don't silently track future major bumps. | ||
| version: v4.1.4 | ||
|
|
||
| - name: Install helm-values-schema-json plugin | ||
| # --verify=false is required by Helm 4's stricter plugin install path | ||
| # (the plugin source doesn't ship verification metadata). | ||
| run: helm plugin install --verify=false https://github.com/losisin/helm-values-schema-json.git | ||
|
|
||
| - name: Regenerate schema from values.yaml | ||
| run: | | ||
| helm schema \ | ||
| --schema-root.title "Appsmith Helm chart values" \ | ||
| --schema-root.id "https://helm.appsmith.com/values.schema.json" \ | ||
| -o values.schema.json.regenerated | ||
|
|
||
| - name: Fail if committed schema is out of date | ||
| run: | | ||
| if ! diff -u values.schema.json values.schema.json.regenerated; then | ||
| echo "" | ||
| echo "::error::values.schema.json is out of date. Regenerate locally with:" | ||
| echo "::error:: cd deploy/helm && helm schema --schema-root.title 'Appsmith Helm chart values' --schema-root.id 'https://helm.appsmith.com/values.schema.json' -o values.schema.json" | ||
| exit 1 | ||
| fi |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ on: | |
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| publish: | ||
| unittest: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| defaults: | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.