contrib: add canary npm dist-tag rollout for pre-1.0 releases - #345
Merged
davedumto merged 1 commit intoAug 31, 2026
Merged
Conversation
Self-contained reference for issue Vellar-Wallet#283 under contrib/examples. publish.yml currently runs npm publish with no --tag, so every tag pushed goes straight to the latest dist-tag with no canary stage in which an early-adopter consumer can validate a release before it becomes the default install. Adds the pure decision logic: a semver prerelease tag (v0.7.0-canary.0) publishes to next, a plain release tag (v0.7.0) publishes to latest. Keeping it in its own module rather than inline in a YAML run block makes it unit-testable, matching how scripts/verify-merged.mjs already handles release-affecting logic. A registry model makes publish and promote testable without touching the real registry. ROLLOUT.md carries the workflow wiring, the separate manual-dispatch promotion workflow, the consumer-validation checklist that gates a promotion, and instructions for verifying the flow against real npm once. Includes 15 tests, among them one exercising the full publish, validate and promote loop end to end and pinning the property the stage exists for: publishing a canary does not move latest.
|
@arandomogg is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Adds a self-contained reference under
contrib/examples/issue-283-canary-dist-tag-rollout/for a canary npm dist-tag stage for pre-1.0 releases, so an early-adopter consumer can validate a release before it becomes the default install for everyone.Scoped entirely to
contrib/per CONTRIBUTING.md andcontrib/README.md.The problem
.github/workflows/publish.ymlrunsnpm publish --provenance --access publicwith no--tag, so every tag pushed publishes straight to thelatestdist-tag — the one every plainnpm install vellar-sdkresolves to. There is no canary stage in between.The rule
A semver prerelease tag (
v0.7.0-canary.0,v1.0.0-rc.0) publishes tonext; a plain release tag (v0.7.0) publishes tolatest. This follows ordinary semver prerelease convention rather than inventing a bespoke "canary" grammar.nextnpm install vellar-sdk@nextlatestnpm install vellar-sdkPromotion moves
latestonto an already-published version vianpm dist-tag add— it does not rebuild or republish, so what lands onlatestis byte-for-byte the artifact that was validated as the canary.Files
ROLLOUT.mdpublish.ymlchange, a separate manual-dispatch promotion workflow, cutting a canary, the consumer-validation checklist, promoting, and real-registry verification.canary-dist-tag-rollout.tsdistTagFor) plus a registry model (publish,promoteToLatest) making the flow testable. Runnablemain()demo.canary-dist-tag-rollout.test.tsREADME.mdKeeping
distTagForin its own module rather than inline in a YAMLrun:block is deliberate — it's exactly the kind of one-line regex that's easy to get subtly wrong with shell quoting and impossible to unit-test in place. The repo already does this for release-affecting logic inscripts/verify-merged.mjs.Every existing gate in
publish.yml(npm audit,typecheck,test,build, provenance, and the tag/version verify step) is untouched and runs identically for a canary or a release, so a canary carries the same supply-chain guarantees aslatest(security audit V-8).Requirements checklist
next/canary dist-tag publishing step for the release workflowlatestdocumented (ROLLOUT.md)ROLLOUT.md)latest.ROLLOUT.mdadditionally documents a one-time real-registry verification for a maintainer, since that can't safely run unattended in CI.Test plan
15 tests, all passing — including the end-to-end case walking publish canary → assert
latestunmoved → reject a mistyped promotion → promote → assertlatestmoved and nothing new was published → plain release.closes #283