Skip to content

chore(py): release from a merged PR, with checks before tagging - #6702

Merged
huangjeff5 merged 7 commits into
mainfrom
chore/py-release-notes-refs
Oct 10, 2026
Merged

huangjeff5 merged 7 commits into
mainfrom
chore/py-release-notes-refs

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Python SDK releases now have a single path: merge a release PR, then run py/bin/create_release <version> <pr-number>. The script verifies the PR and the package versions before it tags anything, and it publishes the PR description as the GitHub release notes.

Releasing

export V=0.13.0

# 1. Bump every package on a release branch
git checkout main && git pull
git checkout -b chore/py-release-$V
py/bin/bump_version $V

# 2. Open the release PR. The description becomes the release notes.
git commit -am "chore(py): release Python SDK v$V"
git push -u origin chore/py-release-$V
gh pr create --base main --title "chore(py): release Python SDK v$V" --body-file notes.md --label python

# 3. After review and merge, tag and publish
py/bin/create_release $V <pr-number> --dry-run
py/bin/create_release $V <pr-number>

# 4. Approve the "Publish Python" workflow run, then confirm
pip index versions genkit
# => genkit (0.13.0)

bump_version prints steps 2 and 3 for the new version when it finishes.

Checks

create_release runs every check before it changes anything, then reports all failures with a fix for each:

  • Merged into main: the PR is merged, and into main.
  • Title: exactly chore(py): release Python SDK v<version>.
  • Release notes: the PR description isn't empty.
  • Versions: every py/packages/*/pyproject.toml is at <version> in the PR's merge commit.
  • Tag: py/v<version> doesn't exist yet.
$ py/bin/create_release 0.13.0 6430 --dry-run
Genkit Python SDK v0.13.0 from #6430

  ✓ PR merged into main
  ✗ Title is "chore(py): release Python SDK v0.12.0"
    → Expected "chore(py): release Python SDK v0.13.0". Pass the PR that bumped to 0.13.0; rename only if this is it.
  ✓ Release notes present
  ✗ Packages are at 0.12.0, not 0.13.0
    → Check the version and PR number.
  ✓ py/v0.13.0 is available

Blocked: 2 checks failed. Nothing was tagged or published.

Exit codes: 0 success, 1 usage or environment error, 2 a check failed and nothing changed.

Changes

  • create_release takes exactly <version> <pr-number> [--dry-run]. The --notes and --notes-file options are removed. Release notes come only from the PR description.
  • The PR number is required. The previous title search (Python SDK ${VERSION} in:title) never matched release PR titles, which include a v. Its fallback could pick a different PR that mentioned the version.
  • Releases are tagged at the PR's merge commit instead of the current tip of main. Commits merged after the release PR stay out of the release. The script no longer requires a clean checkout of main.
  • The script no longer tells you to start Publish Python by hand. Pushing the tag already starts the workflow.
  • bump_version prints the exact commit, PR, and release commands for the new version.
  • just create-release VERSION PR now passes its arguments to the script.
  • py/docs/release_playbook.md documents the single path, the checks, and the exit codes.
  • Stale references removed: the nonexistent py/CHANGELOG.md, and an outdated package count.

Release candidates are unchanged and still use the "Release Python RC" workflow.

Testing

Dry runs against existing PRs, on bash 5 and the macOS system bash 3.2:

  • 0.12.0 6430: all checks pass except the tag, which already exists.
  • 0.13.0 6430: fails on the title and the package versions.
  • 0.13.0 6704: fails because the PR is open and has the wrong title.
  • Missing arguments, an unknown PR, a pre-release version, and --notes each exit with a usage error.

The tag, push, and GitHub release steps run for the first time on the next release. They use the same git tag -a, git push, and gh release create commands as before, now targeting the merge commit with --verify-tag.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the release process scripts for the Genkit Python SDK. Specifically, it modifies py/bin/bump_version to instruct developers to write release notes in the pull request body instead of updating CHANGELOG.md. Additionally, it updates py/bin/create_release to point to the GitHub release URL in the git tag message and generalizes the plugin count description. There are no review comments to address.

@apascal07 apascal07 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

py/bin/create_release lines 295-299 still say "Go to Actions → Publish Python Package" and "Run workflow with: publish_scope=all". The workflow is named Publish Python, has no publish_scope input, and the tag push in step 8 already triggers it, so following the printed steps dispatches a second run from main instead of approving the tag run (py/docs/release_playbook.md step 5).

Comment thread py/bin/bump_version Resolved
… the release PR first

Drops --notes/--notes-file and the PR title search. Every check runs before
anything is tagged, and each failure prints its fix. Tags the PR's merge
commit instead of the tip of main.
@github-actions github-actions Bot added the docs Improvements or additions to documentation label Oct 10, 2026
@huangjeff5 huangjeff5 changed the title chore(py): release scripts point at GitHub Releases, not py/CHANGELOG.md chore(py): one release path: create_release <VERSION> <PR_NUMBER>, checked up front Oct 10, 2026
@huangjeff5 huangjeff5 changed the title chore(py): one release path: create_release <VERSION> <PR_NUMBER>, checked up front chore(py): release from a merged PR, with checks before tagging Oct 10, 2026
@huangjeff5
huangjeff5 merged commit 316c938 into main Oct 10, 2026
26 checks passed
@huangjeff5
huangjeff5 deleted the chore/py-release-notes-refs branch October 10, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore docs Improvements or additions to documentation python Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants