Skip to content

JSON Schema Keeps Failing Builds Irrespective of what the Changes Are #273

@ChrisJBurns

Description

@ChrisJBurns

The current schema dereference script is run in the pipeline for all changes. However even when there are no changes to the Helm chart itself, when the script is run, it generates changes which require a bump in the Helm chart - which shouldn't be necessary.

This is because the dereference script runs during pre-commit hooks and regenerates this file even when nothing in the actual Helm chart has changed. The script pulls from Kubernetes API schemas and expands $ref references, but:

  1. Kubernetes API schemas change - Even if the chart doesn't change, the underlying K8s API schemas get updated
  2. Non-deterministic ordering - The dereferencing process might reorder fields differently each time
  3. Formatting differences - Whitespace, indentation, or JSON serialisation differences

This creates "fake" schema changes that force unnecessary Helm chart version bumps.

We should evaluate whether there is a better way of writing the script so that it doesn't raise changes when nothing in the Chart has changed or even whether it adds the additional value that is worth the upkeep.

Potential fixes to improve the process:

  • The dereference script should only update the schema file when there are actual semantic changes to the chart's values.schema.tmpl.json or when explicitly requested, not on every pre-commit run. (most desirable?)
  • Remove the dereference script (most undesirable)
  • Create a job that runs the dereference script every night at a specific time that write the changes back to source control to avoid them coming up in a PR. This would however still require helm chart bumps (not as desirable)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions