Skip to content

feat: add per-PR npm beta releases via beta-release label#2366

Open
benminer wants to merge 2 commits into
mainfrom
feature/npm-beta-release-strategy
Open

feat: add per-PR npm beta releases via beta-release label#2366
benminer wants to merge 2 commits into
mainfrom
feature/npm-beta-release-strategy

Conversation

@benminer

Copy link
Copy Markdown
Collaborator

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 main and shipped to latest.

What Changed

Adds a beta-release.yml workflow: labeling a PR beta-release publishes a Changesets snapshot prerelease of that PR's exact code under a pr-<N> npm dist-tag (reusing the existing scripts/publish-adcp-release.ts release script via ADCP_NPM_TAG), republishing on every push and commenting install instructions on the PR. Promotion is just merging the PR normally — the real latest version is cut fresh by the existing changesets + release.yml flow. Includes a best-effort dist-tag cleanup job (gated on an NPM_DIST_TAG_TOKEN secret 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 to docs/development/NPM-DIST-TAGS.md distinguishing this from the existing long-lived beta-channel pattern in v8.0-beta-plan.md.

Note

NPM_DIST_TAG_TOKEN (for dist-tag cleanup) and npm trusted-publisher registration for beta-release.yml (alongside the existing release.yml entry) still need to be provisioned on npmjs.com before this fully works end-to-end.

@benminer
benminer force-pushed the feature/npm-beta-release-strategy branch from 425b2a8 to 80f44c8 Compare July 17, 2026 17:29
benminer added 2 commits July 20, 2026 15:36
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.
@benminer
benminer force-pushed the feature/npm-beta-release-strategy branch from 80f44c8 to 6215333 Compare July 20, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant