ci(release): publish any prerelease tag under its own dist-tag - #91
Conversation
|
@greptileai review |
Merging this PR will regress 5 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | wait 500ms |
20.3 KB | 64.2 KB | -68.32% |
| ❌ | Memory | end |
2.1 KB | 2.7 KB | -23.43% |
| ❌ | WallTime | test_recursive_fibo_10 |
1.9 µs | 2.4 µs | -17.86% |
| ❌ | WallTime | fibo darwin |
7.8 ms | 8.8 ms | -11.72% |
| ❌ | Simulation | wait 1sec |
57.5 ms | 64.3 ms | -10.49% |
| ⚡ | Simulation | test_recursive_fibo_10 |
11,112.5 µs | 274.1 µs | ×41 |
| ⚡ | Memory | test sync baz 100 |
25,080 B | 656 B | ×38 |
| ⚡ | Simulation | wait 1sec |
57.9 ms | 40.7 ms | +42.5% |
| ⚡ | Memory | short body |
784 B | 656 B | +19.51% |
| ⚡ | WallTime | switch 2 |
96 ns | 84 ns | +14.29% |
| ⚡ | WallTime | short body |
2.1 µs | 1.9 µs | +11.95% |
| ⚡ | WallTime | test sync baz 100 |
228 ns | 204 ns | +11.76% |
| ⚡ | WallTime | test sync baz 10 |
120 ns | 108 ns | +11.11% |
| ⚡ | Memory | long body |
1.3 KB | 1.2 KB | +10.39% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing chore/beta-releases (0433753) with main (3735985)
Greptile SummaryThe PR makes prerelease publishing fail closed by deriving and validating an npm dist-tag from the version, while reserving
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| .github/workflows/release.yml | Safely routes prereleases to validated non-latest dist-tags and marks their draft GitHub releases as prereleases. |
| CONTRIBUTING.md | Documents the lockstep release process and uses the repository-required pnpm tooling. |
| scripts/release.sh | Documents and accepts explicit prerelease versions while preserving the existing branch and working-tree safeguards. |
Reviews (4): Last reviewed commit: "fixup! docs: document release bump level..." | Re-trigger Greptile
2c4798e to
a5cbaed
Compare
|
@greptileai review again |
The publish step only special-cased "-alpha", so a v5.8.0-beta.1 tag fell through to the else branch and moved the "latest" dist-tag, shipping a prerelease to every consumer on ^5. Derive the dist-tag from the tag's prerelease identifier instead, which covers beta and rc without a branch per channel, and reserve "latest" for plain vX.Y.Z tags. The draft GitHub release is now flagged --prerelease for those versions too. release.sh gains an optional preid argument: lerna defaults the prerelease identifier to "alpha", so beta was previously unreachable through the script.
a5cbaed to
aa4bd42
Compare
The release process was undocumented outside of a one-line usage comment, and the prerelease identifier is the part a maintainer has to get right: it selects the npm dist-tag consumers install from, and lerna silently defaults it to "alpha". Adds a CONTRIBUTING.md with the release and prerelease commands, following the structure used in the runner and pytest-codspeed repos, and expands the usage header of release.sh with the bump levels and worked examples.
33297ab to
0433753
Compare
Problem
The publish step matched only
-alphain the tag name:Any other prerelease identifier fell through to the
elsebranch and moved thelatestdist-tag, so a beta or rc would have been installed by every consumer on^5. Beta was also unreachable in the first place:scripts/release.shforwards a single positional tolerna versionwith no--preid, and lerna defaults the prerelease identifier toalpha, which is precisely why the workflow only ever needed to check for-alpha.Changes
beta,rcandnextare covered by the same rule, andlatestis now reserved for plainvX.Y.Ztags — the fail-closed direction, where an unrecognised suffix gets its own tag instead of clobberinglatest. This also drops the loose substring match:v5.8.0-alphabet.1previously published asalpha.--prereleasewhen the version contains a-(this was missing for alpha too).scripts/release.shtakes an optional second argument forwarded as--preid, so./scripts/release.sh prerelease betaproduces5.7.2-beta.0and the matching tag.Both shell snippets avoid
[[ ... ]] && VAR=...as a final command, since workflow steps run underbash -ewhere a false test fails the step.Verification
No release was performed.
pnpm,ghandgitwere replaced with echo-only stubs, and the workflow bodies were extracted verbatim from the YAML file, so these are the argv the shipped text builds:v5.8.0pnpm publish -r --access=public --no-git-checksv5.8.0-alpha.0... --tag=alphav5.8.0-beta.1... --tag=betav5.8.0-rc.0... --tag=rcv5.8.0-next.3... --tag=nextv5.8.0-alphabet.1... --tag=alphabet5.8.0gets no flag,5.8.0-beta.1and5.8.0-alpha.0get--prerelease. All steps exit 0.release.shargv checked withprintf '%q'and an argument count:patchandprereleaseboth yield 6 arguments with no empty element,prerelease betayields 8 with--preid betain position. 0 or 3+ arguments print usage and exit 1.bash -nclean, workflow still parses as valid YAML with all fourbuildrun-steps intact.Existing alpha behaviour is unchanged:
v*-alpha*still publishes to thealphadist-tag.Not included
npm trusted publishing needs no per-channel setup — the OIDC exchange is dist-tag agnostic, and provenance is unaffected. Cross-package deps also already work:
workspace:^5.7.1is rewritten at publish time to^5.8.0-beta.0, and a caret range whose comparator carries a prerelease matches prereleases of that same version tuple, so@codspeed/vitest-plugin@betaresolves@codspeed/core@beta.Consuming prerelease versions of the benchmark frameworks themselves (for example
vitest@4.0.0-beta.1against thevitest: "^3.2 || ^4"peer range) is a separate concern and untouched here.Consistency with the other CodSpeed repos
Beta is the normal prerelease channel elsewhere; codspeed-node was the only repo that could not produce one.
cargo release --execute betaannouncement_is_prereleasefrom cargo-dist-beta, 24-alphatagsuvx bumpver update --minor --tag beta-betatagsscripts/release.sh-alphatags, 2023 onlyscripts/release.sh-alphatagsDetails worth carrying over or noting:
gh release edit --latestand the downstreamCodSpeedHQ/actionversion bump onannouncement_is_prerelease(.github/workflows/post-announce.yml:24-50). npm's dist-tag gives us the equivalent for free, which is what this PR wires up.scripts/pre-release.sh:6-10) and pytest-codspeed (scripts/pre-release.sh:6-8) skip changelog generation foralpha/beta/rc. Not applicable here: this repo generates no changelog.scripts/release.shin this repo is a sibling of the codspeed-rust one, which explains the shared<major|minor|patch>-only shape. codspeed-rust has the same gap if it ever needs a prerelease.--prereleaseon the draft GitHub release is not unique to us: pytest-codspeed and codspeed-rust omit it too.The
CONTRIBUTING.mdadded here follows the structure of the runner and pytest-codspeed guides, and documents what the prerelease identifier is, since neither of those explains it.