Repository navigation
ci: gate released CHANGELOG sections against their tags; advisory step in the release ritual (#1101, #828) - #1177
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…p in the release ritual (#1101, #828) #1101: TestChangelogReleasedSectionsMatchTheirTags compares every `## [X.Y.Z]` section with the same section in `git show vX.Y.Z:CHANGELOG.md` (one `git cat-file --batch`, CRLF and trailing blank lines normalised). Versions are discovered from the headings; tags without a CHANGELOG.md (v0.42.0 and earlier) are skipped; only the newest section may be untagged (the release PR merges before its tag). No tags or no git: FAIL under CI=true, skip locally. Both CI test jobs (Linux, Windows) now fetch the v* tags at depth 1. Two historic edits are accepted, each pinned by the SHA-256 of its current text so it is frozen again: [0.126.0] holds four entries that shipped in 0.127.0, and [0.97.0] had its duplicate groups consolidated. #828: CLAUDE.md "On release" gains the advisory step (set patched_versions only where the fix is an ancestor of the tag, preserving the rest of the vulnerabilities array; publishing is the owner's decision) and a note that released sections are frozen. scripts/advisory-status.sh is a read-only helper that flags STALE (published, empty, a release outside the range exists) and NO-TAG (patched_versions names an untagged version). Fixes #1101 Fixes #828
scttfrdmn
force-pushed
the
ci/1101-828-release-ritual
branch
from
October 19, 2026 06:07
bc2683a to
b76aa78
Compare
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.
Fixes #1101
Fixes #828
#1101: released CHANGELOG sections must match their tags
New
changelog_released_test.goaddsTestChangelogReleasedSectionsMatchTheirTags:## [X.Y.Z]heading in CHANGELOG.md and compares that section, byte for byte after CRLF and trailing-blank-line normalisation, with the same section invX.Y.Z:CHANGELOG.md. It reads every tag's file in onegit cat-file --batch.CI=truethe test fails; locally it skips with agit fetch --tagshint. Discovery that finds no headings, or compares no sections, fails.Fetch release tagsstep:git fetch --no-tags --depth=1 origin '+refs/tags/v*:refs/tags/v*'. I measured it on a fresh depth-1 clone at about 11s and 285 MB.fetch-depth: 0would be 364 MB. A blobless fetch made the first lookup take 48s, because trees came lazily.Historic drift (the two the issue found) needs your decision. Both are currently accepted in a short
acceptedReleasedEditsmap. Each entry is pinned by the SHA-256 of the section's current text, so the section is frozen again in that form. A further edit fails, and so does an entry whose section has been restored.[0.126.0]holds four entries (ttl-reaper: cross-account trust names a CFN-generated role ARN suffix — recreating the stack breaks EVERY account at once (#457 trap 1) #476 via fix(reaper): trust the reaper by name pattern, not a generated role ARN #785, fix(footprint): consistent snake_case keys in -o json #781, Two autoscale orchestrators have polled every minute since February against empty tables #772 via fix(autoscale): scope the coverage check to the env, and drop the space-valued param #778, spawn autoscale advertises --region and ignores it (ambient region only) #774 via fix(autoscale): honour --region instead of silently ignoring it #775). Each was first added to CHANGELOG in a commit whose first containing tag is v0.127.0, so they shipped in 0.127.0, not 0.126.0. Moving them to[0.127.0]would break that section's own match with its tag, and restoring v0.126.0's text would drop them from the changelog entirely. That's why I accepted rather than restored.[0.97.0]: at the tag the section had### Addedand### Fixedtwice each, and consolidation moved the Pool worker should survive an early spored pool-worker exit (restart-on-exit), not run once at boot #465 entry into the remaining### Fixed. The text is unchanged. Restoring it would bring back the duplicate groups.If you'd rather restore either one, delete its map entry and restore the section from the tag. The test will tell you if the entry goes stale.
Watched failing against compiling reverts (the reverts edit CHANGELOG.md, so the code compiles unchanged):
[0.135.1]### Security(the #1101 shape)+ (now only)[0.132.2](the #1103 shape)- (at tag only)[0.126.0](accepted) edited again[0.134.9]inserted mid-file[0.135.2](release PR before its tag)git initdir with no tags,CIunsetCI=true, and in a non-git dir withCI=trueCI=true(the CI shape)It passes on current main.
#828: advisory step in the release ritual
CLAUDE.md, under "On release", gets two additions:
patched_versionsonly on advisories whose fix is an ancestor of the tag (git merge-base --is-ancestor <fix> vX.Y.Z^{}). The PATCH replaces the wholevulnerabilitiesarray, so the givengh api | jq | gh api -X PATCHbuilds it from the advisory as read and changes only that field. Then re-read the advisory and trim the "not yet released" note. Publishing, or keeping a draft private, remains the owner's decision.scripts/advisory-status.sh(optional helper) is read-only and not a CI gate, since it needs a token that can see the advisories. It lists each advisory's state, range and patched version, and flags two cases:patched_versionsempty, and the release is outside the range.patched_versionsnames a version with no tag, i.e. a fabricated version, the Release checklist: set patched_versions on every published security advisory when the next release is cut #828 concern.Exit codes: 0 when nothing is flagged, 1 when something is, 2 on an empty list or a usage error. Against the live repo today it reports nothing flagged (exit 0). With a fake
ghit produces STALE, NO-TAG, "no fixed release yet" (in range), the multi-clause range>= a, < b, and exit 2 on an empty list. It passes shellcheck.Not verified: I didn't run the PATCH command. I only checked the payload
jqproduces from a live GET (package,vulnerable_version_range,vulnerable_functionspreserved,patched_versionsset). The CI tag-fetch step runs for the first time on this PR.Checks
GOTOOLCHAIN=go1.26.9 make checkpasses fmt, vet, GOOS vet, hermetic tests (root package ok), nested modules and tidy. Two expected failures:GOOS=linux staticcheck ./...(the CI target) is clean./private/tmpfiles as unmodified main, so it's local-only noise.semgrep --config=auto --erroron the changed files is clean.