Skip to content

fix(helm): verify hand-made tags before every release attach, not just create - #96

Closed
tim-thacker-nullify wants to merge 1 commit into
fix/helm-publish-review-r5from
fix/helm-publish-review-r6
Closed

tim-thacker-nullify wants to merge 1 commit into
fix/helm-publish-review-r5from
fix/helm-publish-review-r6

Conversation

@tim-thacker-nullify

@tim-thacker-nullify tim-thacker-nullify commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Claude

Round-6 review of #95 found the tag step's hand-made-tag guard only ran on the branch that creates a fresh release.

  • A release hand-created in the GitHub UI with no asset skipped the tag/ancestry/tree check entirely and got main's package uploaded to it (R6-95-1).
  • git ls-remote --exit-code treated any non-zero exit as "no tag", so an unreachable remote fell through to gh release create --target, which GitHub ignores once a tag exists (R6-95-3).
  • The tag's tree was checked but never that its commit is on main, so a tag on a squash-merged PR branch passed (R6-95-2).
  • The tree comparison covered the whole manifests/ directory, so one chart's manifest change could fail another chart's tag check (R6-95-4).

Fix, all in the tag step:

  • Resolve tag existence once, failing loudly on any git ls-remote exit other than 0 or 2.
  • Whenever the tag exists, require both ancestry-on-main and a matching tree (scoped to helm-charts/<name> plus only the manifest paths that chart's own README references) before any upload or create.
  • publish-helm-repo.sh: verify_tag_chart_version now returns a distinct exit status for "not on main" so its three callers stop collapsing that into "or its tree is not <name> <version>".

Operational rule: never hand-create <chart>-v* tags or GitHub releases, including in the UI — release jobs create them.

The publish stack (#60 ← #65 ← #70 ← #75 ← #84 ← #95 ← this PR) collapses after a quick diff check.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…t create

The tag step only checked a pre-existing tag's tree (and never its ancestry
on main) in the branch that creates a fresh release; a release hand-made in
the GitHub UI with a missing asset skipped verification entirely and got
main's package uploaded to it. git ls-remote --exit-code also treated any
non-zero exit as "no tag", so an unreachable remote fell through to
gh release create --target, which GitHub ignores once a tag exists.

- Determine tag existence once via git ls-remote, failing loudly on any exit
  code other than 0 (tag exists) or 2 (no tag).
- Whenever the tag exists, require both its commit is an ancestor of main and
  its tree matches $target before any upload or create, whether or not a
  release already exists.
- Scope the tree comparison to helm-charts/<name> plus only the manifest
  files that chart's own README references, instead of the whole manifests/
  directory, so one chart's manifest change can no longer fail another
  chart's tag check.
- publish-helm-repo.sh: have verify_tag_chart_version return a distinct exit
  status for "not on main" so the three callers stop collapsing it into "or
  its tree is not <name> <version>".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tim-thacker-nullify added a commit that referenced this pull request Sep 15, 2026
fix(helm): verify hand-made tags before every release attach, not just create

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tim-thacker-nullify

Copy link
Copy Markdown
Member Author

Claude

Collapsed into #60 at aa9539f after passing adversarial review; all of this PR's commits are now in #60.

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