Skip to content

ci: compare only the newest changelog heading with PROJECT_VER - #16

Merged
kkdev92 merged 1 commit into
mainfrom
ci/changelog-newest-heading
Sep 28, 2026
Merged

kkdev92 merged 1 commit into
mainfrom
ci/changelog-newest-heading

Conversation

@kkdev92

@kkdev92 kkdev92 commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Compares only the newest ## X.Y.Z heading in CHANGELOG.md with PROJECT_VER, instead of every heading.

Why

tools/check-invariants.py reads every version heading in the changelog 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 required invariants job 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.describe example, are still checked in full.

Verification

  • python tools/check-invariants.py exits 0 on the tree as it is, before and after this change.
  • 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 of that copy, this one still exits 1, so a release that forgets its changelog entry is still caught.
  • Firmware, QEMU and hardware checks do not apply: only the Python check changes.

Interface and documentation

  • No token, credential, passphrase, private address, or sensitive dump is included

🤖 Generated with Claude Code

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>
@kkdev92
kkdev92 merged commit dde0bda into main Sep 28, 2026
13 checks passed
@kkdev92
kkdev92 deleted the ci/changelog-newest-heading branch September 28, 2026 01:14
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.

1 participant