chore(release): correct version tagging and improve promotion flow#3866
chore(release): correct version tagging and improve promotion flow#3866rickeylev wants to merge 3 commits into
Conversation
…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.
There was a problem hiding this comment.
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.
| 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 [] |
There was a problem hiding this comment.
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.
| 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 [] |
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.