fix(deployment): fix schema docs annotations and guard them in CI - #7035
Open
corneliusroemer wants to merge 1 commit into
Open
fix(deployment): fix schema docs annotations and guard them in CI#7035corneliusroemer wants to merge 1 commit into
corneliusroemer wants to merge 1 commit into
Conversation
The values.schema.json annotations that drive the Helm chart config reference are custom keywords, so JSON Schema silently ignores mistakes in them. Fixes eight `group` typos (the docs only read `groups`), the `referenceGenomes` group name that no docs section renders, the doubly-nested `public.properties.properties` that meant its four URL keys were never validated, and a stray `additionalProperties` inside a properties map. Adds kubernetes/utils/check_schema_annotations.py, wired into helm-schema-lint and pre-commit, which catches all of the above.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the Helm chart configuration documentation pipeline by fixing custom annotation mistakes in values.schema.json and adding a dedicated linter to fail CI/pre-commit when schema annotations or schema structure drift in ways that would silently break the rendered docs.
Changes:
- Fixes schema annotation issues in
kubernetes/loculus/values.schema.json(e.g.,group→groups, corrects docs group name, and repairs schema structure so keys are validated/rendered as intended). - Adds
kubernetes/utils/check_schema_annotations.pyto lint custom schema annotations and detect likely unintended schema nesting mistakes. - Wires the new checker into both pre-commit and the
helm-schema-lintGitHub Actions workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| kubernetes/utils/check_schema_annotations.py | New linter to validate custom values.schema.json annotations and catch structural schema slips. |
| kubernetes/loculus/values.schema.json | Fixes docs annotation typos/group names and corrects schema structure so docs + validation behave as expected. |
| .pre-commit-config.yaml | Runs the schema-annotation checker locally on relevant schema/docs changes. |
| .github/workflows/helm-schema-lint.yaml | Runs the schema-annotation checker in CI when kubernetes/docs schema reference inputs change. |
Suppressed comments (1)
kubernetes/loculus/values.schema.json:1378
- Spelling/capitalization: GitHub is a proper noun and should be capitalized consistently in the schema descriptions.
"description": "A github repository belonging to the given organization."
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| entry: python3 kubernetes/utils/check_schema_annotations.py | ||
| language: system | ||
| pass_filenames: false | ||
| files: ^(kubernetes/loculus/values.schema.json|docs/src/content/docs/reference/helm-chart-config.mdx)$ |
| "group": ["general"], | ||
| "groups": ["general"], | ||
| "type": "string", | ||
| "description": "A github organization or username." |
Comment on lines
+59
to
+62
| SINGLE_SCHEMA = {"not", "if", "then", "else", "items", "contains", "propertyNames", | ||
| "additionalProperties", "additionalItems"} | ||
| SCHEMA_LIST = {"allOf", "anyOf", "oneOf", "prefixItems"} | ||
| NAMED_SCHEMAS = {"properties", "patternProperties", "definitions", "$defs", "dependencies"} |
| "group": ["general"], | ||
| "groups": ["general"], | ||
| "type": "string", | ||
| "description": "An optional issuetemplate to use." |
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.
The values.schema.json annotations that drive the Helm chart config reference are
custom keywords, so JSON Schema silently ignores mistakes in them. Fixes eight
grouptypos (the docs only readgroups), thereferenceGenomesgroup namethat no docs section renders, the doubly-nested
public.properties.propertiesthat meant its four URL keys were never validated, and a stray
additionalPropertiesinside a properties map. Addskubernetes/utils/check_schema_annotations.py, wired into helm-schema-lint and
pre-commit, which catches all of the above.
Screenshot
Before:
Missing schema entries due to typos
🚀 Preview: Add
previewlabel to enable