fix(ci): refuse a release tag that is not an ancestor of main #16
No reviewers
Labels
No labels
waiting-on-julian
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jlxq0/jmap-mcp!16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/tag-ancestry-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes half of #14.
v0.2.7andv0.2.8were cut from branches that were never merged and both published an image. The only gate on a tag build was that the tag matchesCargo.toml; ancestry was never consulted, in either pipeline.What changed
.forgejo/workflows/ci.ymlgains atag-ancestryjob thatdockernowneeds. It runs on every event rather than being skipped on non-tag builds, because a skipped job reportssuccess— the exact failure mode this repository already documents fordockeritself, and the reasonCI / dockeris not a required status context..github/workflows/release.ymlgains the equivalent step before it publishes to GHCR. Both pipelines had the same hole.This also makes the buildcache comment at
ci.yml:135true rather than hoped for: "a tag build is the same commit as themainbuild that preceded it" only holds if the tag is onmain.Watched it fail
Logic first, against real data, before wiring anything:
Then in CI on the real runner. This branch tip is itself not an ancestor of
main, so tagging it is the negative case with the gate already present at the tagged commit:cargopassing is what makes that attributable: the block came from the gate, not from a broken build. Probe tag deleted.Mutation-tested the peel
git rev-parseon an annotated tag returns the tag object, so I peeled with^{commit}. Checking whether that was load-bearing:git merge-base --is-ancestorpeels on its own, and both forms give identical verdicts onv0.2.7(fail) andv0.2.14(pass). So the peel does not change the gate outcome and is kept only so the sha in the error message names the commit. Recorded honestly inAGENTS.mdrather than claimed as a fix.Where it does bite is comparison, and that is measured:
A confident wrong answer for a tag that does point at that commit.
Not closed by this
v0.2.5andv0.2.6are images with no git tag at all. An ancestry gate cannot reach them, because a tag can be deleted after its image is published. Left open on #14.Codex reviewed the diff for bypasses: shallow clones, detached tag checkout, missing
origin/main, lightweight vs annotated tags, forks, and whetherdockercan run whentag-ancestryis skipped or fails. Answer:None.Refs #14