Skip to content

fix(release): pin git-cliff and guard entry loss - #86

Merged
michen00 merged 6 commits into
mainfrom
fix/pin-git-cliff
Sep 15, 2026
Merged

michen00 merged 6 commits into
mainfrom
fix/pin-git-cliff

Conversation

@michen00

@michen00 michen00 commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

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.sh regenerates the entire changelog from tags and commits, so whichever git-cliff runs decides what released history says. All three install sites used tool: git-cliff, which taiki-e/install-action resolves 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, 4a754ba chore: 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-revs is 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-actions ecosystem reads uses: references, so it maintains taiki-e/install-action and treats the tool: 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.

  • a released section that loses an identity is refused, naming the commit;
  • a section that vanishes is refused, catching a whole-section swap;
  • gaining entries stays allowed — a parser matching what it used to skip is an addition;
  • [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.yml checks 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_planned is 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 in bot-automerge.yml's hold list.

Test plan

Both shell blocks were extracted from the YAML and executed, not reasoned about.

  • Against the real regression, end to end. Under 2.14.1 the script exits non-zero with section [0.0.1] lost a released entry: 4a754ba and leaves CHANGELOG.md untouched. Under 2.13.1 it publishes with the entry intact.
  • Eight cases in test-stamp-changelog.sh using 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, Unreleased emptying, plus the pre-existing argument and section guards. 15 pass.
  • Mutation-checked. The entry-swap case fails against the previous count-only guard, so it tests the fix rather than restating it.
  • The watch workflow, seven scenarios with a stubbed gh: tracker closed, upstream open, already reported, already reported with 20k lines after the marker, closed as completed, closed as not_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.
  • actionlint clean, shellcheck --shell=sh clean, make check green.

From review

Finding Reviewer Disposition
Entry swaps erase released history Qodo fixed — 6cb1f63
Fixture failures keep tests running Qodo fixed — 6cb1f63
Multi-line error output loses its prefix Copilot fixed — 6cb1f63
Busy tracker gets duplicate alerts (SIGPIPE) Qodo fixed — 9aebad9
Pin watcher omits its success exit Qodo fixed — 9aebad9
Mutable test data uses uppercase names Qodo declined — exported env var read by a separate process, and pre-existing

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, before and 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 main refreshes it automatically.

🤖 Generated with Claude Code


Closes #88 (review-convergence bulletin)

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-commenter

codecov-commenter commented Sep 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.09091% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.57%. Comparing base (db4e21b) to head (9aebad9).

Files with missing lines Patch % Lines
scripts/release/stamp-changelog.sh 0.00% 43 Missing ⚠️
tests/test-stamp-changelog.sh 98.30% 3 Missing ⚠️
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     
Flag Coverage Δ
integration 0.97% <0.00%> (-0.08%) ⬇️
unit 50.98% <79.09%> (+3.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Pin git-cliff and prevent released changelog entry loss

🐞 Bug fix 🧪 Tests ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Pins git-cliff 2.13.1 across changelog workflows for reproducible released history.
• Rejects regenerated changelogs that lose entries or entire released sections.
• Tests losses, section swaps, allowed additions, and Unreleased promotion.
Diagram

graph TD
  A["Release workflows"] --> B["git-cliff 2.13.1"] --> C["Temporary changelog"] --> D{"History preserved?"}
  D -->|Yes| E["Published changelog"]
  D -->|No| F["Abort release"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Compare individual released entries
  • ➕ Detects an old entry disappearing even when another entry replaces it
  • ➕ Expresses the preservation invariant more directly than aggregate counts
  • ➖ Rendered entry changes could create false positives without careful normalization
  • ➖ Couples validation more tightly to git-cliff output formatting
2. Preserve released sections verbatim
  • ➕ Prevents the generator from rewriting previously published history
  • ➕ Avoids behavioral drift from future git-cliff versions
  • ➖ Requires custom splicing and link-management logic
  • ➖ Could prevent legitimate corrections or newly recognized historical entries

Recommendation: Keep the PR’s combined pin and per-section guard. It immediately prevents the known regression while still allowing newly recognized entries, and avoids brittle comparisons against rendered text. A normalized entry-identity comparison could be considered later if equal-count substitutions become a demonstrated risk.

Files changed (4) +214 / -3

Bug fix (1) +74 / -0
stamp-changelog.shGuard released sections against entry loss +74/-0

Guard released sections against entry loss

• Adds an AWK-based comparison of entry counts for every existing released section. Regeneration now fails without modifying the changelog when a section disappears or loses entries, while additions and Unreleased promotion remain allowed.

scripts/release/stamp-changelog.sh

Tests (1) +113 / -0
test-stamp-changelog.shCover per-section changelog preservation rules +113/-0

Cover per-section changelog preservation rules

• Adds hermetic regression tests for lost entries, swapped sections, permitted entry gains, and promotion of Unreleased entries. Failure cases also verify that the original changelog remains unchanged.

tests/test-stamp-changelog.sh

Other (2) +27 / -3
changelog-autoupdate.ymlPin git-cliff for scheduled changelog updates +5/-1

Pin git-cliff for scheduled changelog updates

• Pins the scheduled changelog workflow to git-cliff 2.13.1 so historical output cannot change through an implicit tool upgrade. Documents that Dependabot cannot maintain the tool input pin.

.github/workflows/changelog-autoupdate.yml

release-pr.ymlPin git-cliff across release preparation jobs +22/-2

Pin git-cliff across release preparation jobs

• Pins both release workflow installation sites to git-cliff 2.13.1. Adds maintenance guidance explaining the reproducibility risk, manual upgrade process, and expected changelog verification.

.github/workflows/release-pr.yml

@qodo-code-review

qodo-code-review Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Entry swaps erase released history ✓ 🐞 ≡
Description
The END check compares only new_count[s] with old_count[s], rather than verifying that every
old entry remains in its section. When a parser change drops one released commit while newly
recognizing another in that section, the equal count passes and the regenerated changelog publishes
without the old commit.
Code

scripts/release/stamp-changelog.sh[R149-150]

+			if (new_count[s] < old_count[s]) {
+				printf "section [%s] lost entries (%d -> %d)\n", s, old_count[s], new_count[s]
Evidence
The guard explicitly permits newly recognized entries and counts only lines beginning with - ,
then rejects solely when the regenerated count is lower. Consequently, simultaneous removal and
addition in one section is indistinguishable from an unchanged section, even though the configured
changelog output includes stable commit IDs that could be compared.

scripts/release/stamp-changelog.sh[96-99]
scripts/release/stamp-changelog.sh[122-139]
scripts/release/stamp-changelog.sh[141-154]
cliff.toml[44-59]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The per-section guard detects only a net reduction in entry count. A regeneration that removes an existing released entry and adds a different entry to the same section retains the count and bypasses the guard.

## Fix Focus Areas
- scripts/release/stamp-changelog.sh[104-156]
- tests/test-stamp-changelog.sh[210-287]

## Recommended Fix
Extract a stable identity for each released changelog entry, such as the commit SHA from its commit URL, and require every old identity to remain in the same regenerated section while continuing to allow additional identities. Add a test where one entry is removed and a different entry is added so the section count remains unchanged, and assert that stamping is refused.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Pin watcher omits its success exit ✓ 📘 ≡ ⭐
Description
The Report when the upstream fix lands shell block falls off the end after its final notice
instead of calling exit 0. When the workflow posts its first tracker comment, its success status
depends on echo remaining the final command, unlike the other successful paths that exit
explicitly.
Code

.github/workflows/git-cliff-pin-watch.yml[107]

+          echo "::notice::reported on #${TRACKER}."
Evidence
Compliance rule 406878 requires an explicit exit on every main shell execution path. The new
workflow block ends after echo on line 107 without an explicit exit 0.

Rule 406878: Shell scripts must use explicit exit codes
.github/workflows/git-cliff-pin-watch.yml[106-107]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new pin-watcher shell block falls off the end after posting its notice instead of explicitly signaling successful completion.

## Fix Focus Areas
- .github/workflows/git-cliff-pin-watch.yml[106-107]

## Recommended Fix
Add `exit 0` after the final notice so the successful posting path has an explicit exit code, matching the block's other success paths.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Busy tracker gets duplicate alerts ✓ 🐞 ☼ ⭐
Description
The marker check pipes all existing comments through grep -qF while pipefail is enabled, so an
early match can make the producer fail with a broken pipe and turn the successful search into a
nonzero pipeline. Once comments following the marker exceed the pipe buffer, the condition falls
through to the posting command and repeats the notification on subsequent monthly runs.
Code

.github/workflows/git-cliff-pin-watch.yml[72]

+          if printf '%s' "$existing" | grep -qF "$MARKER"; then
Evidence
The workflow enables pipefail, captures every tracker comment, and tests the marker using a
quiet-grep pipeline before unconditionally reaching the comment command. A producer-side broken pipe
therefore changes an existing-marker match into fallthrough and another posted comment.

.github/workflows/git-cliff-pin-watch.yml[47-47]
.github/workflows/git-cliff-pin-watch.yml[71-75]
.github/workflows/git-cliff-pin-watch.yml[106-107]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The existing-comment marker check combines `grep -q` with a pipeline under `set -o pipefail`. When the marker is found before a sufficiently large remaining payload is written, the producer can receive a broken pipe, causing the condition to miss the marker and post a duplicate alert.

## Fix Focus Areas
- .github/workflows/git-cliff-pin-watch.yml[71-75]

## Recommended Fix
Search the captured `existing` value without a producer pipeline, such as with a Bash here-string or a shell pattern match. Preserve the current early exit when the marker is present.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Mutable test data uses uppercase names ✗ 📘 ✧
Description
The added test cases repeatedly assign and export the mutable STUB_BODY variable despite its
uppercase name. Each new scenario replaces this value, so later edits can mistake it for an
immutable constant rather than per-test fixture state.
Code

tests/test-stamp-changelog.sh[217]

+STUB_BODY="# Changelog
Evidence
Rule 406880 permits uppercase script-defined names only for constants that are never reassigned and
are intended as environment or configuration variables. The cited additions assign STUB_BODY
several different values across the new test cases.

Rule 406880: Use lowercase_with_underscores for shell variable names
tests/test-stamp-changelog.sh[217-231]
tests/test-stamp-changelog.sh[245-255]
tests/test-stamp-changelog.sh[270-281]
tests/test-stamp-changelog.sh[304-315]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The mutable fixture variable `STUB_BODY` is uppercase even though it is reassigned for each test scenario, contrary to the required shell-variable naming convention.

## Fix Focus Areas
- tests/test-stamp-changelog.sh[217-315]

## Recommended Fix
Rename `STUB_BODY` to a lowercase name such as `stub_body` throughout the test and generated stub, preserving its export and subprocess behavior.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Fixture failures keep tests running ✓ 📘 ≡
Description
The newly added write_changelog and printf fixture commands run under set -uo pipefail without
checking their exit statuses. If the temporary changelog cannot be written, execution continues into
stub configuration and assertions, conflating an infrastructure failure with the behavior being
tested.
Code

tests/test-stamp-changelog.sh[R215-216]

+write_changelog "$changelog"
+printf '\n## [0.0.9] - 2026-01-01\n\n- older\n- older still\n' >>"$changelog"
Evidence
Rules 406873 and 406886 require important shell commands to run under set -e or have explicit
exit-status handling. The test script enables only set -uo pipefail, while the cited added fixture
commands have no guard.

Rule 406873: Do not silently ignore exit codes in shell scripts
Rule 406886: Shell scripts must not ignore exit codes and must handle errors explicitly
tests/test-stamp-changelog.sh[4-4]
tests/test-stamp-changelog.sh[215-216]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New fixture-creation commands can fail without terminating the test script because it does not enable `errexit` or check those commands explicitly.

## Fix Focus Areas
- tests/test-stamp-changelog.sh[215-216]
- tests/test-stamp-changelog.sh[244-245]
- tests/test-stamp-changelog.sh[269-270]
- tests/test-stamp-changelog.sh[291-303]

## Recommended Fix
Add explicit non-zero failure handling to each fixture setup command, such as a dedicated fatal helper invoked with `||`, so an unreadable or unwritable fixture aborts the suite immediately.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 26 rules
Review mode: ⚖️ Balanced: This is a localized CI workflow behavior change affecting monthly issue-alert detection and exit status, so it merits a careful single-pass review but not redundant extended review.

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 9aebad9

Results up to commit 7cd095a ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Entry swaps erase released history ✓ 🐞 ≡
Description
The END check compares only new_count[s] with old_count[s], rather than verifying that every
old entry remains in its section. When a parser change drops one released commit while newly
recognizing another in that section, the equal count passes and the regenerated changelog publishes
without the old commit.
Code

scripts/release/stamp-changelog.sh[R149-150]

+			if (new_count[s] < old_count[s]) {
+				printf "section [%s] lost entries (%d -> %d)\n", s, old_count[s], new_count[s]
Evidence
The guard explicitly permits newly recognized entries and counts only lines beginning with - ,
then rejects solely when the regenerated count is lower. Consequently, simultaneous removal and
addition in one section is indistinguishable from an unchanged section, even though the configured
changelog output includes stable commit IDs that could be compared.

scripts/release/stamp-changelog.sh[96-99]
scripts/release/stamp-changelog.sh[122-139]
scripts/release/stamp-changelog.sh[141-154]
cliff.toml[44-59]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The per-section guard detects only a net reduction in entry count. A regeneration that removes an existing released entry and adds a different entry to the same section retains the count and bypasses the guard.

## Fix Focus Areas
- scripts/release/stamp-changelog.sh[104-156]
- tests/test-stamp-changelog.sh[210-287]

## Recommended Fix
Extract a stable identity for each released changelog entry, such as the commit SHA from its commit URL, and require every old identity to remain in the same regenerated section while continuing to allow additional identities. Add a test where one entry is removed and a different entry is added so the section count remains unchanged, and assert that stamping is refused.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Mutable test data uses uppercase names ✗ 📘 ✧
Description
The added test cases repeatedly assign and export the mutable STUB_BODY variable despite its
uppercase name. Each new scenario replaces this value, so later edits can mistake it for an
immutable constant rather than per-test fixture state.
Code

tests/test-stamp-changelog.sh[217]

+STUB_BODY="# Changelog
Evidence
Rule 406880 permits uppercase script-defined names only for constants that are never reassigned and
are intended as environment or configuration variables. The cited additions assign STUB_BODY
several different values across the new test cases.

Rule 406880: Use lowercase_with_underscores for shell variable names
tests/test-stamp-changelog.sh[217-231]
tests/test-stamp-changelog.sh[245-255]
tests/test-stamp-changelog.sh[270-281]
tests/test-stamp-changelog.sh[304-315]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The mutable fixture variable `STUB_BODY` is uppercase even though it is reassigned for each test scenario, contrary to the required shell-variable naming convention.

## Fix Focus Areas
- tests/test-stamp-changelog.sh[217-315]

## Recommended Fix
Rename `STUB_BODY` to a lowercase name such as `stub_body` throughout the test and generated stub, preserving its export and subprocess behavior.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Fixture failures keep tests running ✓ 📘 ≡
Description
The newly added write_changelog and printf fixture commands run under set -uo pipefail without
checking their exit statuses. If the temporary changelog cannot be written, execution continues into
stub configuration and assertions, conflating an infrastructure failure with the behavior being
tested.
Code

tests/test-stamp-changelog.sh[R215-216]

+write_changelog "$changelog"
+printf '\n## [0.0.9] - 2026-01-01\n\n- older\n- older still\n' >>"$changelog"
Evidence
Rules 406873 and 406886 require important shell commands to run under set -e or have explicit
exit-status handling. The test script enables only set -uo pipefail, while the cited added fixture
commands have no guard.

Rule 406873: Do not silently ignore exit codes in shell scripts
Rule 406886: Shell scripts must not ignore exit codes and must handle errors explicitly
tests/test-stamp-changelog.sh[4-4]
tests/test-stamp-changelog.sh[215-216]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New fixture-creation commands can fail without terminating the test script because it does not enable `errexit` or check those commands explicitly.

## Fix Focus Areas
- tests/test-stamp-changelog.sh[215-216]
- tests/test-stamp-changelog.sh[244-245]
- tests/test-stamp-changelog.sh[269-270]
- tests/test-stamp-changelog.sh[291-303]

## Recommended Fix
Add explicit non-zero failure handling to each fixture setup command, such as a dedicated fatal helper invoked with `||`, so an unreadable or unwritable fixture aborts the suite immediately.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread tests/test-stamp-changelog.sh Resolved
Comment thread tests/test-stamp-changelog.sh Resolved
Comment thread scripts/release/stamp-changelog.sh Resolved
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.sh to refuse regenerated changelogs that lose entries (excluding Unreleased).
  • Expand tests/test-stamp-changelog.sh with cases covering entry loss, section swaps, entry gains, and Unreleased emptying behavior.
  • Pin git-cliff to 2.13.1 in 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.

Comment thread scripts/release/stamp-changelog.sh Resolved
michen00 and others added 2 commits September 15, 2026 03:30
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>
@michen00
michen00 requested a lite review from Copilot September 15, 2026 10:38
@michen00

Copy link
Copy Markdown
Owner Author

/agentic_review

@michen00

Copy link
Copy Markdown
Owner Author

[Review-Convergence] Round 1: active

  • Head: 6cb1f63
  • Base ref: main
  • Base: db4e21b
  • CI: success
  • Bot threads: 0 unresolved (4 triaged and resolved this round)
  • Human threads: 0 unresolved
  • Clean signals: none valid at this head
  • Pending reviewers: Copilot, Qodo
  • Catch-up: none
  • Next action: wait for Copilot and Qodo on 6cb1f63
  • Next wakeup: ~4min (reviewer-pending first-tier floor)
  • Bulletin: Review convergence: PR #86 #88

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.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6cb1f63

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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>
@michen00
michen00 requested a lite review from Copilot September 15, 2026 10:47
@michen00

Copy link
Copy Markdown
Owner Author

/agentic_review

@michen00

Copy link
Copy Markdown
Owner Author

[Review-Convergence] Round 2: active

  • Head: 9aebad9
  • Base ref: main
  • Base: db4e21b
  • CI: pending
  • Bot threads: 0 unresolved (2 triaged and resolved this round)
  • Human threads: 0 unresolved
  • Clean signals: none valid at this head
  • Pending reviewers: Copilot, Qodo
  • Catch-up: none
  • Next action: wait for Copilot and Qodo on 9aebad9
  • Next wakeup: ~4min (reviewer-pending first-tier floor)
  • Bulletin: Review convergence: PR #86 #88

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.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9aebad9

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@michen00

Copy link
Copy Markdown
Owner Author

[Review-Convergence] Round 3: converged-merge-blocked

  • Head: 9aebad9
  • Base ref: main
  • Base: db4e21b
  • CI: success (11 passing, 1 skipped; combined status success)
  • Bot threads: 0 unresolved (6 total)
  • Human threads: 0 unresolved
  • Clean signals: Copilot (github), Qodo (qodo) — both at 9aebad9
  • Pending reviewers: none
  • Catch-up: none
  • Next action: human approving review; the ruleset requires 1 and there are 0
  • Bulletin: Review convergence: PR #86 #88

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 required_approving_review_count: 1 against 0 approving reviews — neither bot submits an APPROVED review, and approving is a non-goal for this runner. All 8 required contexts pass and thread resolution is satisfied, so that approval is the only remaining gate.

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.

@michen00
michen00 merged commit c08c96c into main Sep 15, 2026
13 checks passed
@michen00
michen00 deleted the fix/pin-git-cliff branch September 15, 2026 10:58
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.

Remove the git-cliff pin once orhun/git-cliff#1643 is fixed Review convergence: PR #86

3 participants