Skip to content

ci: restore commit-addressed alpha releases for the TypeScript SDK - #2786

Merged
miguelg719 merged 2 commits into
mainfrom
miguelgonzalez/ap-2885-sdk-alpha-releases-fix
Aug 20, 2026
Merged

ci: restore commit-addressed alpha releases for the TypeScript SDK#2786
miguelg719 merged 2 commits into
mainfrom
miguelgonzalez/ap-2885-sdk-alpha-releases-fix

Conversation

@miguelg719

@miguelg719 miguelg719 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

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 (#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-tschangeset 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.


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-tschangeset 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.

Written for commit d98d0e4. Summary will update on new commits.

Review in cubic

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.
@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d98d0e4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Loading

Re-trigger cubic

@miguelg719
miguelg719 merged commit 2785d0d into main Aug 20, 2026
52 checks passed
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. -->
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.

2 participants