Repository navigation
chore(py): release from a merged PR, with checks before tagging - #6702
Conversation
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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).
… 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.
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
bump_versionprints steps 2 and 3 for the new version when it finishes.Checks
create_releaseruns every check before it changes anything, then reports all failures with a fix for each:main.chore(py): release Python SDK v<version>.py/packages/*/pyproject.tomlis at<version>in the PR's merge commit.py/v<version>doesn't exist yet.Exit codes:
0success,1usage or environment error,2a check failed and nothing changed.Changes
create_releasetakes exactly<version> <pr-number> [--dry-run]. The--notesand--notes-fileoptions are removed. Release notes come only from the PR description.Python SDK ${VERSION} in:title) never matched release PR titles, which include av. Its fallback could pick a different PR that mentioned the version.main. Commits merged after the release PR stay out of the release. The script no longer requires a clean checkout ofmain.bump_versionprints the exact commit, PR, and release commands for the new version.just create-release VERSION PRnow passes its arguments to the script.py/docs/release_playbook.mddocuments the single path, the checks, and the exit codes.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.--noteseach 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, andgh release createcommands as before, now targeting the merge commit with--verify-tag.