Repository navigation
ci: publish prereleases as next after 2.0.0 - #496
Conversation
Releases keep the npm dist-tag latest. Prereleases get next, except those of a major without a release while there is no release 2.0.0 or later (the 2.0.0 alphas), which keep latest as before. The rule needs no edit at 2.0.0: it reads the release tags. Closes #491 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only prereleases of 2.x get latest before 2.0.0 (not, e.g., 3.0.0 alphas). Document the backport and failed-tag caveats, and test prerelease tags, build metadata and later majors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideUpdates release dist-tag selection so stable releases remain on Flow diagram for release dist-tag selectionflowchart TD
A["distTag(version, tags)"] --> B{prerelease.length === 0}
B -->|yes| C["latest"]
B -->|no| D{major === 2 and no release tag with major >= 2}
D -->|yes| C
D -->|no| E["next"]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="scripts/release.js" line_range="112" />
<code_context>
+ const exceptionEnded = releases.some(
+ (parsed) => parsed.major >= latestPrereleaseMajor
+ );
+ return major === latestPrereleaseMajor && !exceptionEnded ? "latest" : "next";
};
</code_context>
<issue_to_address>
**Approving stale stage rolls tag back**
When an older prerelease is staged with a tag, a newer release using that tag is published before the stage is approved, `distTag` chooses the tag at readiness and the pending stage retains it; approving the stage reapplies that stale tag, so installs from it resolve to the older prerelease instead of the newer release.
Recompute or validate the dist-tag against the current releases when approving the stage.
Also at `CONTRIBUTING.md:87`.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and a mistaken calculation could stage a release under latest instead of next, or vice versa, changing what users installing from that channel receive. The staged version’s tag cannot be changed, so reverting alone won’t undo a release already staged, though the channel can be repaired by publishing or retagging appropriately.
Blocking findings: scripts/release.js:112
Summary
New npm dist-tag rule in
scripts/release.js(distTag, printed bynode scripts/release.js dist-tag <version>and used by theReleaseworkflow):latest(unchanged);next, so thatlatestholds the newest release;latestwhile there is no release tagv2.<minor>.<patch>or later, i.e. the2.0.0-alpha.Nseries behaves as today.The rule reads the git tags, so nothing needs to change at 2.0.0: the first
v2.x.ytag ends the exception. Before, prereleases of a released major got their identifier as dist-tag (rc,beta), and prereleases of a new major (e.g.3.0.0-alpha.1) gotlatest..github/workflows/release.ymlonly uses the script's output and is unchanged.CONTRIBUTING.md ("Releases", step 4) describes the rule and its caveats: a pushed
v2.x.ytag ends the exception even if its release fails, and a release of an older major (backport) also getslatest.Closes #491
Verification
node --test scripts/release.test.js: 11 passed (new cases: 2.x prereleases before 2.0.0, 1.x and 3.x prereleases before 2.0.0, prerelease and build-metadata tags, a later major's release ending the exception, all prereleases after 2.0.0).node scripts/release.js dist-tag 2.0.0-alpha.50with the repository's tags:latest.npm run lint,npm run build: pass.npm test: not run locally (Playwright browsers not installed in the sandbox); the component tests are untouched and run in CI.Declined review findings
devfor the rule (adversarial, low): a failedv2.x.ytag ondevwould still count, so this doesn't remove the caveat; documented instead.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Update npm prerelease tagging so stable releases remain on
latestwhile prereleases usenext, with a compatibility exception for the unreleased 2.x line.New Features:
nextnpm dist-tag while keepinglatestfor stable releases.latestdist-tag for 2.x prereleases until a 2.x or later release is tagged.Enhancements:
Tests: