Repository navigation
build(release): one changelog file per PR in changelog.d/, assembled at release #2113 - #2119
Merged
Merged
Conversation
nc9
force-pushed
the
build/changelog-d-2113
branch
from
November 17, 2026 23:24
bbe320d to
633c5c1
Compare
…at release #2113 Signed-off-by: Nik Cubrilovic <[email protected]>
…gex from the version argument #2113 Signed-off-by: Nik Cubrilovic <[email protected]>
…elog.d/; version message and merge-base option nits #2113 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
build/changelog-d-2113
branch
from
November 18, 2026 01:00
633c5c1 to
01f7f02
Compare
nc9
marked this pull request as ready for review
November 18, 2026 04:25
8 tasks done
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.
Every user-visible PR used to add its bullet to the same
## [Unreleased]block ofCHANGELOG.md, so each merge put every other open PR into conflict. With this change, each PR adds its own file underchangelog.d/, and the release bump PR assembles the files intoCHANGELOG.md.Refs #2113 (planning closes it once this lands at a quiet point; see "Landing" below).
The scheme
changelog.d/<issue>-<short-name>.<section>.md, where<section>isadded,changed,fixed,securityordocs. The file holds the bullet exactly as it would read under that section.changelog.d/README.mddocuments it.scripts/changelog.tsassembles the files (unreleased,release,convertandchecksubcommands).bun run changelog,bun run changelog:release <v>andbun run changelog:convertcall it.make release(scripts/release.ts) now assembles the entries into the## vX.Y.Z (date)section inside the version bump PR it already opens, and deletes the files in that same commit.Acceptance criteria
changelog.d/<issue>-<name>.<section>.md(changelog.d/README.md,AGENTS.md:235). Each PR adds a different path, so two PRs never touch the same lines. Tested inscripts/test-changelog-entries.sh("a PR that adds an entry file passes").scripts/changelog.ts:25(SECTIONS= Added, Changed, Fixed, Security, Docs),:73renderSections,:98insertRelease,:124release(writes the section, then deletes the files).scripts/release.ts:242runs it in the bump PR commit. Tests inscripts/changelog.test.ts:scripts/check-changelog-entries.shvalidates entry names againstSECTIONS(:19) and fails aCHANGELOG.mdedit that adds no new version heading (:65). The CI "Changelog guard" job runscheck-released-changelog.sh, which now ends by running this guard (scripts/check-released-changelog.sh:140). I left ci.yml unchanged because the push token has noworkflowscope. Tests inscripts/test-changelog-entries.sh: "a contributor-only change with no entry passes", "a PR that adds an entry file passes", "a direct CHANGELOG.md edit outside a release fails", "an unknown section name fails", "a release that adds a new version heading may write CHANGELOG.md".scripts/test-released-changelog.sh:129checks that the CI entrypoint actually runs the guard, and it fails if the hook-up line is removed (checked by deleting it). A base that still has## [Unreleased]skips only the direct-edit part, so this switch PR passes its own guard.## [Unreleased]on main3ca69f59(Changed 4, Added 15, Fixed 3, in four###blocks including a duplicated### Changed). After: 22 files inchangelog.d/, no## [Unreleased]left.diff <(bullets on main | sort) <(cat changelog.d/*.md | sort)gives no output, so the text is identical: none lost, none duplicated.bun run changelog | grep -c '^- 'prints 22. Two bullets (repo#1858 and repo#3360) landed on main while this branch was open. Rebases carried them with the sameaddedBulletslogic thatconvertuses. Any bullet that lands before merge needs the same carry-over.scripts/check-released-changelog.sh: the "exactly one [Unreleased] heading" and header-bullet checks are replaced by "no [Unreleased] heading", the failure text points atchangelog.d/, and it runs the entries guard. Test:scripts/test-released-changelog.sh, whose fixture drops [Unreleased], with new cases for an [Unreleased] heading failing and for the CI entrypoint.scripts/extract-changelog.awk: logic unchanged. The[Unreleased]boundary stays harmless, and the comment now says why. Test:scripts/test-changelog-extraction.shstill passes..github/workflows/release.yml("Resolve release notes"): unchanged. It extracts the## vX.Y.Zsection, whichmake releasenow writes into the bump PR.scripts/release.ts: the preflight readschangelog.d/. When the version has no section and entries exist, the bump PR assembles them. The abort message points atchangelog.d/..github/workflows/ci.yml"Changelog guard" job: unchanged file, the new check is reached throughcheck-released-changelog.sh.scripts/ci-classify.shandscripts/test-ci-classify.sh: achangelog.d/*-only change runs no jobs (the guard job is not path-gated), and the new tooling files are release inputs.package.jsontest:releaseandMakefiletest-release-tooling: these now run the new tests.CHANGELOG.mdheader prose, andAGENTS.md(see below).plans/releases.mdstill describes renaming[Unreleased]. That one is flagged to the maintainer for a private follow-up.bun run changelog(package.json:16,scripts/changelog.ts:277), documented inchangelog.d/README.md,CHANGELOG.mdheader andAGENTS.md. Test: "the unreleased preview prints the same sections without touching anything".bun run changelog:convert [--base origin/main](scripts/changelog.ts:249;addedBullets:175,restoreUnreleased:193). It takes only the bullets the branch added against the merge base, writes one file per bullet with the same text, and puts the branch's## [Unreleased]block back to the merge base's. An unrebased branch has no copy of the script yet, so the README shows how to run main's copy. Tests: "only the bullets the branch added are taken, with their section and exact text", "files hold the same text and CHANGELOG.md goes back to the base block", "a bullet under an unknown heading fails and writes nothing". End to end, I ran it on a worktree of old main with one added bullet: it wrotechangelog.d/9999-...fixed.md,git diff origin/main -- CHANGELOG.mdwas empty, and after the documented squash the branch diff was only the new file.AGENTS.md:151) and the PR rules (AGENTS.md:235) describe thechangelog.d/file. The paragraph about CHANGELOG rebase conflicts is removed.Landing
CHANGELOG.mdbullet then fails the changelog guard until it is converted (changelog.d/README.md, "Converting an open pull request"). Any bullet that merges to main before this PR must be carried over the same way at rebase time.workflowscope), so the guard runs from the existing job. A maintainer may later add a namedCheck changelog entriesstep to thechangelog-guardjob:bash scripts/check-changelog-entries.sh "$BASE".CodeQL
The first push raised two high alerts in
scripts/changelog.ts: a regex built from the version argument, with incomplete escaping. The fix commit validates the version (X.Y.ZorX.Y.Z-pre.N) and matches existing headings by exact token instead. Test: "a version argument that is not X.Y.Z or X.Y.Z-pre.N is refused before anything changes".Verification
bun run test:release(the CI "Release tooling tests" step) exits 0: extraction smoke test OK, released changelog tests OK, changelog entries guard tests OK, 36 pass / 0 fail (changelog.test.ts plus release-version.test.ts).make test-release-tooling: 44 pass / 0 fail.bash scripts/check-released-changelog.sh origin/main(the CI "Changelog guard" step) exits 0: "changelog entries OK (22 in changelog.d/)".bash scripts/test-ci-classify.sh: all 42 cases pass.bun run scripts/test-suites.ts --check: OK.CHANGELOG.mdedit fails, adding a file passes, and a contributor-only change passes.oxfmt --checkandoxlintare clean on the new TS files.tsgoreports no errors inchangelog.tsorchangelog.test.ts. The errors it shows inrelease.tsare pre-existing, in untouched functions (promptChannel,promptBumpType); root scripts are not typechecked in CI.Docs: none (docs/ has no changelog process page). Skill: none (the squirrelscan agent skill does not describe contributing changelog entries).