Repository navigation
fix(release): a changeset a revert restored is credited to the commit that first added it in the CHANGELOG - #25669
Conversation
… that first added it, and the 18.1.0 CHANGELOGs name each entry's own commit Clause-②: no Metadata-protocol: none The stock generator (`@changesets/cli/changelog`) stamps each CHANGELOG entry with the newest commit that added its changeset file. #25605 reverted the unpublished first 18.1.0 cut, which re-added every changeset it had consumed, so the re-cut (#25606) credited 260 of its 265 entries, and 6000 "Updated dependencies" lines, to the revert 3937697. - `.changeset/config.json` now loads `scripts/changeset-changelog.mjs`: the stock line format, with each entry's commit read by `createChangelogAttribution` in `scripts/release-pending-publish.mjs`. - An add whose blob is exactly the blob the previous delete removed is a restoration. The walk passes over it and over that delete to the add before. A changeset written afresh under a consumed name keeps its own add. A shallow clone is deepened, in annotate-shipped's bounded rounds, to the last version commit and on while a first add is beyond the boundary. Nothing it cannot decide stops the version pass: the stock commit stays, with a warning. - The 18.1.0 sections of the 79 CHANGELOGs are amended in place: regenerated by re-running the cut at e649c2d's parent with this generator, they differ from the published text only in the commit hashes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X36HeTaoAfX2pS589N9FYP
📓 Docs Drift Check
What this run could not see
Coarse fallback — 175 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
The seat splits the card. This pull keeps the generator alone: the `.changeset/config.json` switch and the two scripts. The 18.1.0 amendment is regenerated with the merged generator and opened as its own pull. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X36HeTaoAfX2pS589N9FYP
|
ACCEPT ·
Generated by Claude Code |
Requested by Elon · project thread
Part of #25638
Clause-②: no
Metadata-protocol: none
What happens today
.changeset/config.jsonnamed@changesets/cli/changelog. It stamps each entry with the commit@changesets/gitreturns: the newest commit that added the changeset file. #25605 (3937697) reverted the unpublished first 18.1.0 cut (74fa3cb6d), which re-added the 260 changesets that cut had consumed. The re-cut (#25606,e649c2d91e) therefore credited all 260 to the revert: 260 of 265 distinct entries, and 6000- Updated dependencies [3937697]lines, across 79 CHANGELOGs.The fix (a): future cuts
.changeset/config.jsonloads../scripts/changeset-changelog.mjs(resolved from.changeset/, as@changesets/apply-release-planresolves it). It is the stock generator's two functions with each changeset'scommitreplaced bycreateChangelogAttribution. The line format is the stock one byte for byte.createChangelogAttributionlives inscripts/release-pending-publish.mjs, besideannotate-shipped, which already knows reverted cuts (fix(release): annotate-shipped passes over a reverted cut instead of reading it as the version commit #25607). Onegit log --no-renames --diff-filter=AD --name-status -- .changeset/pass indexes every add and delete. An add whose blob is exactly the blob the previous delete removed is a restoration. The walk passes over it, and over that delete, to the add before. A changeset written afresh under a name a published cut consumed has other bytes and keeps its own add. A changeset the walk cannot find as an add keeps the stock commit.annotate-shipped's bounded rounds, to the last version commit (every delete that matters lies after it), then further while a restoration's first add is still beyond the boundary. A shallow boundary commit diffs against nothing and seems to add every file it carries, so its adds are never trusted.::warning::changeset-changelog:line. A restoring commit is named once, as a plain line.annotate-shipped's fetch is factored into a shareddeepenByhelper. Its reasons and behaviour are unchanged, and its batteries pass unchanged.Not in this pull: the 18.1.0 amendment (b)
The seat split the card. After this merges, the same branch restarts from
mainand regenerates the 18.1.0 amendment with this generator as its own pull (Fixes #25638). The method, already run once against this branch's generator (that commit is reverted here):e649c2d91e^(8801f2bb37, the tree chore: version packages #25606 cut) with this generator (annotate-shipped, thenchangeset version), and the resulting CHANGELOGs copied.e649c2d91e, every changed line differs only in its 7-hex commit. With hashes normalised, all 79 files are identical.mainhas not touched any CHANGELOG sincee649c2d91e.3937697. The eight Shipped in 18.0.0 entries name6b9e6df 7cacad5 950f949 9a06f0b abd5acd de9cd1f df8bb40 e5b3de0, exactly the adding commits fix(release): annotate-shipped passes over a reverted cut instead of reading it as the version commit #25607 measured. The five post-revert changesets keepa57643d 9f39094 4a25192 4395cbc cb38a8c.Evidence
node scripts/release-pending-publish.mjs --self-test: 124 cases across 31 batteries pass, two of them new:a/bname their own adds, andl, a leak added before the 1.0.0 cut, names its own add.n, rewritten under a consumed name, keeps its second add, andc, landed after the revert, is untouched. The re-cut runs throughscripts/changeset-changelog.mjs's owngetReleaseLine/getDependencyReleaseLine.l. With deepening off, or outside a repository, the stock commit stays with one warning and nothing throws.dispatch-gates --commands: 108 derived, all 108 run and exit 0 (two afterpnpm build, which they need first);--ranreconciles 108 of 108, 0 not measured. That run covered the combined diff before the split, a superset of this one.check:commit-card-trailers --range origin/main..HEADandcheck-nul-bytespass.Tier and surface
.changeset/config.json,scripts/changeset-changelog.mjs,scripts/release-pending-publish.mjs. No governed path.release.ymland the rootversionscript are not touched. The generator is reached through.changeset/config.json(loaded by@changesets/apply-release-planthroughimport()), and its self-test rides therelease-pending-publish.mjs --self-teststep lint.yml already runs.Acceptance notes
unconsumedChangesets(theunconsumedreport) still names the newest add. It reads changesets a version commit left pending, which a revert does not produce, so it was left alone. Noted, not filed.skip-changeset:scripts/and.changeset/config.jsonpublish nothing from any released package.🤖 Generated with Claude Code
https://claude.ai/code/session_01X36HeTaoAfX2pS589N9FYP