Description
Implement end-to-end integrations to automatically keep GitHub pull requests up to date with their base branches (e.g. main or active release branches).
Objectives & Deliverables
- GitHub Action Workflow (
.github/workflows/update-prs.yml):
- Automatically trigger when changes are pushed to
main or release/** branches.
- Support
workflow_dispatch (with base branch and PR number inputs) and PR comment /update / /sync triggers.
- Gracefully handle conflicts, draft PRs, and mergeability status.
- Native CLI Command (
devops pr update):
- Provide
devops pr update [PR_NUMBER] with --all, --base, --repo, --expected-head-sha, and --dry-run options.
- Call GitHub's
PUT /repos/{owner}/{repo}/pulls/{number}/update-branch endpoint with rate-limited, token-bucket pacing via run_gh.
- Rich terminal status reporting.
- FastMCP Agent Tool (
pr_update_branch):
- Expose MCP tool allowing autonomous agents to update PR branches programmatically.
- Comprehensive Test Suite:
- Unit and integration tests in
tests/test_pr_update.py verifying single PR update, batch --all updates, conflict handling, --dry-run, and MCP tool wrapper.
Description
Implement end-to-end integrations to automatically keep GitHub pull requests up to date with their base branches (e.g.
mainor active release branches).Objectives & Deliverables
.github/workflows/update-prs.yml):mainorrelease/**branches.workflow_dispatch(with base branch and PR number inputs) and PR comment/update//synctriggers.devops pr update):devops pr update [PR_NUMBER]with--all,--base,--repo,--expected-head-sha, and--dry-runoptions.PUT /repos/{owner}/{repo}/pulls/{number}/update-branchendpoint with rate-limited, token-bucket pacing viarun_gh.pr_update_branch):tests/test_pr_update.pyverifying single PR update, batch--allupdates, conflict handling,--dry-run, and MCP tool wrapper.