fix(ci): publish rspack to verdaccio with fresh sentinel version#28
Merged
fix(ci): publish rspack to verdaccio with fresh sentinel version#28
Conversation
Commit 7956c22 introduced a verdaccio + --release pattern that assumed rspack HEAD's package.json version was globally unique on verdaccio. In practice (especially from-commit) the HEAD version usually matches a previously published version on public npm, and because verdaccio.yaml sets `proxy: npmjs` on both `@*/*` and `**`, the publish becomes a silent no-op ("version already exists upstream"). Downstream `pnpm install` then falls through the uplink and pulls the OLD public tarball instead of the freshly built one, so fresh binding is never actually used. Extract the verdaccio bootstrap into a composite action that bumps all @rspack/* workspace packages to `<current>-fresh.<runId>.<runAttempt>` before publishing. The sentinel version is guaranteed unique per workflow run and never exists on public npm, so publish always lands locally. Since inter-package deps use `workspace:*`, pnpm publish rewrites them automatically — no manual dependency rewriting needed. Wire the composite action into all 4 rspack workflows (ci.yml, from-pr, from-commit, selected) and feed the sentinel version to --release.
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.
Problem
Commit 7956c22 (
feat: migrate rspack ecosystem CI to Verdaccio-based --release mode) introduced a verdaccio +--releasepattern that assumed rspack HEAD'spackage.jsonversion was globally unique on verdaccio. In practice — especially in thefrom-commitcase — the HEAD version usually matches a previously published version on public npm.Because
verdaccio.yamlsetsproxy: npmjson both@*/*and**, anypnpm publishto verdaccio for a version that already exists on public npm becomes a silent no-op ("version already exists upstream"). Downstreampnpm installthen falls through the uplink and pulls the OLD public tarball instead of the freshly built one — so fresh binding is never actually used, defeating the entire point of eco-ci.Fix
Extract the verdaccio bootstrap into a reusable composite action (
./.github/actions/publish-rspack-to-verdaccio) that, before publishing, bumps all@rspack/*workspace packages to a sentinel version<current>-fresh.<runId>.<runAttempt>.pnpm publishalways lands in the local registry.workspace:*, whichpnpm publishrewrites to the sentinel automatically — no manual dependency rewriting needed.steps.publish-rspack.outputs.version, which each workflow feeds to--release.All 4 rspack workflows are wired to the composite action (
ci.yml,rspack-ecosystem-ci-from-commit,rspack-ecosystem-ci-from-pr,rspack-ecosystem-ci-selected), 7 callsites in total. The_selftestif:guards andworkspace:rspackpnpm bug #9270 rationale comments are preserved.Validation
End-to-end dispatched against the test branch, covering both paths and both trigger sources:
plugind96ac80(rc.1)2.0.0-rc.1-fresh.<runId>.1plugin2.0.0-rc.0-fresh.<runId>.1013df8db(#13627)2.0.0-rc.0-fresh.<runId>.1d96ac80(#13625)2.0.0-rc.1-fresh.<runId>.1The 8 failures in both full-matrix runs are the same set of suites (
rslib,rstest,modernjs,rsbuild,rsdoctor,devserver,rspress,lynx-stack) and all fail on rspack HEAD's newnode:*externals behavior introduced by web-infra-dev/rspack#13627 (fix(externals): correct external type for aliased node builtin externals). This is the strongest possible proof that fresh binding is actually being used — if publish/install had silently fallen through to public npm, these suites would have inherited the old behavior and not failed on the new externals rule.Test plan