You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automate stable releases after version bumps on master - #673
Automate stable releases after synchronized version bumps land on protected master, without requiring maintainers to create a tag or publish a GitHub Release manually.
Follow-up to #670: that PR only changed release metadata, while release.yml only listened for tag pushes. The subsequent manual v6.0.5 release created a tag and automatically started the release run. Both SDKs were published to PyPI, but GitHub finalization failed with 422 tag_name already_exists.
Added
A prepare release workflow that compares the exact push before/after commits, validates synchronized stable project/lockfile versions and the changelog, creates an immutable version tag, and explicitly dispatches release.yml at that tag using GITHUB_TOKEN.
Read-only PR validation and 20 offline tests for release selection, shallow checkouts, tag conflicts, metadata validation, existing releases/assets, and interrupted finalization.
Release preparation and recovery documentation.
Changed
Separate release building, PyPI publishing, and GitHub finalization into dependent jobs using the same retained distribution artifact.
Preserve manual stable-tag pushes and add validated tag-based workflow_dispatch.
Scope write and OIDC permissions to the jobs that require them. Keep the release environment and existing PyPI trusted-publisher identity.
Use tooling-only Python 3.11 for standard-library TOML parsing and tests; retain the SDK/build Python compatibility.
Fixed
Version bumps on master now start the release flow automatically; ordinary pushes with unchanged versions do not publish.
Existing GitHub Releases no longer cause unconditional duplicate creation. Preserve their notes and unrelated assets, upload missing distributions, and reject conflicting asset content.
Failed GitHub finalization can be retried with Re-run failed jobs without rebuilding or republishing successful PyPI uploads.
Explicit dispatch avoids GitHub's suppression of push workflows for tags created with GITHUB_TOKEN.
Validation
Verified the exact six-file change locally:
20 offline release tests passed, including temporary shallow Git repositories and mocked GitHub mutations.
actionlint passed for both changed workflows using the official checksum-verified validator.
poe check-format, poe lint, and poe types passed; the hidden release-tooling directory also passed an explicit type check.
uv lock --check --offline and git diff --check passed.
poe build produced both SDK wheels and source distributions; the new distribution gate verified their 6.0.5 names and metadata without publishing.
Read-only checks against GitHub verified existing tag/release responses and missing-tag HTTP 404 handling.
SDK source, project versions, dependency requirements, uv.lock, and the type-check baseline are unchanged. Full SDK/E2E suites were not run because SDK behavior is unchanged.
Rollout and safety
This PR does not bump versions, create production tags, dispatch a publishing workflow, alter v6.0.5, or publish packages. Its merge with unchanged versions must not trigger a release.
Repository/organization policy must allow the tag job's contents: write and actions: write permissions. The policy-inspection endpoint returned HTTP 403 for the current credentials, so policy verification and live end-to-end validation remain rollout prerequisites. No new PAT, GitHub App, or protection bypass is introduced.
Verify live automation at the next intentionally approved release version bump. Old tags and existing runs retain their original workflow definitions; this change does not repair the previous v6.0.5 run.
This PR extends #670’s release-preparation work by automating stable SDK releases after synchronized version bumps reach protected master, without requiring manual tag or GitHub Release creation.
Changes:
Select the exact pushed commit, validate release metadata, create an immutable version tag, and explicitly dispatch publishing.
Separate building, PyPI publishing, and GitHub finalization, retaining distributions for failed-job recovery.
Add offline release-tooling tests, read-only PR test execution, and release/recovery documentation while preserving SDK Python compatibility.
File
Description
pyproject.toml
Assigns Python 3.11 to release-tooling type checks while retaining the SDK baseline.
CONTRIBUTING.md
Documents automatic releases, permissions, manual dispatch, and recovery procedures.
.github/workflows/tag-release.yml
Adds tooling tests and master-push release selection, tagging, and dispatch.
.github/workflows/release.yml
Splits release stages, retains artifacts, and scopes job permissions.
.github/scripts/test_release_tools.py
Adds 20 offline tests covering release selection, validation, and recovery.
.github/scripts/release_tools.py
Implements release planning, tag validation, dispatch, distribution checks, and GitHub finalization.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Finalization can leave an existing release for a stable tag marked as a prerelease, preventing it from qualifying as GitHub’s latest stable release.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Clear prerelease flag when finalizing recovered releases
.github/scripts/release_tools.py:370
If an existing release or draft for this stable tag has prerelease: true, finalization succeeds but leaves it marked as a prerelease: drafts only get draft: false, and published releases aren't patched at all. Unlike newly created releases, the recovered release cannot qualify as GitHub's latest stable release. Clear the prerelease flag when finalizing existing prereleases, while preserving their notes and assets.
Finalization now clears prerelease: true on both recovered drafts and already-published releases for stable tags, after asset reconciliation succeeds. It publishes drafts as before and patches only the required flags, preserving authored notes and existing assets. Already-stable published releases receive no metadata update.
Validation: the new regression failed for both recovery states before the fix. All 28 offline release tests now pass, along with repository formatting/lint and explicit release-tooling Ruff/type checks. The recovery behavior is documented. No production tags, releases, publishing dispatches, or packages were changed.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The version check rejects corrective PRs that unify mixed project versions after a partial administrator bump, blocking the documented recovery path even when the lockfile and changelog are valid.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Allow corrective PRs to restore consistent project versions
.github/scripts/release_tools.py:148
After a partial administrator bump leaves master with mixed project versions, this check also rejects a PR that repairs all projects to one valid version. That blocks the documented recovery path in CONTRIBUTING.md:249–251, even when the corrected lockfile and changelog are valid. Validate corrective PR snapshots separately while keeping automatic release selection disabled for inconsistent bases, and add a regression test for this case.
Resume matching draft releases, request dispatch run details and accept successful empty responses, and safely replace only empty starter upload placeholders. Validate changed release metadata on read-only PR events using the same checks as master pushes and document recovery after failed preparation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 31ae2ff7-b8f6-406d-b492-10d598bb9070
Normalize recovered draft and published releases after asset reconciliation.
Patch only the required flags and preserve authored notes and assets.
Cover both recovery states with a focused regression and document behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 31ae2ff7-b8f6-406d-b492-10d598bb9070
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
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.
Summary
Automate stable releases after synchronized version bumps land on protected
master, without requiring maintainers to create a tag or publish a GitHub Release manually.Follow-up to #670: that PR only changed release metadata, while
release.ymlonly listened for tag pushes. The subsequent manualv6.0.5release created a tag and automatically started the release run. Both SDKs were published to PyPI, but GitHub finalization failed with422 tag_name already_exists.Added
prepare releaseworkflow that compares the exact push before/after commits, validates synchronized stable project/lockfile versions and the changelog, creates an immutable version tag, and explicitly dispatchesrelease.ymlat that tag usingGITHUB_TOKEN.Changed
workflow_dispatch.releaseenvironment and existing PyPI trusted-publisher identity.Fixed
masternow start the release flow automatically; ordinary pushes with unchanged versions do not publish.GITHUB_TOKEN.Validation
Verified the exact six-file change locally:
actionlintpassed for both changed workflows using the official checksum-verified validator.poe check-format,poe lint, andpoe typespassed; the hidden release-tooling directory also passed an explicit type check.uv lock --check --offlineandgit diff --checkpassed.poe buildproduced both SDK wheels and source distributions; the new distribution gate verified their 6.0.5 names and metadata without publishing.SDK source, project versions, dependency requirements,
uv.lock, and the type-check baseline are unchanged. Full SDK/E2E suites were not run because SDK behavior is unchanged.Rollout and safety
This PR does not bump versions, create production tags, dispatch a publishing workflow, alter
v6.0.5, or publish packages. Its merge with unchanged versions must not trigger a release.Repository/organization policy must allow the tag job's
contents: writeandactions: writepermissions. The policy-inspection endpoint returned HTTP 403 for the current credentials, so policy verification and live end-to-end validation remain rollout prerequisites. No new PAT, GitHub App, or protection bypass is introduced.Verify live automation at the next intentionally approved release version bump. Old tags and existing runs retain their original workflow definitions; this change does not repair the previous
v6.0.5run.