Skip to content

feat(ci): a changed chart must carry a new version - #462

Merged
bmscomp merged 1 commit into
mainfrom
ci/chart-version-bump-gate
Oct 24, 2026
Merged

bmscomp merged 1 commit into
mainfrom
ci/chart-version-bump-gate

Conversation

@bmscomp

@bmscomp bmscomp commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Why

The chart publisher in #461 never pushes a version that is already in the registry, so a chart's published digest never changes. The cost is that a chart change merged without a new Chart.yaml version is never published, and nothing says so. This is PR B of the chart publishing plan.

Replayed over main's 44 chart-touching commits since 2026-09-15, the gate would have caught:

What changes

scripts/chart_bumps.py checks every PR against its merge base:

  1. A chart whose packaged files changed carries a new, higher version.
    • "Packaged" follows each chart's .helmignore, using helm package's rules. So tests/ and the values-*.yaml overlays need no bump.
    • Negated rules are refused rather than guessed.
    • A version that goes down fails.
  2. A chart that packs a file:// subchart whose version moved carries a new version too.
    • In practice that is kates-platform.
    • The kafka-common consumers pin it exactly, so rule 1 already catches them.

A new chart needs no bump.

Deliberate choice: docs need no bump. README.md and docs/ are packaged, but nothing an install reads, so they ship with the chart's next version. Without this exemption, three README-only commits in the replay would have needed a bump. Easy to reverse if you'd rather hold docs to the same rule.

Where it runs

  • A Chart versions job in CI · Lint, on PRs that touch charts/. It runs the unit tests first. It is on Gate · Lint, and skipped on pushes to main.
  • make check runs the gate too.
  • CONTRIBUTING's CI table names it.

What this means for releases: a release pin PR now bumps kates-platform along with the other pinned charts. The gate fails until it does.

Tests

  • python3 -m unittest discover -s scripts -p 'test_chart_bumps.py': 16 tests. They cover helmignore matching (anchored, any-depth and directory rules, * not crossing /, negation refused) and version order. They also run both rules against a throwaway git repository with a chart and an umbrella.
  • The gate on this branch: OK.
  • The gate on this branch with one template edited and no bump: fails, naming the file.
  • The gate with kates bumped alone: fails, naming kates-platform.
  • The history replay described above, one run per commit against its parent.
  • actionlint 1.7.12, yamllint, scripts/check-versions.sh --workflows, make check-help.

Independent of #461; either can merge first.

publish-charts.yml never pushes a version that is already in the
registry, so a chart change merged without a new Chart.yaml version is
never published, and nothing says so. CI · Lint now holds every PR that
touches charts/ to two rules, against its merge base:

- A chart whose packaged files changed carries a new, higher version.
  "Packaged" follows the chart's .helmignore, the way helm package
  does, so tests/ and values-*.yaml overlays need no bump. README.md
  and docs/ need none either: nothing an install reads, they ship with
  the next version.
- A chart that packs a file:// subchart whose version moved carries a
  new version too. kates-platform vendors its five subcharts as they
  are on disk; without a bump, the published umbrella would keep the
  old ones. (The kafka-common consumers pin it exactly, so the first
  rule already covers them.)

A new chart needs no bump. Replayed over main's 44 chart commits since
2026-09-15, the gate flags four real misses (#456, #368, #157, #149:
template and values changes without a bump) and 31 commits that moved
a subchart without bumping kates-platform. From now on a release pin
PR bumps kates-platform as well.

scripts/chart_bumps.py has unit tests (scripts/test_chart_bumps.py),
which the job runs first. `make check` runs the gate too.
@bmscomp
bmscomp merged commit 0fefb99 into main Oct 24, 2026
53 checks passed
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.

1 participant