Skip to content

chore(release): refactor process-backports and various release tool fixes#3881

Merged
rickeylev merged 11 commits into
bazel-contrib:mainfrom
rickeylev:fix-release-tool-bugs
Jul 2, 2026
Merged

chore(release): refactor process-backports and various release tool fixes#3881
rickeylev merged 11 commits into
bazel-contrib:mainfrom
rickeylev:fix-release-tool-bugs

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

This PR refactors the process-backports subcommand, improves its dry-run validation, and fixes a bug in create-rc.

Why the changes are made

  • The process-backports logic was previously embedded in the main release.py script, making it difficult to maintain and extend.
  • process-backports lacked a robust dry-run validation to safely verify backport applicability without leaving the workspace dirty.
  • process-backports could fail with checkout ambiguity if the release branch existed on multiple remotes.
  • create-rc crashed with a fatal subscripting error when trying to access BackportTask objects as dictionaries after their recent refactoring.
  • create-rc tracking issue comments lacked a direct link to the BCR entry for the new version.

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.
@rickeylev rickeylev requested a review from aignas as a code owner July 2, 2026 03:20

@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 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.

Comment thread tools/private/release/git.py
Comment thread tools/private/release/process_backports.py
Comment thread tests/tools/private/release/release_test.py Outdated
@rickeylev rickeylev merged commit cc799f1 into bazel-contrib:main Jul 2, 2026
6 checks passed
@rickeylev rickeylev deleted the fix-release-tool-bugs branch July 2, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant