Skip to content

chore(release): correct version tagging and improve promotion flow#3866

Open
rickeylev wants to merge 3 commits into
bazel-contrib:mainfrom
rickeylev:fix-promote-rc-bugs
Open

chore(release): correct version tagging and improve promotion flow#3866
rickeylev wants to merge 3 commits into
bazel-contrib:mainfrom
rickeylev:fix-promote-rc-bugs

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

This change refactors the release promotion tool to ensure all pre-conditions are verified before making any modifications and automates post-promotion tracking updates. It also fixes a bug where the tool incorrectly assumed 'v' prefixes when identifying the latest release candidate and computing the final version tag.

…okup

Update promote-rc and get_latest_rc_tag to work with the new tag format that lacks a 'v' prefix. Add corresponding unit tests to verify the behavior.
…git.tag

Update git.tag to require a commit_ref. Restructure promote-rc to verify pre-conditions before making modifications, and point the final tag directly to the RC's commit SHA. Update tests accordingly.
…motion comment

Rename and optimize `resolve_issue_number` to search by title via `gh` using corrected repo/label globals. Post a comment on the tracking issue with release and BCR search links upon successful promotion, and use `shlex.join` for copy-paste friendly logging.
@rickeylev rickeylev requested a review from aignas as a code owner June 28, 2026 22:06
@rickeylev rickeylev enabled auto-merge June 28, 2026 22:06

@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 to support promoting release candidates directly to final releases without checking out the tag, while also improving GitHub tracking issue updates and switching to shlex.join for safer command logging. The review feedback highlights two critical issues: a potential TypeError due to changing get_open_tracking_issues to require a version argument when parameterless calls still exist, and an inconsistency where release candidates are still created with a 'v' prefix but searched for without it.

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 on lines +13 to 25
def get_open_tracking_issues(version):
"""Returns a list of open tracking issues with the 'type: release' label."""
output = run_cmd(
"gh",
"issue",
"list",
"--label=type:release",
f"--repo={_REPO}",
f"--label={_LABEL}",
"--state=open",
f'--search="Release {version}" in:title',
"--json=number,title,url",
)
return json.loads(output) if output else []

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.

critical

The signature of get_open_tracking_issues was changed to require a version argument, but there are existing calls in release.py (e.g., lines 352 and 419) that call this function with no arguments. This will result in a TypeError at runtime.

To fix this, make the version parameter optional with a default value of None, and conditionally append the search filter only when version is provided.

Suggested change
def get_open_tracking_issues(version):
"""Returns a list of open tracking issues with the 'type: release' label."""
output = run_cmd(
"gh",
"issue",
"list",
"--label=type:release",
f"--repo={_REPO}",
f"--label={_LABEL}",
"--state=open",
f'--search="Release {version}" in:title',
"--json=number,title,url",
)
return json.loads(output) if output else []
def get_open_tracking_issues(version=None):
"""Returns a list of open tracking issues with the 'type: release' label."""
cmd = [
"gh",
"issue",
"list",
f"--repo={_REPO}",
f"--label={_LABEL}",
"--state=open",
]
if version:
cmd.append(f'--search="Release {version}" in:title')
cmd.append("--json=number,title,url")
output = run_cmd(*cmd)
return json.loads(output) if output else []

Comment thread tools/private/release/release.py
@rickeylev rickeylev disabled auto-merge June 29, 2026 02:46
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