Skip to content

chore(release): support custom remote in create-release-branch and refactor#3877

Merged
rickeylev merged 2 commits into
bazel-contrib:mainfrom
rickeylev:fix-create-release-branch-remote
Jul 1, 2026
Merged

chore(release): support custom remote in create-release-branch and refactor#3877
rickeylev merged 2 commits into
bazel-contrib:mainfrom
rickeylev:fix-create-release-branch-remote

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator
  • Add --remote flag to create-release-branch subcommand to support pushing to upstream locally and origin in GHA.
  • Factor cmd_create_release_branch out of release.py into create_release_branch.py.
  • Use branch_url instead of branch name in tracking issue metadata.
  • Update release tracking template with manual editing and backporting instructions.

…factor

- Add --remote flag to create-release-branch subcommand to support pushing to upstream locally and origin in GHA.
- Factor cmd_create_release_branch out of release.py into create_release_branch.py.
- Use branch_url instead of branch name in tracking issue metadata.
- Update release tracking template with manual editing and backporting instructions.
@rickeylev rickeylev requested a review from aignas as a code owner July 1, 2026 02:27
@rickeylev rickeylev merged commit 3ab60b5 into bazel-contrib:main Jul 1, 2026
4 of 6 checks passed

@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 tool by moving the cmd_create_release_branch subcommand into its own module (create_release_branch.py), adding support for a configurable git remote, and updating the release tracking issue template with instructions for backports and manual editing. Feedback focuses on maintaining backward compatibility with existing tracking issues by preserving the branch metadata key alongside the new branch_url key, and updating the corresponding unit tests to assert both fields.

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.

# Update tracking issue checklist
print("Updating tracking issue checklist...")
branch_url = f"{REPO_URL}/tree/{branch_name}"
metadata = {"status": "done", "branch_url": branch_url, "commit": commit_sha[:8]}

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.

medium

The metadata key has been changed from branch to branch_url. However, parse_checklist_state in tools/private/release/release_issue.py still expects the key branch (i.e., meta.get("branch")) and does not parse branch_url. To maintain backward compatibility with existing tracking issues and ensure that the parsed checklist state remains consistent, we should write both branch and branch_url to the metadata.

Suggested change
metadata = {"status": "done", "branch_url": branch_url, "commit": commit_sha[:8]}
metadata = {
"status": "done",
"branch": branch_name,
"branch_url": branch_url,
"commit": commit_sha[:8],
}

Comment on lines +1251 to +1254
self.assertIn(
"branch_url=https://github.com/bazel-contrib/rules_python/tree/release/2.0",
call_args[1],
)

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.

medium

Add an assertion to verify that the branch metadata is also correctly written to the tracking issue body, aligning the test with the backward-compatibility fix.

Suggested change
self.assertIn(
"branch_url=https://github.com/bazel-contrib/rules_python/tree/release/2.0",
call_args[1],
)
self.assertIn(
"branch_url=https://github.com/bazel-contrib/rules_python/tree/release/2.0",
call_args[1],
)
self.assertIn("branch=release/2.0", call_args[1])

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