Repository navigation
Description
Problem Description
Two devops pr commands reported a wrong state for PR #2509 on 2026-10-28:
devops pr check-readiness 2509reported "not grounded" and named the archived changes of other issues (1024, 1652, 2429). The branch had a new merge commit (344adba) on top ofmain5c4d24e. GitHub'spulls/2509/fileslist still used the old PR base 0137f23 and gave 184 files. The compare APImain...344adba9gave merge base 5c4d24e and 11 files, and the squash commit also has 11 files. Readiness read the stale file list, so its blocker was false.devops pr monitor 2509printed "Checks: 0/0 passed" and then "100% READY FOR MERGING: All checks passed" in the interval in which a person merged the PR. For a merged PR, the monitor counted no checks and still reported ready.
Reproduction Steps
- Push a merge commit to an open PR branch so that the PR's merge base with
mainmoves, and runuv run devops pr check-readiness <pr>within a few minutes. - Run
uv run devops pr monitor <pr>and merge the PR while it waits.
Expected vs Actual Behavior
Expected: readiness takes the PR's files from the merge base that the squash merge uses (for example the compare API of the base branch and the head), and pr monitor reports a merged or closed PR as merged or closed, with no check count and no "READY" line.
Actual: a false "not grounded" blocker, and "100% READY" with 0/0 checks for a merged PR.
Environment Diagnostics
main at 2026-10-28 (after #2442).
Logs, Traces, or Terminal Output
PR #2509 is not grounded: ... (names 1024, 1652, 2429)
Checks: 0/0 passed
100% READY FOR MERGING: All checks passed
Source: #2509
Alternatives check of 2026-11-07: partly.
Tool: gidgethub/gidgethub (https://github.com/gidgethub/gidgethub), Apache-2.0, last activity 2026-09-25, maintained.
Proposed design
Problem statement
devops pr check-readiness reads a pull request's file list from the pulls files endpoint, which keeps the merge base of the last push. A merge commit that moves the merge base makes readiness judge a stale list, report a false not-grounded blocker and name archived changes of other issues. devops pr monitor already reads merged and has a merged result, but the command prints its READY success line and the Checks: 0/0 status line on any exit 0, so a pull request merged during monitoring is still reported 100% ready, with no check count that means anything; a pull request closed unmerged has no terminal state at all and is judged as if it could still become ready.
Acceptance criteria
Requirement: Readiness reads the compare file list
devops pr check-readiness SHALL read the pull request's file list from the compare endpoint of the base branch's tip and the head commit.
Scenario: Moved merge base
- WHEN The pull request branch holds a new merge commit and the pulls files endpoint still lists the files of the old base.
- THEN The readiness read requests
repos/{owner}/{repo}/compare/{base_sha}...{head_sha}and uses thefilesof that answer as the changed files.
Requirement: Readiness makes no pulls files request
devops pr check-readiness MUST NOT request pulls/{number}/files for the file list.
Scenario: Stale list names archived changes
- WHEN The pulls files endpoint would name archived change folders of other issues and the compare answer does not.
- THEN No request path of the readiness run ends with
pulls/{number}/files, and the verdict holds no not-grounded blocker naming those folders.
Requirement: Fork head is named by owner and branch
devops pr check-readiness SHALL name the compare's head as owner:branch when the head repository differs from the base repository, and by its commit sha otherwise.
Scenario: Pull request from a fork
- WHEN The pull request payload gives a head repository that is not the base repository.
- THEN The compare request target is
repos/{base_owner}/{repo}/compare/{base_sha}...{head_owner}:{head_ref}.
Requirement: A 300-file compare answer is reported
devops pr check-readiness SHALL report a compare answer that holds GitHub's 300-file limit as a possibly truncated file list, naming the limit.
Scenario: Compare answer at the limit
- WHEN The compare endpoint returns exactly 300 files.
- THEN The readiness output names GitHub's 300-file limit and does not report a not-grounded blocker for a change folder missing from that list.
Requirement: Monitor reads pull request state
devops pr monitor SHALL read the pull request state on every poll and stop polling on a closed pull request.
Scenario: Closed during monitoring
- WHEN A poll reads
stateasclosedandmergedasfalse. - THEN The monitor makes no further poll and returns the closed result.
Requirement: Merged result in table output
devops pr monitor SHALL report a merged pull request as merged, with no check count and no READY line, and exit 0.
Scenario: Merged during monitoring
- WHEN A poll reads
mergedastrue. - THEN The output holds
PR #<number> is merged., holds noChecks:line and noREADY FOR MERGING, and the exit code is 0.
Requirement: Closed unmerged result
devops pr monitor SHALL report a closed unmerged pull request as closed, with no check count and no READY line, and exit 2.
Scenario: Closed without merge
- WHEN A poll reads
stateasclosedandmergedasfalse. - THEN The output holds
PR #<number> is closed., holds noChecks:line and noREADY FOR MERGING, and the exit code is 2.
Requirement: Merged result in markdown output
devops pr monitor --format markdown SHALL report a merged pull request as merged and MUST NOT call it ready.
Scenario: Markdown of a merged pull request
- WHEN The monitor's result is a merged pull request and the format is markdown.
- THEN The
**State**line holdsmergedand does not holdReady for Merging.
Requirement: Dry-run plan names the compare endpoint
devops pr check-readiness --dry-run SHALL list the compare request for the file list and MUST NOT list pulls/{number}/files.
Scenario: Request plan of check-readiness
- WHEN The dry-run plan of
devops pr check-readinessis rendered. - THEN The plan holds a request whose target is
repos/{repo}/compare/<base>...<head>and holds no target ending withpulls/<number>/files.
Existing Tool Considered
gidgethub/gidgethub (Apache-2.0, last activity 2026-09-25, maintained) supplies the GitHub REST client that ADR 0006 chooses, and the session already reads the compare endpoint through it (GitHubClient.get_merge_base). It lacks the change to read the compare endpoint's files for the readiness file list instead of the stale pulls files endpoint, the report of a 300-file answer as a possibly truncated list, and the change that makes pr monitor print a merged or closed pull request as such, with no check count and no READY line. The change adds no dependency and no second client.
Key questions
- Does gidgethub cover the need?: Partly. gidgethub is the session's REST client (ADR 0006): the session's
GitHubClientalready readspulls/{number}andcompare/{base}...{head}through it, so both calls the fix needs are available with no new dependency. It does not decide which endpoint the readiness file list comes from, does not turn a 300-file compare answer into a reported truncation, and does not change what the monitor prints for a merged or closed pull request. [sources: docs/adr/0006-github-session-requests-go-through-gidgethub.md:3, src/devops_cli/github/client.py:424, src/devops_cli/github/client.py:456] - Which GitHub endpoint supplies the pull request file list at the merge base?: Use the compare endpoint
GET /repos/{owner}/{repo}/compare/{base}...{head}with the base branch's tip and the head commit, and read itsfiles. The pulls files endpoint keeps the base of the last push, which is the stale list that caused the false blocker. (best practice) [sources: src/devops_cli/github/client.py:456, src/devops_cli/github/merge_readiness.py:571, CHANGELOG.md:2817]- Chosen: Compare endpoint. It follows the current merge base, which is the diff the squash merge uses, and the session already reads it for the merge base (client.py:456).
- Rejected: Pulls files endpoint. It keeps the base of the last push; the issue records 184 files where the compare answer gave 11.
- Rejected: Local git diff. It needs a full checkout of both commits and adds a second source of truth beside the GitHub answer.
- How should the compare endpoint's 300-file limit be handled?: Report it, do not judge on it. When the compare answer holds exactly 300 files, the read carries the reason that GitHub's compare file list is capped at 300 files, and the verdict names that limit where grounding applies instead of reporting a not-grounded blocker from a partial list. The project already recorded this rule: a compare answer that lists GitHub's limit of 300 files is held with a blocker naming the failure. (best practice) [sources: CHANGELOG.md:2817, src/devops_cli/github/client.py:456, src/devops_cli/github/merge_readiness.py:335]
- Chosen: Report the 300-file answer as truncated. The project's record of the compare endpoint treats a 300-file answer as a failure to read, so a partial list never becomes a grounding verdict.
- Rejected: Judge on the 300 files. A change folder beyond the cap would give the same kind of false not-grounded blocker this issue fixes.
- Rejected: Page the compare file list. No source in the repository names a paging parameter for the compare file list; the recorded behaviour is a 300-file limit.
- Rejected: Fall back to pulls files for large pull requests. That is the endpoint whose stale base caused the false blocker.
- How should the compare request name the head commit of a pull request from a fork?: By
owner:branch, built from the head's repository and ref, when the head repository differs from the base repository; by the head commit sha otherwise.CommitRefalready carries the head's repository, sha and ref. (best practice) [sources: src/devops_cli/github/client.py:60, src/devops_cli/github/client.py:456]- Chosen: Owner and branch for a fork head, sha otherwise. The payload's
head.repositoryandhead.refname a head that is not a commit of the base repository, and the same-repository case keeps the precise sha. - Rejected: Always the head sha. A fork's head commit is not a commit of the base repository, so the compare cannot resolve it against the base.
- Chosen: Owner and branch for a fork head, sha otherwise. The payload's
- Is the merged state already handled by the monitor?: Yes, in the monitor and not in the command.
get_pr_monitoring_statusreadsmergedand returns before any check read,monitor_prreturns thePR #<number> is merged.result, but the command printsMESSAGES.pr.pr_ready_successon every exit 0 and the status callback printsChecks: 0/0for the empty check list. That is exactly the 2026-11-11 output:Checks: 0/0 passedand100% READY FOR MERGING. [sources: src/devops_cli/github/pr_monitor.py:534, src/devops_cli/github/pr_monitor.py:539, src/devops_cli/github/pr_monitor.py:573, src/devops_cli/commands/pr.py:771, src/devops_cli/commands/pr.py:800] - Where should the monitor's terminal result come from?: From the monitor's own result. The command prints
result.messageand skips the check-count status line and the READY line for a terminal status, and the markdown state line says merged for a merged result instead ofReady for Merging. (best practice) [sources: src/devops_cli/commands/pr.py:800, src/devops_cli/commands/pr.py:609, src/devops_cli/github/pr_monitor.py:571]- Chosen: Print the result message for a terminal state. The monitor already builds the merged message and exit code; the command throws it away on exit 0.
- Rejected: Keep the READY line and add a merged note. A merged pull request is not ready for merging, so the READY claim stays false.
- Should the merged result name the checks that still run?: No. A merged pull request is terminal, so the poll returns before it reads any check, and the message names the merge only. A check that still runs after the merge cannot change a merged pull request, and the issue asks for no check count and no READY line. (best practice) [sources: src/devops_cli/github/pr_monitor.py:539, src/devops_cli/github/pr_monitor.py:655]
- Chosen: Read no checks and name none. The merged poll already returns before the check read, so the result is one request and the message states the state.
- Rejected: Read and name the running checks. It adds check and status reads to a terminal poll for checks that cannot change the outcome, and it keeps a check count in the merged output.
- What exit code should a closed unmerged pull request return?: Return exit code 2, the monitor's code for a blocker that is not a failed or unread check and not the timeout. A closed unmerged pull request cannot become ready, so it is neither a success (0) nor a check failure (1) nor a timeout (3). (best practice) [sources: src/devops_cli/github/pr_monitor.py:100, src/devops_cli/github/pr_monitor.py:587]
- Chosen: Exit code 2. It matches the existing code for another blocker.
- Rejected: Exit code 0. It would report a closed unmerged pull request as success.
- Rejected: Exit code 1. It would report a check failure that did not occur.
- Rejected: Exit code 3. It would report a timeout that did not occur.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
Two incorrect outputs in pr check-readiness and pr monitor are reported as defects with reproduction steps.A false readiness blocker can delay a merge, and a false READY line misleads a person, but neither breaks the build.Developers who use pr check-readiness and pr monitor get wrong verdicts that block or mislead merge decisions.Two separate code paths need fixes: the file-list source in check-readiness and the merged-state handling in pr monitor.Both touch pr monitor behaviour, but 2443 refactors it to read a shared verdict and wait for checks, while the candidate fixes it to report a merged PR as merged instead of READY.devops-cli-service commentedon Oct 29, 2026
Refine cannot set this item to Ready at 0f7bc26 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
dan-petty commentedon Nov 5, 2026
Evidence from pull request #3496 (issue #3226), which is still a draft.
This matches the squash merge base problem of this issue. The check reads files from the stale base, not from the current main.
devops-cli-service commentedon Nov 5, 2026
Refine cannot set this item to Ready at d254410 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 5, 2026
Refine cannot set this item to Ready at 66a8a63 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
[-]fix(github): pr check-readiness reads the files of the squash merge base, and pr monitor reports a merged pull request as merged[/-][+]fix(github): Fix check-readiness base and monitor merged state[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 115 characters, and the limit is 60. The type and the scope stay.
fix(github): pr check-readiness reads the files of the squash merge base, and pr monitor reports a merged pull request as mergedfix(github): Fix check-readiness base and monitor merged statedevops-cli-service commentedon Nov 7, 2026
Alternatives check: partly
Reason: Every web search I ran failed, so I read the facts of the GitHub client that the project's session already uses (ADR 0006): gidgethub reaches both endpoints the fix needs, the compare endpoint for the merge base and file list and the pull request endpoint for
state/merged. It only supplies the API access; it does not change which endpoint the code reads or how the monitor reports a merged pull request, so it covers a part of the need and the rest stays a code change in the CLI.Tool: gidgethub/gidgethub (https://github.com/gidgethub/gidgethub)
Covers:
stateandmergedLacks:
check-readinessread the file list from the compare endpoint instead of the stale pulls files endpointpr monitorto report a merged or closed pull request as merged or closed, without a check count and without the READY lineTools considered:
Searches run:
Sources:
Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.
34 remaining items
fix(github): Read the pull request state on every monitor poll (#2530)
fix(github): Print a terminal monitor result with no check count (#2530)
fix(github): Plan the compare request in the check-readiness dry run (#…
docs(openspec): archive the change (#2530)
devops-cli-service commentedon Nov 13, 2026
Pull request #4980 is ready for review. The checks passed.
Spend: 258 model requests, 18717634 input tokens, 82719 output tokens.
devops-cli-service commentedon Nov 13, 2026
The runner Job devops-cli-runner-20261112-233112-c39b ended: succeeded.
Image digest: sha256:48c1346d3854aabc64be1705e3205335f2d935136ec26d6d8e1e2858a3ca0a78
The last lines of its log:
devops-cli-service commentedon Nov 13, 2026
Released in v0.126.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.126.0
devops-cli-service commentedon Nov 13, 2026
Live since 2026-11-13 04:03 UTC