Repository navigation
Description
Problem or Motivation
devops pr update --all calls the GitHub update-branch API for every open pull request that is not a draft. It does not check for a conflict or for a failed check (update in src/devops_cli/commands/pr.py, src/devops_cli/github/branch_update.py). In the census week (2026-11-04 to 2026-11-11), update-branch merges of main with no conflict started 28 runs (about 1,208 runner-minutes). 17 of the 28 merges came in groups of 2 to 6 pull requests within 10 minutes, which is the pattern of --all. Each merge is a head that GitHub makes on the server, where no push check sees it. GitHub update-branch cannot update a branch that has a merge conflict (GitHub docs, "Keeping your pull request in sync with the base branch"), so an update of a dirty pull request cannot work.
The CI audit of 2026-11-11 found 13 topic pull request runs that came from a pure rebase: the base moved and the zero-context patch-id stayed the same. The 7 of them with job files used 571 runner-minutes. The strict up-to-date policy is off, and ADR 0014 asks for a rebase only on a conflict. Thus these runs do no work that the merge needs. The source of the 13 runs is not known.
docs/SDLC.md Phase 5 says that an open pull request needs no catch-up update. The devops-pr-ci skill has no rebase line, and 19 of 171 worktree branches fail the branch-name hook.
The owner decided on 2026-11-11 that the command stays only for a failed required check whose fix is on main. --all and catch-up updates go.
Proposed Solution & Architectural Design
Delete --all/-a and its loop.
devops pr update <n> reads mergeable_state of pulls/<n> and the required check runs of the head:
- When the state is
dirty, it prints the local recipe (git fetch origin main,git rebase origin/main, solve,devops branches push) and makes no API call. - It calls update-branch only when a required check failed on the head and the state is not
dirty. - In all other cases, it prints the reason and changes nothing.
Find the source of the 13 pure-rebase runs first (AGENTS.md rule 2), from the push actors and the Service logs. The leads are devops pr update, the rebase at the start of each implement run (implement_run.py) and the rebase of a staged branch (stage.py). The push gate of #4670 refuses a catch-up-only push from the jobs. When the source is a path that this issue and #4670 do not cover, let that path rebase only on a conflict (git merge-tree --write-tree reports a conflict with no checkout), and push only when the tree changes.
Add these lines to the devops-pr-ci skill (source and the copies under .agents/, .claude/ and .kilocode/skills):
- Never push or update only to catch up (
docs/SDLC.mdPhase 5). - On a rebase conflict in a generated document, run
git checkout --ours <file>(in a rebase, "ours" ismain), thenuv run devops docs generate --sync-readme,git addandgit rebase --continue. - Start work with
devops repos worktrees add <issue>, whose branch name passes the branch-name hook.
Generate the command documents again. Add no shim.
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/commands/pr.py, src/devops_cli/github/branch_update.py, the devops-pr-ci skill).
Existing Tool Considered
GitHub REST update-branch and mergeable_state cover the single update. git rebase and the push gate of #4670 cover a conflict. The change deletes the bulk path and adds no tool, so the keep cost falls. Cost (estimate): about 80,000 tokens and 1.5 hours to build.
Acceptance Criteria
--allis gone from--helpand from the generated command documents.- A
dirtypull request gets the recipe and 0 API writes. - A pull request that is behind
mainwith green checks gets no update. - A pull request with a failed required check and no conflict gets exactly one update-branch call.
- The pull request names the source of the pure-rebase runs, with evidence.
- One week after the merge, a census finds at most 5 merges of
mainwith the committer GitHub, and no group of 2 or more within 10 minutes. - Over one day, 0 topic pull request runs have a moved base and the same patch-id, except after a conflict (13 in the audit).
Dependencies
Source: #4667
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
refactorprefix of the title gives the type.(pr)scope of the title gives the scope.An owner decision is made and CI cost is wasted weekly, but no user is blocked and no data is at risk.Saves roughly 1,208 runner-minutes per week and removes a path that cannot work on a dirty pull request.The body estimates about 1.5 hours and 80,000 tokens to build.Both target devops pr update; #258 added the command and the --all loop, while the candidate removes --all and restricts the command to a single failed-check case.dan-petty commentedon Nov 11, 2026
Scope from the CI audit (2026-11-11)
Another workflow builds this item now. This comment only adds the measured cost of pure rebases and an acceptance criterion.
src/devops_cli/roadmap/implement/implement_run.py:790-793fetches and rebases onto the default branch at the start of each run, andsrc/devops_cli/roadmap/stage/stage.py:2358-2379rebases a staged branch.origin/mainand merges cleanly, and an open PR gets no catch-up rebase when nothing else changes. So a path pushes only when the patch changes or the branch has a conflict withorigin/main.git merge-tree --write-treereports a conflict with no checkout.dan-petty commentedon Nov 11, 2026
Scope from the hooks review plan (2026-11-11)
This issue is also child 5 of #4771 (hooks item P06). Owner decision OD1 (a) of 2026-11-11 applies:
devops pr update <n>stays only for a failed required check whose fix is onmain, and--alland every catch-up update go. The body already holds the design of both plans.The hooks plan adds one constraint:
devops pr update <n>for this one case. Use the same words in the help text of the command and in that message.Two other children remove catch-up paths: #4027 (no update-branch for a clean branch that is behind
main) and #3969 (no push when the plan does not change).No new acceptance criterion.
feat(git): refuse a push that does not hold origin/main (#4879)
devops-cli-service commentedon Nov 12, 2026
Released in v0.118.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.118.0
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 12:40 UTC