chore(release): automate backport processing on PR merge, and have add-backports accept hashtag and url refs#3897
Conversation
Allow backports to be added via PR comments and automatically processed on merge. - Added 'add-backports' subcommand to append PRs to active release tracking issue. - Added 'find-release-issue' subcommand to locate the tracking issue for a PR. - Added unit tests for new subcommands. - Created 'release_add_backports' reusable workflow. - Updated comment workflow to parse PR comments. - Created 'on_pr_closed' workflow to automate processing on merge.
…add-backports - Replace find-release-issue with on-pr-merged subcommand to handle the merge event in one step. - Update on_pr_closed.yaml workflow to call on-pr-merged. - Modify add-backports to accept PR numbers, #numbers, and URLs (strictly for the configured repo). - Add tests for new subcommands and URL resolution.
There was a problem hiding this comment.
Code Review
This pull request introduces two new subcommands, add-backports and on-pr-merged, along with their respective unit tests, to automate the release tracking and backporting process. Feedback focuses on improving robustness and correctness: returning a success exit code (0) instead of 1 when a PR lacks a /backport comment to avoid workflow failures, safely handling potential None values in comment bodies and empty GitHub CLI outputs, deduplicating PR references, and correcting the CLI help text to accurately reflect supported PR reference formats.
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.
* Refine RELEASING.md backport documentation based on feedback. * Update process-backports GHA command to not abort on invalid PR refs, but add them to checklist with status=error-invalid-pr. * Support passing metadata (like status) when adding backports to issue body.
Use `get("body") or ""` to guarantee a string fallback even if the body is explicitly None in API payloads, preventing TypeErrors in regex matching.
Update the set of existing PRs during the insertion loop to detect and skip duplicates in the same input list (including those that normalize to the same reference).
Update the parser help text for the 'prs' argument to reflect that commitish references are no longer supported.
Currently, backports must be manually added to the release tracking issue.
This change automates the process by allowing maintainers to comment
/backporton a PR to add it to the active release's backport checklist, and automatically
triggering the backport processing when the PR is merged.
To support this, the following changes were made:
add-backportssubcommand to the release tool to append PRs to the tracking issue.on-pr-mergedsubcommand to verify/backportcomment, find the tracking issue, and process backports.release_add_backports.yamlreusable workflow to run theadd-backportssubcommand.on_comment.yamlto parse/backportcomments on PRs and trigger the addition.on_pr_closed.yamlto detect merged PRs and run theon-pr-mergedsubcommand.