Repository navigation
Description
What happened
The stage job opens a draft pull request for each item it stages, and it never marks the pull request ready (the header of src/devops_cli/roadmap/stage.py and k8s/README.md say so). On 2026-10-31 the pull requests #2857, #2858 and #2859 stayed drafts for more than an hour with 16 of 16 required checks passed. The plan in each of them was complete when the job opened it. The owner could not tell whether work went on, and GitHub does not merge a draft.
The owner decision of 2026-10-31: a draft pull request is marked ready for review when work on the change is complete and all checks pass. The rule "never marks the pull request ready" is replaced.
What should happen
- The Service marks a stage pull request ready when all its checks have ended and passed. The pull request is complete when the job opens it, so the checks are the only wait.
- It needs no model call. It runs on the status lane, as a step of an existing row or as a small row of its own. The choice, and the request cost per round, go in the proposal.
- It marks ready only the draft pull requests that the stage job recorded for an item (the record holds the pull request number), never a draft of a person.
- A pull request with a failed check, or with a check still running, stays a draft. The Service does not retry the checks.
- The implement job already marks its pull request ready after the last group (
mark_readyinimplement_pull.py). Keep that, and check that the two paths use one function for the call. - The text that says the stage job never marks ready (
stage.pyheader,k8s/README.md, the stage spec,docs/) says the new rule. - Check the App token.
pull_requests: writeis granted. Marking ready is a GraphQL mutation (markPullRequestReadyForReview); show with evidence that the installation token may call it, and count its cost againstservice.github_requests_per_hour.
Evidence
- docs(openspec): plan #2147 move three volumes off control-plane #2857, docs(openspec): plan #2735 refuse LESS in subprocess env guard #2858, docs(openspec): plan #2739 refuse GH_TELEMETRY_ENDPOINT_URL #2859 on 2026-10-31: draft,
clean, all checks green. stage.pyline 7: "It never marks the pull request ready".
Acceptance criteria
- A test replays a round with a recorded draft stage pull request whose checks pass: it is marked ready once.
- A test with a failed check, a running check, and a draft of a person: none is marked ready.
- The round makes no request when the Service holds no recorded draft.
- The documents state the new rule.
-
uv run devops cipasses.
Proposed design
Problem statement
The stage job opens a draft pull request for each item it stages, but the Service never marks the pull request ready for review. When all checks pass, the pull requests stay drafts indefinitely. GitHub does not merge a draft, and the owner cannot tell whether work is still in progress. The owner decision of 2026-10-31 replaces the rule: a draft pull request is marked ready when work is complete and all checks pass.
Acceptance criteria
Requirement: Mark stage PR ready on passing checks
The Service SHALL mark a recorded draft stage pull request ready for review when all its checks have ended and passed.
Scenario: Recorded draft with all checks passed
- WHEN A round runs and a recorded draft stage pull request has all checks ended and passed
- THEN The pull request is marked ready for review exactly once
Requirement: Leave non-qualifying PRs as drafts
The Service SHALL NOT mark a pull request ready when any check has failed, any check is still running, or the pull request is not a recorded stage draft.
Scenario: Failed check, running check, and person's draft
- WHEN A round runs and a pull request has a failed check, a running check, or is a draft not recorded by the stage job
- THEN The pull request remains a draft
Requirement: No request without recorded draft
The Service SHALL make no GitHub request for marking ready when it holds no recorded draft stage pull request.
Scenario: No recorded draft
- WHEN A round runs and the Service holds no recorded draft stage pull request
- THEN No GitHub request is made for marking ready
Requirement: Documents state the new rule
The documentation SHALL state that the Service marks a stage pull request ready when all its checks pass, replacing the rule that it never marks the pull request ready.
Scenario: stage.py header and k8s/README.md updated
- WHEN The code is reviewed
- THEN The stage.py header, k8s/README.md, and the stage spec state the new rule
Requirement: CI passes
The command uv run devops ci SHALL pass.
Scenario: CI run
- WHEN
uv run devops ciis run - THEN It exits with code 0
Existing Tool Considered
No alternatives check has run. No open, maintained external tool covers this need: marking a GitHub App installation token's draft pull request ready for review inside the Service's status lane. The project builds its own code. It reuses the existing mark_ready function in src/devops_cli/roadmap/implement_pull.py:127. The written cost is one new function of about 40 lines that reads stage records, checks pull request status through the existing GitHub client, and calls mark_ready for each qualifying pull request, plus about 60 lines of tests and about 15 lines of documentation changes. The build time is about 1 hour. The keep and fix cost is minimal: the code holds no state and makes no model call.
Key questions
- Where does the mark-ready check run in the Service?: As a step of the
implementrow on the status lane. The status lane runs no model call, and theimplementrow already runs every 10 minutes with a GitHub session. Adding the check as a step reuses the existing row infrastructure and adds no new row to the schedule. (best practice) [sources: k8s/README.md, CONTEXT.md]- Chosen: Step of the implement row. The implement row already runs on the status lane every 10 minutes with no model call and a GitHub session. Adding the check here reuses the existing infrastructure and adds no new row.
- Rejected: New row on the status lane. A new row adds a new entry to the schedule, a new label in metrics, and a new code path. The check is small enough to fit as a step of an existing row.
- Which function marks the pull request ready?: The existing
mark_readyfunction insrc/devops_cli/roadmap/implement_pull.py:127. The body requires that both the implement path and the new stage path use one function for the call. [sources: src/devops_cli/roadmap/implement_pull.py:127, src/devops_cli/roadmap/implement_run.py:505] - Does the App token have permission to call
markPullRequestReadyForReview?: Yes. The Appdevops-cli-serviceholds the repository permissionPull requests read and write. ThemarkPullRequestReadyForReviewGraphQL mutation requirespull_requests: write. The installation token is scoped to the App's permissions, so it may call the mutation. [sources: k8s/README.md] - How does the Service identify which pull requests are stage drafts?: The item's job record holds
StageRecordKey.PRwith the pull request number. The_pull_offunction instage.pyreads this value. The Service iterates over items whose record holds a PR number and checks only those pull requests. [sources: src/devops_cli/roadmap/stage.py] - What is the request cost per round?: For each recorded stage pull request: 1 read to check its status and checks, and 0 or 1 write to mark it ready. No model call. The cost counts against
service.github_requests_per_hour(500 by default). A round with no recorded drafts makes no request. [sources: k8s/README.md] - Does the Service retry failed or running checks?: No. The body states: "The Service does not retry the checks." A pull request with a failed check or a running check stays a draft until the next round. [sources: src/devops_cli/roadmap/stage.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 31, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.Stage PRs stay drafts indefinitely after checks pass, blocking merge and confusing the owner, but the system does not crash or lose data.Removes a workflow block that leaves valid stage PRs unmergeable and hides status from the owner.Requires a status-lane step, a GraphQL mutation call, a guard to target only stage-recorded PRs, shared-function reuse, doc updates, and tests.Both mark a pull request ready when checks pass, but #2665 covers the implement job PR while this candidate covers the stage job PR; the candidate also asks both paths share one mark_ready call.devops-cli-service commentedon Oct 31, 2026
Status set to Ready at 330e9fa (see proposed design in issue body).
test(roadmap): the stage-ready error tests name the error they expect (…
chore(main): release 0.28.0 (#2880)