chore(release): refactor create-rc and handle existing remote release branch#3879
Conversation
rickeylev
commented
Jul 1, 2026
- Move cmd_create_rc logic from release.py to a new create_rc.py module.
- Move parse_backports from release.py to release_issue.py.
- Add required --remote flag to create-rc subcommand.
- Update generate_rc.yml workflow to pass --remote origin.
- In create-release-branch, detect if remote branch already exists and handle same-commit, fast-forward, and non-fast-forward cases.
- Add remote_branch_exists and is_ancestor helpers to git.py.
This change refactors the create-release-branch subcommand to push the commit SHA directly to the remote branch reference, avoiding checking out the branch locally and changing the working directory state. Tests are updated to match.
… branch - Move cmd_create_rc logic from release.py to a new create_rc.py module. - Move parse_backports from release.py to release_issue.py. - Add required --remote flag to create-rc subcommand. - Update generate_rc.yml workflow to pass --remote origin. - In create-release-branch, detect if remote branch already exists and handle same-commit, fast-forward, and non-fast-forward cases. - Add remote_branch_exists and is_ancestor helpers to git.py.
There was a problem hiding this comment.
Code Review
This pull request refactors the release tooling by extracting the create-rc subcommand into its own module (create_rc.py), moving parse_backports to release_issue.py, and updating create_release_branch.py to push branches directly without affecting the local checkout. It also introduces new Git helper functions and comprehensive unit tests. The review feedback suggests ensuring that remote branch references are fully updated by fetching the remote before fetching tags, checking out the remote-tracking branch directly to avoid outdated local branch states, and updating the corresponding mock assertions in the tests.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- Fetch remote before fetching tags. - Checkout remote-tracking branch directly instead of local branch. - Remove rocket emoji and add snake and basil emojis to the comment. - Update tests to match new behavior.