chore(changelog): fail when a released section no longer matches its tag - #670
Merged
Merged
Conversation
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.
Summary
An entry added to a released section of
CHANGELOG.mdwas not invalid, it was invisible:test/changelog-rule.shvalidates the entries inside[Unreleased], so an entry that is notthere is not checked, it is absent.
test/changelog-frozen.shcompares each## [X.Y.Z]section against the same section at itstag, using the extraction
release.yamluses to build the notes — so it compares what wasactually published rather than something adjacent to it.
What running it found
Three instances, not the two the issue named. The oldest has been in the file since August:
[0.2.2]2c11460(#277, 7 Aug)### Fixedentry appended to a section tagged 4 Aug[0.12.0]unlessentry[0.14.0]16 of the 18 released sections are byte-identical to their tags.
Why it is not a prohibition
[0.9.0]diverges on purpose:713cd07(#556) added a### Migrationblock the day itshipped, because the breaking entry named plan syntax only while the same rule governs
~{…}in a template. The check as the issue described it — differ and fail — would have blocked that,
and #556 was right.
So the goal is that a published section cannot be edited invisibly, not that it cannot be
edited. The shape chosen is the one
test/e2e/def-coverage.shalready uses: comparison plus anamed allowance carrying its reason, so adding a line to it is part of the change and a
reviewer reads why. A digest file was the alternative and was rejected — a digest can be updated
without anyone reading what changed, and it is one more thing to keep in step at release time.
[0.2.2]is in that list too, and labelled as the defect rather than as a legitimate edit:repairing it would only move the divergence to the section that actually shipped the entry, and
the published notes for v0.2.2 never contained it anyway.
Test plan
Mutation-tested: an entry inserted into
[0.13.0]turns it red, printing the diff and namingthe version.
CI needed a fix to work at all.
actions/checkout@v7with nofetch-depthis a depth-1clone with no tags, so the check would have been a silent no-op on every run. The
coveragejob's checkout now sets
fetch-depth: 0, with the reason on the line — checked rather thanassumed, which is what the issue asked for.
Added to the pre-PR list in
CLAUDE.md: a check nobody runs locally is a check that fails in CI.Closes #669