Stop rebuilding the Helm index from scratch on every release - #19
Merged
Conversation
`helm repo index --merge` takes a file path, not a URL. Handed a URL it merges nothing and still exits 0, so `|| true` was hiding nothing -- helm itself reported success while publishing an index that listed only the chart just built. Every release since v0.3.2 discarded the history; the tarballs survived on GitHub Releases, but helm could not see them. Fetch the published index to a file first, then merge that file, with an `else` branch for the case where no index exists yet. Drop `|| true`, so a real failure now fails the release instead of publishing a truncated index. Add a guard that refuses to publish when the index came out with fewer versions than it went in with. This failure was silent for nine releases; the next one should not be. Verified both ways: the fixed command takes the index from 15 versions to 16, and the old command takes it from 15 to 1 with the guard blocking the publish. The index URL deliberately stays on netclab.github.io. It works today and keeps working after the domain move through a 301 that curl -L follows, so this fix waits on nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 defect
helm repo index --mergetakes a file path, not a URL.release-on-tag.yamlhanded it a URL:helm merges nothing and exits 0, so
|| truewas hiding nothing — helm itself reported success. Reproduced with helm v4.1.3:--mergeargumentEvery release therefore published an index containing exactly one chart.
The damage
The published index listed 1 version (0.5.11) while 15 releases carry tarballs, back to
v0.3.2:Nothing was lost —
urls:points at GitHub Releases, and the tarballs are all there — but helm could not see them. It went unnoticed because every consumer pins the newest version, which was the one version in the index.Already repaired on
gh-pages(a14fcd2): the index now holds all 15 versions, 0.3.2 → 0.5.11, each pointing at its own release. This PR fixes the cause.The fix
curl -fsSL, then--mergethat file, with anelsebranch for the first-ever release.|| true, so a genuine failure fails the release rather than publishing a truncated index.Verification
yqis preinstalled onubuntu-24.04(4.53.3) — checked rather than assumed, since nothing else in this repo's CI uses it and a failure in this step would break a release after the tag.The index URL deliberately stays on
netclab.github.io: it works today and keeps working after the domain move through a 301 thatcurl -Lfollows, so this fix does not wait on the site migration.🤖 Generated with Claude Code