You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8801f2b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(release): annotate-shipped passes over a reverted cut instead of reading it as the version commit (#25607)
Clause-②: no
Metadata-protocol: none
**Release fix for 18.1.0.** This is the second landing the merge freeze
lets through, after #25605.
## Defect
#25605 reverted the unpublished 18.1.0 version commit `74fa3cb6d`, which
moved `packages/cli/package.json` back to 18.0.0. When the refresh
stroke regenerated the Version Packages PR as #25606, the root `version`
script's first step, `release-pending-publish.mjs annotate-shipped`,
went wrong:
- `locateLastVersionCommit` took the revert as the commit that
introduced 18.0.0.
- 18.0.0 is on npm, so it gave every changeset the revert restored the
lead line "**Shipped in 18.0.0**, whose CHANGELOG missed this entry;
listed here one release late."
- #25606's CHANGELOGs carry that line 412 times. The true count is 8.
## Fix
- A commit that moves the CLI version **back** did not introduce the
version it returns to. The walk passes over it and over the reverted
cut's span, and keeps looking for the forward commit that did.
- `compareVersions` orders `X.Y.Z` and `X.Y.Z-tag.N`. A prerelease sorts
before its release, and numeric prerelease ids compare as numbers.
- `findVersionCommit`, the release gate's `select`, is unchanged. After
the next cut, the head's version (18.1.0) is introduced by a forward
commit, so it never meets this case.
## Evidence
- `node scripts/release-pending-publish.mjs --self-test`: 115 cases
across 29 batteries pass. That includes a new battery that builds the
18.1.0 shape: a cut that leaves one changeset unconsumed, then a later
cut that consumes everything, is never published, and is reverted. Only
the first cut's leak is annotated.
- On `main` (`393769720`), `annotate-shipped` with this change reads the
last version commit as `06cab4849a` (18.0.0-next.5 → 18.0.0) and
annotates 8 changesets. Their adding commits are `6b9e6df`, `7cacad5`,
`950f949`, `9a06f0b`, `abd5acd`, `de9cd1f`, `df8bb40` and `e5b3de0`,
exactly the 8 that `74fa3cb6d`'s own cut annotated.
## After it lands
The relay's refresh stroke regenerates the Version Packages PR again.
Its CHANGELOGs then carry the 8 true "Shipped in 18.0.0" lines and no
others.
`skip-changeset`: `scripts/` publishes nothing from any released
package.
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
'annotate-shipped -> a second run writes nothing': 2,
1257
1302
'annotate-shipped -> a changeset whose first body line already says Shipped in is left byte-identical': 2,
1258
1303
'annotate-shipped -> outside pre mode, where the version pass deletes what it consumes': 2,
1304
+
'annotate-shipped -> a reverted cut is not a version commit: the walk reads the forward cut before it': 3,
1259
1305
'annotate-shipped -> a depth-1 clone deepens itself to the version commit; with no reachable history it warns, annotates nothing and exits 0': 4,
1260
1306
'annotate-shipped -> no version commit, an unpublished or unreadable version, an error anywhere: a warning or a plain line, nothing written, exit 0': 5,
1261
1307
});
@@ -1645,6 +1691,49 @@ async function selfTest() {
1645
1691
'with the "release" form of the line',
1646
1692
);
1647
1693
1694
+
battery('annotate-shipped -> a reverted cut is not a version commit: the walk reads the forward cut before it');
1695
+
// The 18.1.0 shape: a 17.7.0 cut left y.md unconsumed (above); the next cut
1696
+
// (17.8.0) consumed every pending changeset, was never published, and was
1697
+
// reverted, which restored them all and moved the CLI back to 17.7.0.
'and z.md, which the revert restored but 17.7.0 never carried, is not stamped as shipped in 17.7.0',
1735
+
);
1736
+
1648
1737
battery('annotate-shipped -> a depth-1 clone deepens itself to the version commit; with no reachable history it warns, annotates nothing and exits 0');
0 commit comments