Add stable v4 release automation - #2409
Merged
monadoid merged 4 commits intoJul 27, 2026
Merged
Conversation
|
miguelg719
approved these changes
Jul 24, 2026
monadoid
force-pushed
the
v4-stable-release-automation
branch
from
July 25, 2026 00:03
949c8cf to
cb3618a
Compare
monadoid
marked this pull request as ready for review
July 25, 2026 00:10
Contributor
There was a problem hiding this comment.
1 issue found across 17 files
Confidence score: 2/5
- In
.github/workflows/publish-python.yaml, theworkflow_dispatchpath can publishstagehandand create release tags from non-main branches, which bypasses the intended Release +python-release-statusgate and could ship unreviewed artifacts to PyPI — remove manual dispatch for publish/tagging or enforce the same main-only and status-check protections on that path.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/publish-python.yaml">
<violation number="1" location=".github/workflows/publish-python.yaml:5">
P1: Manual dispatch can publish `stagehand` and create a release tag from a selected branch, bypassing the main-only Release trigger and `python-release-status` PyPI/Changeset gate. Remove this trigger or apply equivalent ref and release-status checks before publishing.</violation>
</file>
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant PR as Pull Request
participant CI as CI (Main Branch)
participant Changesets as Changesets Bot
participant NPM as npm Registry
participant PyPI as PyPI Registry
participant GH as GitHub Releases
Note over Dev,GH: Release Automation Flow
Dev->>PR: Makes changes to public SDK or protocol
Dev->>Dev: Runs `just changeset` to record release intent
PR->>CI: Merges to main branch
CI->>CI: Triggers Release workflow (just check, just build)
CI->>Changesets: Runs changesets/action
alt Changesets detects pending version bumps
Changesets->>CI: Creates/updates Release PR on main
CI->>CI: Runs `just _version` (consolidate changelogs, sync Python version, update uv.lock)
CI->>GH: Tags release commit (stagehand-python@<version>)
Changesets-->>CI: Release PR ready for merge
else Standard push (no pending changesets)
Changesets->>CI: No release PR needed
Note over CI: Falls through to Python publish check
end
alt Release PR merged
CI->>CI: Runs `just _publish-typescript`
CI->>NPM: publish @browserbasehq/stagehand
NPM-->>CI: Published
CI->>CI: Check Python release status
CI->>PyPI: GET /pypi/stagehand/<version>/json
alt Version not on PyPI (404)
PyPI-->>CI: Not found
CI->>CI: should-publish = true
CI->>PyPI: Publish via publish-python.yaml (uv publish, trusted publishing)
PyPI-->>CI: Published
CI->>GH: Tag stagehand-python@<version>
else Version already on PyPI (200)
PyPI-->>CI: Exists
CI->>CI: should-publish = false, skip Python publish
end
end
Note over CI,GH: Private protocol package is versioned internally but not published
Note over Dev,GH: Validation (on every `just check`)
Dev->>Dev: Runs check-changesets.ts (validates allowed packages only)
Dev->>Dev: Runs consolidate-changelogs.ts --check (ensures no stale package changelogs)
Dev->>Dev: Runs sync-python-version.ts --check (pyproject.toml and uv.lock match proxy package.json)
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…omation # Conflicts: # pnpm-lock.yaml
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Now that the v4 package names and versions are established, this PR adds the stable release flow for the TypeScript and Python SDKs.
just changesetrecords the release intent for a pull request.just _versionis used by CI to apply those changes, keep the Python version in sync, and update the root changelog.main.The private protocol package is also versioned through Changesets because its major version is the compatibility contract between the SDK and extension, but it is not published to npm.
We keep one root
CHANGELOG.mdfor the repository, beginning with the existing v3 history. The release workflows only run frommain, so this stack cannot publish anything.Summary by cubic
Adds stable v4 release automation for the TypeScript and Python SDKs. On pushes to
main, we open a release PR or publish TS to npm, and publish Python to PyPI only when a new version is needed (skips if pending Changesets exist).New Features
changesetsfor@browserbasehq/stagehand,@browserbasehq/stagehand-python, and versioned private@browserbasehq/stagehand-protocol(not published).main: runsjust check/just build, opens a release PR viachangesets/action, publishes TS viajust _publish-typescript, then uses a status check to publish Python only if PyPI is missing the version and no Changesets are pending.uv, uses trusted publishing, and tagsstagehand-python@<version>.CHANGELOG.mdwith SDK-labeled headings; package changelogs are temporary and removed in CI.justtasks to validate Changesets (allowed packages only), consolidate changelogs, sync Python version from the proxypackage.json, verifyuv.lock, gate Python publishing on PyPI status, and clean staledist/artifacts (including legacy names).README.md.Migration
just changeset. Internal-only changes don’t need one.mainto publish TypeScript; Python auto-publishes if the synchronized version is not on PyPI. Release jobs run only onmain.Written for commit 7fe4b8e. Summary will update on new commits.