Repository navigation
fix(release): pin git-cliff and guard entry loss - #86
Conversation
stamp-changelog.sh regenerates the whole changelog from tags and commits, so whichever git-cliff runs decides what released history says. The workflows installed it unpinned, and 2.14.0 changed the answer: it added an ignore rule keyed on .git-blame-ignore-revs that also drops the commit which created that file. Regenerating under 2.14.1 silently deleted one entry from [0.0.1], released in December. Caught in review of the pending v0.1.2 release PR. Pinned to 2.13.1 at all three install sites. Dependabot cannot maintain this: its github-actions ecosystem reads `uses:` references, so it sees the action but not the `tool:` input, which to it is an opaque string. Moving the pin is therefore a hand edit, and the comment says so rather than leaving a stale pin to be discovered. The existing guard counts `## [` sections in total, which a loss inside a surviving section cannot reduce. It now also compares entries per released section and refuses a regeneration where any section comes back short or missing -- the latter catching a swap, which leaves the total untouched. Gaining entries stays allowed: a parser that starts matching what it skipped is an addition. Unreleased is excluded, since emptying it is what stamping does. Verified against the real regression: 2.14.1 now exits non-zero naming [0.0.1] 74 -> 73 and leaves the file untouched, and 2.13.1 still publishes with the entry intact. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
==========================================
+ Coverage 47.93% 51.57% +3.64%
==========================================
Files 31 31
Lines 1863 2092 +229
==========================================
+ Hits 893 1079 +186
- Misses 970 1013 +43
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR Summary by QodoPin git-cliff and prevent released changelog entry loss
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
The pin was justified as reproducibility, which oversells it. With the entry guard in place, a floating git-cliff cannot lose released history -- the guard refuses the regeneration. What floating can still do is fail a release at the moment someone is cutting one, which is the whole of what this pin prevents while 2.14.x is broken. So the note now names orhun/git-cliff#1643 as the condition for removing it, and says to prefer dropping the pin over bumping it once that ships. Floating then picks up fixes, the guard covers loss, and a change it permits -- reformatting at the same entry count -- is visible in the release PR diff that gets read before merging. Comments only; no behavior change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The workflow comments explain the pin but are only read by someone who already opened those files, and the trigger for removing it is upstream rather than local. #87 carries the removal steps and shows up in the issue list on its own. Comments only; no behavior change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The changes add a safety guard with corresponding tests and a narrowly-scoped temporary workflow pin, with no evident functional regressions.
Pull request overview
This PR hardens the release changelog stamping flow against upstream git-cliff regressions by (1) pinning git-cliff to a known-good version in workflows and (2) extending stamp-changelog.sh with a per-released-section entry-count guard to prevent silently losing already-released changelog history.
Changes:
- Add a per-section entry-count comparison in
scripts/release/stamp-changelog.shto refuse regenerated changelogs that lose entries (excludingUnreleased). - Expand
tests/test-stamp-changelog.shwith cases covering entry loss, section swaps, entry gains, andUnreleasedemptying behavior. - Pin
git-cliffto2.13.1in the release and changelog autoupdate workflows as a temporary stopgap.
File summaries
| File | Description |
|---|---|
tests/test-stamp-changelog.sh |
Adds coverage for the new per-section entry-loss guard and related edge cases. |
scripts/release/stamp-changelog.sh |
Implements the per-section released-history guard during changelog regeneration. |
.github/workflows/release-pr.yml |
Pins git-cliff@2.13.1 for release PR generation and stamping to avoid the regression. |
.github/workflows/changelog-autoupdate.yml |
Pins git-cliff@2.13.1 for scheduled Unreleased refreshes to keep output consistent with releases. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The pin in release-pr.yml and changelog-autoupdate.yml comes off when orhun/git-cliff#1643 is fixed, and that is an upstream event with no local trigger. The pin's comments explain themselves to whoever opens those files and #87 sits in the issue list, but neither says anything when the thing they are waiting on actually happens. Monthly, it checks whether that issue has closed and comments once on #87 if so. A closed tracker is its own end condition, so it goes quiet by itself when the pin is gone. Reports rather than acts. Removing the pin means confirming the fix reached a published release and regenerating the changelog to check it is unchanged, which is judgement, not a patch. `not_planned` is reported too, and named: upstream declining the bug still needs a decision here, just a different one. No checkout and no `uses:`, so nothing Dependabot can reach and no entry needed in bot-automerge.yml's hold list. Each query is assigned before it is tested rather than piped into one, so a failed call kills the step instead of reading as "nothing to do". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three review findings on the entry guard, all on the same code path. Counting entries per section misses a swap inside one. A parser change that stops matching one released commit and starts matching another in the same section leaves the count identical, and the old entry is published away. So compare identities instead: the commit SHA from the entry's link, which survives any rendering change git-cliff makes to the line around it, falling back to the entry text for the two [0.0.0] entries that predate that template. Every identity a released section has now must still be there afterwards; gaining entries stays allowed. Checked against the real changelog -- 238 of 240 released entries carry a SHA, and all 240 identities survive a 2.13.1 regeneration, so this does not block the release it was written for. The error path printed only the first line with a prefix, leaving the rest unlabelled when several sections fail at once. Every line is prefixed now. Fixture writes in the test suite were unchecked. That matters more than it looks: the suite runs without `errexit`, so a failed write left the changelog absent, the script refused it for the wrong reason, and the negative cases passed while testing nothing. Reported by Qodo (entry swaps, fixture failures) and Copilot (multi-line output) on #86. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
/agentic_review |
|
[Review-Convergence] Round 1: active
Three findings fixed in 6cb1f63, one declined with evidence. Copilot's earlier approval was earned at 4df4b37 and Qodo's pass at 7cd095a; neither propagates past the intervening commits, so both were re-requested against the current head. |
|
Code review by qodo was updated up to the latest commit 6cb1f63 |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are well-scoped, add automated coverage for the new guard conditions, and reduce release risk without introducing unsafe behavior.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Lite
The duplicate-alert guard tested for its own marker by piping the comment bodies into `grep -q`. grep exits at the first matching line, so a producer still writing gets SIGPIPE, and `pipefail` turns the successful search into a non-zero pipeline: the marker is found and the test reads false. Reproduced rather than assumed. A single long line does not trigger it -- grep has to read the whole line before it can match, so the producer finishes first. The real shape does: marker on line 1 with 20k lines after it returns 141 and reports not-found, which would repost this alert every month for as long as the pin lives. A here-string has no producer to kill. It is also how bot-automerge.yml already tests its kill-switch label, for this reason; the pipe here was the outlier. Also exits 0 explicitly on the posting path, like the three paths above it, rather than inheriting whatever echo returned. Reported by Qodo on #86. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
/agentic_review |
|
[Review-Convergence] Round 2: active
Copilot approved 6cb1f63 with no new comments. Qodo found two more on the watch workflow, both fixed in 9aebad9 — the substantive one being a SIGPIPE in the duplicate-alert guard that would have reposted the alert every month. Copilot's approval does not carry to 9aebad9, since the fix touched a file the PR owns, so both were re-requested. |
|
Code review by qodo was updated up to the latest commit 9aebad9 |
There was a problem hiding this comment.
🟢 Approval recommended
The guard logic is consistent with the repository’s changelog entry format (commit SHA links) and the new tests/workflow changes collectively prevent silent released-history loss while keeping the temporary pin clearly scoped and trackable.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
[Review-Convergence] Round 3: converged-merge-blocked
Bot convergence is complete. Copilot returned "🟢 Approval recommended" with 0 new comments, and Qodo's summary advanced past the trigger with a per-pass marker naming 9aebad9 and every category at (0). Merge is blocked only by Six findings across three rounds: five fixed, one declined with evidence. The PR body has been reconciled against the branch, since the runner pushed commits during the cycle and the description still framed the guard as counting entries rather than comparing identities. |
Found while reviewing #83, the pending v0.1.2 release PR: it deleted one entry from the
[0.0.1]section, released in December. Nothing in the diff explained why, because the cause was not in this repository.What happened
stamp-changelog.shregenerates the entire changelog from tags and commits, so whichever git-cliff runs decides what released history says. All three install sites usedtool: git-cliff, whichtaiki-e/install-actionresolves to the newest release. CI used 2.14.1; a local 2.13.1 produces different output.git-cliff 2.14.0 added "(git) Ignore commits listed in
.git-blame-ignore-revs" (#1585). The dropped commit, 4a754bachore: add blank .git-blame-ignore-revs, is not listed in that file. Isolated against 2.14.1, the rule is that the path is excluded rather than the listed revisions: a commit whose entire diff is.git-blame-ignore-revsis left with no changed files and disappears, while one touching it alongside other files survives. Reported as orhun/git-cliff#1643 with a standalone repro.The pin — a stopgap, not a policy
Pinned to 2.13.1 at all three sites. With the guard below in place a floating git-cliff cannot lose released history; it would fail the release instead. The pin's only job is keeping a broken upstream from blocking a release someone is cutting today, so the comments name #1643 as the condition for removal and say to prefer dropping the pin over bumping it once that ships. Reproducibility for its own sake is not what this buys.
Meanwhile it is a hand edit: Dependabot's
github-actionsecosystem readsuses:references, so it maintainstaiki-e/install-actionand treats thetool:value as an opaque string. Tracked in #87.The guard — identity, not arithmetic
The pre-existing check counts
## [sections in total. A loss inside a surviving section cannot reduce that total, which is why the 2.14.1 deletion shipped.Review moved this from counting to comparing identities, which is a stronger property than the first draft had. Counting entries per section still misses a swap inside one: a parser change that stops matching one released commit and starts matching another in the same section leaves the count identical and publishes the old entry away.
Identity is the 40-character commit SHA in the entry's link, which survives any rendering change git-cliff makes to the line around it — that matters, because a body-template change is routine and a text-keyed guard would refuse every such upgrade as a loss. The two
[0.0.0]entries predating that template fall back to their own text.[Unreleased]is excluded, because emptying it into the new version's section is what stamping does.Checked before adopting, since a stricter guard that blocks the release it was written for would be worse than the gap: 238 of 240 released entries carry a SHA, and all 240 identities survive a 2.13.1 regeneration.
Noticing when the pin can go
git-cliff-pin-watch.ymlchecks monthly whether #1643 has closed and comments once on #87 if it has. The pin's comments explain themselves to whoever opens those files and #87 sits in the issue list, but neither says anything when the upstream event happens, and there is no telling when that is.It reports rather than acts — removing the pin means confirming the fix reached a published release and regenerating the changelog, which is judgement, not a patch. A closed #87 is its own end condition.
not_plannedis reported too, and named, since upstream declining the bug still needs a decision here.No checkout and no
uses:, so nothing Dependabot can reach and no entry needed inbot-automerge.yml's hold list.Test plan
Both shell blocks were extracted from the YAML and executed, not reasoned about.
section [0.0.1] lost a released entry: 4a754baand leavesCHANGELOG.mduntouched. Under 2.13.1 it publishes with the entry intact.test-stamp-changelog.shusing the existing git-cliff stub: entry loss, section swap, entry swap inside a section, a rerendered entry under the same SHA (the allowed direction), entry gain,Unreleasedemptying, plus the pre-existing argument and section guards. 15 pass.gh: tracker closed, upstream open, already reported, already reported with 20k lines after the marker, closed ascompleted, closed asnot_planned, and a failing query — which exits non-zero rather than reading as "nothing to do". That large-payload case posts a duplicate against the pre-review form and is the regression test for the SIGPIPE fix below.actionlintclean,shellcheck --shell=shclean,make checkgreen.From review
Two are worth reading past their titles. The fixture-failure one was described as conflating infrastructure with behaviour; the actual consequence is a silent false pass — a failed fixture write leaves the changelog absent, the script refuses it for its own unrelated reason,
beforeand after are both empty, and the negative case reports green having never invoked the guard. And the SIGPIPE one does not reproduce on a single long line, because grep must read the whole line before matching and the producer finishes first; it needs the real shape, a marker on an early line with bulk after, which returns 141 and would repost the alert monthly for the life of the pin.What this means for #83
It was built by 2.14.1 and carries the deletion. It should be regenerated once this lands rather than merged — otherwise the release edits December's history. The next push to
mainrefreshes it automatically.🤖 Generated with Claude Code
Closes #88 (review-convergence bulletin)