chore(release): refactor process-backports and various release tool fixes#3881
Conversation
The tool now checks for open branch PRs or PRs associated with the tracking issue before creating a new one, and no longer exits early when there are no local changes to commit.
…into fix-release-tool-bugs # Conflicts: # tests/tools/private/release/release_test.py # tools/private/release/prepare.py # tools/private/release/release.py # tools/private/release/release_issue.py
Refactor `process-backports` subcommand into a separate module. Add `--remote` and `--dry-run` flags. Improve dry-run to perform validation (cherry-pick with no-commit, news merge, reset). Handle open/draft PRs by ignoring them and closed PRs by marking them as failed. Update tests accordingly.
There was a problem hiding this comment.
Code Review
This pull request refactors the release tooling by extracting the process_backports subcommand into its own module, introducing a structured BackportTask class to replace raw dictionaries, and enhancing Git and GitHub helpers to support more granular PR statuses and remote tracking. Additionally, release candidate comments now include direct links to BCR entries and workflow statuses, and comprehensive unit tests have been added. Feedback on the changes suggests resetting local branches hard to their remote tracking counterparts during checkout to prevent branch drift, optimizing the backport process to support cumulative dry-run validation, batching GitHub issue updates for atomicity, restoring the original branch after dry-runs, and updating the corresponding unit tests to align with these improvements.
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.
This PR refactors the
process-backportssubcommand, improves its dry-run validation, and fixes a bug increate-rc.Why the changes are made
process-backportslogic was previously embedded in the mainrelease.pyscript, making it difficult to maintain and extend.process-backportslacked a robust dry-run validation to safely verify backport applicability without leaving the workspace dirty.process-backportscould fail with checkout ambiguity if the release branch existed on multiple remotes.create-rccrashed with a fatal subscripting error when trying to accessBackportTaskobjects as dictionaries after their recent refactoring.create-rctracking issue comments lacked a direct link to the BCR entry for the new version.