Repository navigation
fix(source-control): marking a PR ready right after a push can leave ci-status failing on the draft run #6127
Description
Activity
- addedneeds-triageNot yet classified. Floor until a type and one priority tier are set.Not yet classified. Floor until a type and one priority tier are set.
on Oct 3, 2026 This was generated by AI during triage.
Routing: human-gated, needs decision. The run history answers the issue's concurrency question, and it points at a cause the proposed post-flip check would only work around. Choosing where to fix it is the open decision; the work class depends on that choice.
What the runs show (inference from run and timeline data on #6120):
- 20:09:47 commit
82713eapushed; 20:09:49ready_for_reviewevent. - 20:09:52
cirun 37150546945 was created on the old head97f0eb6; every job started and was then cancelled. - 20:09:54
cirun 37150548659 (the push'ssynchronizerun on82713ea) was created with a payload that still said draft. It joined the same per-PR concurrency group withcancel-in-progress, cancelled the ready run, skipped its lanes, and failedci-statusas a draft. - So a ready run did appear; it was built on the stale head and was cancelled by the later draft-payload run. The ready-for-review procedure assumes the opposite order (the ready run replaces the push's draft run).
Basis: verified,
gh run list --workflow ci.ymland the jobs API for runs 37150546945 / 37150548659, the #6120 timeline API; .github/workflows/ci.yml:94-101 (per-PR group,cancel-in-progresson pull_request); plugins/source-control/skills/pull-request/reference/ready-for-review.md:80-99 (pushes, then flips immediately; completion criterion only checksisDraft).Options:
- RECOMMENDED: in
/source-control:pull-request ready, after pushing, wait until acirun exists for the pushed head before flipping. This removes the race for skill-driven flips. C3, one plugin. - The issue's proposal: after the flip, confirm a non-draft
cirun exists for the head and toggle draft/ready once if not. A backstop that also catches other causes; can pair with option 1. C3. - Change
ci.ymlso a run whose payload says draft cannot cancel a later ready run, or so a full run's draft gate reads live state. Fixes manual flips too, but changes the requiredci-statusgate. C4.
Agent Brief
Type: Bug
Summary: Marking a PR ready seconds after a push can leaveci-statusred on a draft-payload run; fix per the option chosen above.Current behavior:
The ready step pushes and flips immediately. Theready_for_reviewrun can start on the stale head and be cancelled by the push'ssynchronizerun, whose payload still says draft, leaving the head with only a failed draftci-status.Desired behavior:
After a ready flip, the PR head has a non-draftcirun, and the skill reports it. Mechanism per the chosen option.Acceptance criteria:
- The maintainer records the chosen option(s) here.
- After
/source-control:pull-request readyon a just-pushed head, a non-draftcirun exists for that head and its result is reported.
Out of scope:
- Other workflows' draft handling.
- 20:09:47 commit
- addedpriority: mediumReal value, no hard deadline; normal backlog flow.Real value, no hard deadline; normal backlog flow.needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.Human-in-the-loop required; autonomous sessions must not resolve items carrying this.status: needs-decisionAwaiting a human or maintainer judgment call.Awaiting a human or maintainer judgment call.and removedneeds-triageNot yet classified. Floor until a type and one priority tier are set.Not yet classified. Floor until a type and one priority tier are set.
on Oct 4, 2026 Recurred five times on 2026-10-11: #6948, #6977, #7036, #6991, #7164. Each time a push followed by
gh pr readyseconds later left only a draft-payload ci run, all lanes skipped and ci-status red. Workarounds used: a draft/ready toggle or an empty commit.Maintainer decision: option 1.
/source-control:pull-request readywaits for the push's ci run to register before flipping the PR to ready.Owner decision (2026-10-11): /source-control:pull-request ready waits until a ci run exists for the pushed head before the flip; after the flip, if no non-draft run appears, toggle draft/ready once. Option 3 (changing the required ci-status check) is rejected.
Recorded by the coordinating agent session with the owner's approval. Removing
needs-human; implementation is queued and will link its branch here.- removedstatus: needs-decisionAwaiting a human or maintainer judgment call.Awaiting a human or maintainer judgment call.needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.Human-in-the-loop required; autonomous sessions must not resolve items carrying this.
on Oct 11, 2026
Problem
On #6120 I pushed a merge of
mainand rangh pr readywithin seconds. Thecirun for the new head started while the PR was still a draft, andci-statusfailed withdraft: lanes not run. Mark the pull request ready to lint and test this SHA.Noready_for_reviewrun appeared for that head, so the PR sat red. A rerun does not help: it replays the original draft payload. What fixed it was switching the PR back to draft and marking it ready again (gh pr ready --undo && gh pr ready).Proposal
In
/source-control:pull-request ready(and anything else that flips a PR to ready), after the flip, confirm a non-draftcirun exists for the head SHA. If none appears within a short bound, toggle draft and ready once and say so. Also worth checking: whether the caller'sci.ymlconcurrency group lets the draft-timesynchronizerun cancel or absorb theready_for_reviewrun.Evidence
ci37150548659 (pull_request, failure, draft), with no laterready_for_reviewrun until the toggle.