ci: restore commit-addressed alpha releases for the TypeScript SDK - #2786
Merged
Conversation
v3 published <next>-alpha-<sha> snapshots of @browserbasehq/stagehand under the alpha dist-tag on every push. The v4 release rewrite dropped the changesets snapshot config, the release-canary script, and the workflow step, so nothing newer than 4.0.0-alpha-49bc5b6 ever shipped. Port it onto the v4 tooling: snapshot config in .changeset/config.json, a _publish-typescript-alpha just recipe, and a separate release job so an alpha failure cannot block the Python/Go release jobs.
|
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant GitHub as GitHub Push Event
participant WF as release.yml Workflow
participant RT as release-typescript Job
participant ALPHA as publish-typescript-alpha Job
participant PR as Python/Go Release Jobs
participant Just as justfile Recipe
participant CS as Changesets CLI
participant Turbo as Turbo Build
participant NPM as npm Registry
participant Pkg as TypeScript SDK Packages
Note over GitHub,NPM: CI/CD Flow for TypeScript SDK Release Pipeline
GitHub->>WF: Push to main branch
WF->>RT: Trigger release-typescript job
RT->>RT: Run stable release (unchanged)
RT-->>ALPHA: Trigger job (needs: release-typescript)
alt Pending changesets exist
ALPHA->>Just: Run _publish-typescript-alpha recipe
Just->>CS: changeset version --snapshot
Note over CS: Snapshot config: useCalculatedVersion + prereleaseTemplate "alpha-{commit}"
CS->>Pkg: Version package(s) with pending changesets
Pkg-->>CS: Apply commit-addressed version (next-alpha-sha)
CS-->>Just: Complete
Just->>Turbo: pnpm exec turbo run build --filter=@browserbasehq/stagehand
Turbo->>Pkg: Build protocol → extension → sdk-ts
Pkg-->>Turbo: Build artifacts ready
Turbo-->>Just: Build complete
Just->>CS: changeset publish --tag alpha --no-git-tag
CS->>NPM: Publish package(s) with alpha dist-tag
NPM-->>CS: Publish confirmation
CS-->>Just: Complete
Just-->>ALPHA: Alpha publish success
else No pending changesets (stable release commit)
ALPHA->>Just: Run _publish-typescript-alpha recipe
Just->>CS: changeset version --snapshot
CS-->>Just: No-op (nothing to version)
ALPHA-->>WF: Skip publish, job succeeds
end
ALPHA-->>WF: Job complete (regardless of alpha status)
Note over WF,PR: Python/Go releases not blocked by alpha job
WF->>PR: Trigger Python/Go release jobs (parallel)
PR-->>WF: Complete independently
Note over NPM: Alpha packages NOT git-tagged (--no-git-tag)<br/>Dist-tag: alpha (from --tag alpha)
akeimach
approved these changes
Aug 20, 2026
antonvishal
pushed a commit
to antonvishal/stagehand
that referenced
this pull request
Aug 21, 2026
…rowserbase#2786) ## Why On `v3`, every push published a snapshot of `@browserbasehq/stagehand` as `<next>-alpha-<sha>` under the `alpha` dist-tag (`release-canary` script + `snapshot` changesets config + a "Publish Canary" step in `release.yml`). The v4 release rewrite (browserbase#2671) dropped all three, so nothing newer than `4.0.0-alpha-49bc5b6…` has shipped to npm since. ## What Port the v3 behavior onto the v4 release tooling: - `.changeset/config.json` — restore `snapshot: { useCalculatedVersion, prereleaseTemplate: "alpha-{commit}" }` (the v3 `snapshot.tag` key was never part of the schema; the dist-tag comes from `--tag alpha` on publish). - `justfile` — new `_publish-typescript-alpha` recipe: `changeset version --snapshot` → build `sdk-ts` → `changeset publish --tag alpha --no-git-tag`. - `.github/workflows/release.yml` — new `publish-typescript-alpha` job after `release-typescript`. It's a separate job (rather than a trailing step as on v3) so an alpha failure can't block the Python/Go release jobs, and it only needs the node toolchain (`turbo run build --filter=@browserbasehq/stagehand` covers protocol → extension → sdk-ts). Behavior matches v3: only packages with pending changesets are versioned, so the push that cuts a stable release is a no-op for the alpha job. Verified locally that `changeset version --snapshot` yields `4.0.3-alpha-8b75044ee9163dc3c0d18fb11eed4a12246b4a03`. No changeset — CI/release infra only. ## Follow-up Python alphas (`<next>a0.dev<N>` on PyPI — PEP 440 can't carry the sha) are coming in a separate PR. Go needs nothing: `go get …/sdk-go/v4@<sha>` already works via pseudo-versions. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Restores commit-addressed alpha releases for the TypeScript SDK. v3 published `<next>-alpha-<sha>` to the `alpha` dist-tag on pushes; v4 dropped it. This brings back automated alphas without affecting stable releases. - Restores Changesets snapshot config: `useCalculatedVersion` with `prereleaseTemplate: "alpha-{commit}"`. - Adds `just _publish-typescript-alpha`: `changeset version --snapshot` → build `sdk-ts` → `changeset publish --tag alpha --no-git-tag`. - Adds a separate `publish-typescript-alpha` job in `release.yml` after `release-typescript`; builds `@browserbasehq/stagehand` via `turbo` and does not block Python/Go if it fails. - Behavior matches v3: publishes `<next>-alpha-<sha>` only when there are pending changesets; no-op on the stable-release commit; no git tags; CI-only. Aligns with Linear AP-2885. <sup>Written for commit d98d0e4. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/browserbase/stagehand/pull/2786?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
miguelg719
added a commit
that referenced
this pull request
Aug 24, 2026
> Stacked on #2786 (TypeScript alphas). Retarget to `main` once that merges. ## Why #2786 restores `<next>-alpha-<sha>` npm releases on every push. This gives the Python SDK the equivalent channel. PyPI rejects local versions (`+<sha>`) and PEP 440 only allows digits in a `.devN` segment, so the commit can't be carried in the version. The idiomatic analogue is a **developmental pre-release**: `4.0.3a0.dev<N>`. - `a0` marks the alpha channel — sorts below the `4.0.3` it precedes and is hidden from `pip install stagehand` unless `--pre` is passed (same role as npm's `alpha` dist-tag). - `N` = commit count on `main`, so successive pushes order correctly and re-running the workflow on the same commit is idempotent (PyPI rejects the duplicate rather than minting a second build). - The existing `stagehand-python@<version>` git tag maps a build back to its commit. ## What - `scripts/release/python-alpha-version.ts` (+ tests) — after `changeset version --snapshot`, reads the Python proxy `package.json`; if it got a snapshot version there's something unreleased, so rewrite `pyproject.toml` to `<base>a0.dev<N>`. Otherwise `should-publish=false`. `--check` mode doesn't write. - `justfile` — `_version-python-alpha`: `changeset version --snapshot` → apply alpha version → `uv lock`. - `publish-python.yml` — new `alpha` boolean input; when set, runs `just _version-python-alpha` between `just install` and `just build`. Everything downstream (version read, wheel/sdist smoke tests, `uv publish --trusted-publishing`, git tag) is unchanged and reused. Checkout is now `fetch-depth: 0` for the commit count. - `release.yml` — `python-alpha-status` + `publish-python-alpha` jobs, mirroring the stable `python-release-status` + `publish-python` pair. ## Verified locally With a throwaway changeset: snapshot → `should-publish=true version=4.0.3a0.dev1451`, `uv lock` updates cleanly, `uv build` produces `stagehand-4.0.3a0.dev1451-py3-none-any.whl` + sdist, and `packaging` confirms `4.0.2 < 4.0.3a0.dev1451 < 4.0.3` with `is_prerelease=True`. `pnpm exec vitest run scripts` → 66/66. ## Things to be aware of - Trusted publishing is keyed on the workflow file + `pypi` environment, both reused here, so no PyPI config change is needed. If the `pypi` environment has required reviewers, every alpha will wait for approval — worth checking before merge. - Dev builds accumulate on the PyPI project page forever (numpy et al. use a separate nightly index for this reason). Acceptable for now; flagging it. - No changeset — CI/release infra only. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Publishes commit-addressed Python SDK alphas as PEP 440 developmental releases. Previously we only shipped stable versions; CI now publishes `<next>a0.dev<N>` when a changesets snapshot exists, ordered by commit count and requiring `--pre` to install `stagehand` (AP-2885). - Adds `scripts/release/python-alpha-version.ts` (+ tests) to map snapshot versions (`<next>-alpha-<sha>`) to PEP 440, rewrite `pyproject.toml`, and support `--check`; outputs `should-publish` and `version`. - Extends reusable `publish-python.yml` with an `alpha` input; applies the version via `just _version-python-alpha`, checks out with `fetch-depth: 0`, and reuses trusted publishing. - Adds `python-alpha-status` and `publish-python-alpha` jobs in `release.yml` to gate alpha publishing on snapshot presence and reuse the publish workflow. - Rollout: Reuses the existing `pypi` environment and trusted publishing; required reviewers will gate each alpha. Install with `pip install --pre stagehand`; dev builds will accumulate on PyPI. <sup>Written for commit 8c2e573. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/browserbase/stagehand/pull/2787?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
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.
Why
On
v3, every push published a snapshot of@browserbasehq/stagehandas<next>-alpha-<sha>under thealphadist-tag (release-canaryscript +snapshotchangesets config + a "Publish Canary" step inrelease.yml). The v4 release rewrite (#2671) dropped all three, so nothing newer than4.0.0-alpha-49bc5b6…has shipped to npm since.What
Port the v3 behavior onto the v4 release tooling:
.changeset/config.json— restoresnapshot: { useCalculatedVersion, prereleaseTemplate: "alpha-{commit}" }(the v3snapshot.tagkey was never part of the schema; the dist-tag comes from--tag alphaon publish).justfile— new_publish-typescript-alpharecipe:changeset version --snapshot→ buildsdk-ts→changeset publish --tag alpha --no-git-tag..github/workflows/release.yml— newpublish-typescript-alphajob afterrelease-typescript. It's a separate job (rather than a trailing step as on v3) so an alpha failure can't block the Python/Go release jobs, and it only needs the node toolchain (turbo run build --filter=@browserbasehq/stagehandcovers protocol → extension → sdk-ts).Behavior matches v3: only packages with pending changesets are versioned, so the push that cuts a stable release is a no-op for the alpha job. Verified locally that
changeset version --snapshotyields4.0.3-alpha-8b75044ee9163dc3c0d18fb11eed4a12246b4a03.No changeset — CI/release infra only.
Follow-up
Python alphas (
<next>a0.dev<N>on PyPI — PEP 440 can't carry the sha) are coming in a separate PR. Go needs nothing:go get …/sdk-go/v4@<sha>already works via pseudo-versions.Summary by cubic
Restores commit-addressed alpha releases for the TypeScript SDK. v3 published
<next>-alpha-<sha>to thealphadist-tag on pushes; v4 dropped it. This brings back automated alphas without affecting stable releases.useCalculatedVersionwithprereleaseTemplate: "alpha-{commit}".just _publish-typescript-alpha:changeset version --snapshot→ buildsdk-ts→changeset publish --tag alpha --no-git-tag.publish-typescript-alphajob inrelease.ymlafterrelease-typescript; builds@browserbasehq/stagehandviaturboand does not block Python/Go if it fails.<next>-alpha-<sha>only when there are pending changesets; no-op on the stable-release commit; no git tags; CI-only. Aligns with Linear AP-2885.Written for commit d98d0e4. Summary will update on new commits.