feat: add per-PR npm beta releases via beta-release label - #2366
feat: add per-PR npm beta releases via beta-release label#2366benminer wants to merge 2 commits into
Conversation
425b2a8 to
80f44c8
Compare
Lets a PR labeled `beta-release` publish a Changesets snapshot prerelease of its exact code under a pr-<N> npm dist-tag, so it can be end-to-end tested before merging. Promotion is just merging normally through the existing changesets + release.yml flow. Includes a best-effort dist-tag cleanup job on PR close, gated on a not-yet-provisioned NPM_DIST_TAG_TOKEN.
…aces Code review surfaced three real gaps: a missing/empty changeset let the snapshot publish silently no-op while the workflow still posted a false "published" PR comment; the cleanup job never fired if the beta-release label was removed before the PR closed; and changeset version --snapshot throws an opaque error if main is ever in Changesets pre-release mode. Also paginates and null-guards the PR-comment lookup, and hoists the BETA_TAG derivation to avoid it drifting between jobs.
80f44c8 to
6215333
Compare
|
Not merging this into the current release train as-is. Please rebase onto current |
|
Closing this unmergeable release-infrastructure experiment for the current release train. The workflow was written for the old v8 beta process and its required npm trusted-publisher/cleanup credentials were never provisioned, so shipping it would add a path that cannot complete. The 3.2 prerelease should use the existing Changesets pre-mode pipeline; a per-PR snapshot workflow can return as a fresh PR after its publisher identity is provisioned and validated end to end. |
Why
There was no way to publish a testable npm build of a specific PR before merging it, so changes could only be validated after they'd already landed on
mainand shipped tolatest.What Changed
Adds a
beta-release.ymlworkflow: labeling a PRbeta-releasepublishes a Changesets snapshot prerelease of that PR's exact code under apr-<N>npm dist-tag (reusing the existingscripts/publish-adcp-release.tsrelease script viaADCP_NPM_TAG), republishing on every push and commenting install instructions on the PR. Promotion is just merging the PR normally — the reallatestversion is cut fresh by the existing changesets +release.ymlflow. Includes a best-effort dist-tag cleanup job (gated on anNPM_DIST_TAG_TOKENsecret still to be provisioned), guards against no-op publishes when a PR is missing a real changeset, and rejects running during Changesets pre-release mode. Docs added todocs/development/NPM-DIST-TAGS.mddistinguishing this from the existing long-lived beta-channel pattern inv8.0-beta-plan.md.Note
NPM_DIST_TAG_TOKEN(for dist-tag cleanup) and npm trusted-publisher registration forbeta-release.yml(alongside the existingrelease.ymlentry) still need to be provisioned on npmjs.com before this fully works end-to-end.