ci: compare only the newest changelog heading with PROJECT_VER - #16
Merged
Merged
Conversation
The version check reads every `## X.Y.Z` heading in CHANGELOG.md and requires each one to equal PROJECT_VER. With a single release that holds. The next release adds its heading above 0.1.0, the older heading then fails the check, and the invariants job fails on the very change that prepares the release. The check's own message calls the copy "the newest heading", which is what it was meant to compare. Only the first match in the changelog is now treated as a copy of the version. The other copies, the README status line and the device.describe example, are still checked in full. Verified on a copy of the tree set up as the next release would be: PROJECT_VER, the status line and the example at 0.2.0, and a 0.2.0 heading above 0.1.0. The previous script exits 1 with "the newest heading says 0.1.0", and this one exits 0. With the 0.2.0 heading left out, this one still exits 1. On the tree as it is, both exit 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Compares only the newest
## X.Y.Zheading inCHANGELOG.mdwithPROJECT_VER, instead of every heading.Why
tools/check-invariants.pyreads every version heading in the changelog and requires each one to equalPROJECT_VER. With a single release that holds. The next release adds its heading above0.1.0, the older heading then fails the check, and the requiredinvariantsjob fails on the change that prepares the release. The check's own message calls this copy "the newest heading", which is what it was meant to compare.Change
Only the first match in the changelog is treated as a copy of the version. The other copies, the README status line and the
device.describeexample, are still checked in full.Verification
python tools/check-invariants.pyexits 0 on the tree as it is, before and after this change.PROJECT_VER, the status line and the example at0.2.0, and a0.2.0heading above0.1.0), the previous script exits 1 with "the newest heading says 0.1.0", and this one exits 0.0.2.0heading left out of that copy, this one still exits 1, so a release that forgets its changelog entry is still caught.Interface and documentation
🤖 Generated with Claude Code