Skip to content

fix(github): pr monitor waits until the checks settle and names every blocker, and pr ready reads the merge-readiness verdict - #2498

Merged
dan-petty merged 3 commits into
mainfrom
refactor/2443-pr-ready-monitor-verdict
Oct 28, 2026
Merged

dan-petty merged 3 commits into
mainfrom
refactor/2443-pr-ready-monitor-verdict

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops pr ready and devops pr monitor (and its alias pr wait) judged a pull request with their own code, apart from the merge-readiness verdict that devops pr check-readiness prints (#2442). The monitor kept its own mergeable, draft, thread and check rules, and it returned on the first failing check while other checks still ran, so a later blocker showed only on a second run. pr ready read its checks through a third path, and when it could not read the pull request it skipped the check read and marked the pull request ready.

  • The verdict keeps each blocker with its kind (BlockerKind) and the check read it made. MergeReadiness.blockers stays the tuple of blocker texts, so check-readiness prints the same lines.
  • pr monitor judges each poll through the verdict and its own review gate (requested changes, Copilot's review, an approval of the head with --require-reviews), which check-readiness does not read. It waits while a check runs or a Copilot review is active, whatever other blockers it sees. Then it names every blocker at once and exits 1 when a check failed or could not be read, 2 for any other blocker, and 3 on its timeout. An unreadable Copilot state is now a blocker reported when the checks settle, not a wait until the timeout.
  • pr ready exits 1 when a check failed or could not be read and 8 while one runs, as before. It prints every other blocker of the verdict as a warning and still marks the pull request ready: ready for review says the checks pass, and the merge stays gated by check-readiness, the required checks and a person. A pull request it cannot read stops it, unless --force is given.
  • A branch that is behind its base blocks in no command: the ruleset of main does not require an up-to-date branch, and GitHub reports blocked where one does.
  • fetch_pr_details in github/pr_monitor.py is the one read of a pull request. _fetch_pr_details in commands/pr.py, PRCheckRun, the monitor's own rules, pr ready's check-verdict rendering, three unused error strings and the readiness tests that patched devops_cli.commands.pr.run_gh are deleted. The readiness tests run over GitHub's two faked edges (github_api_and_gh).

Closes #2443

Change: openspec/changes/archive/2026-10-28-2443-pr-ready-monitor-verdict/

…blocker and its check read

`MergeReadiness.blocking` holds each blocker as a `Blocker(kind, text)`, and
`MergeReadiness.checks` holds the check read of the head commit.
`MergeReadiness.blockers` is the tuple of blocker texts, so
`devops pr check-readiness` prints the same lines. `pr ready` and
`pr monitor` map the kinds to their own exit codes in the next commit.
A branch behind its base blocks nothing.
…rdict

`pr monitor` judges each poll through the merge-readiness verdict and its
own review gate (requested changes, Copilot's review, an approval of the
head with `--require-reviews`). It waits while a check runs, whatever
other blockers it sees, and then names every blocker at once: exit 1 when
a check failed or could not be read, 2 for any other blocker, 3 on the
timeout. Its own mergeable, draft, thread and check rules and
`PRCheckRun` are deleted.

`pr ready` maps the verdict's checks to its exit codes (1 failed or
unread, 8 running) and prints every other blocker as a warning. A pull
request it cannot read stops it, unless `--force` is given.

`fetch_pr_details` in `github/pr_monitor.py` is the one read of a pull
request; `_fetch_pr_details` in `commands/pr.py` is deleted.
@dan-petty

Copy link
Copy Markdown
Owner Author

Test evidence:

  • uv run devops ci fail-to-pass --base origin/main: the new behavior tests fail on base: test_the_monitor_waits_for_the_checks_and_names_every_blocker (the base monitor returned on the failed check and did not name the thread), test_pr_ready_stops_when_the_pull_request_cannot_be_read (the base marked the pull request ready), test_a_missing_priority_label_warns_and_pr_ready_still_marks_it, test_an_unreadable_copilot_state_is_a_blocker_once_the_checks_settle, test_the_monitor_reads_1283s_recorded_copilot_passes[unresolved-thread], and tests/test_merge_readiness.py (no BlockerKind). The other failures on base are the pr update and pr checks tests whose patch target moved from _fetch_pr_details to _shown_pr.
  • On the branch: tests/commands/test_pr.py, tests/test_merge_readiness.py, tests/test_github_pr_monitor.py, tests/test_pr_cmd.py, tests/test_pr_update.py, tests/test_pr_hardening_report.py, tests/test_item_grounding.py, tests/invariants/, tests/test_swallowed_failures_ratchet.py and tests/test_mcp*.py: 463 passed. Ruff, mypy (26 source files) and uv run devops docs check pass.
  • rg -n 'def _?fetch_pr_details' src finds one function: src/devops_cli/github/pr_monitor.py.
  • The full uv run devops ci was not run locally: other agents' gates held the host at a load average near 30. The required checks run the full suite.

Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD).

@dan-petty
dan-petty marked this pull request as ready for review October 28, 2026 18:55
@dan-petty
dan-petty merged commit 43326ea into main Oct 28, 2026
17 checks passed
@dan-petty
dan-petty deleted the refactor/2443-pr-ready-monitor-verdict branch October 28, 2026 18:56
dan-petty pushed a commit that referenced this pull request Oct 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.11.0](v0.10.1...v0.11.0)
(2026-10-28)


### Features

* **monitoring:** the roadmap Service's identity refusals, failing and
stalled jobs, restarts, and GitHub and model request volume raise alerts
([#2496](#2496))
([0137f23](0137f23)),
closes [#2472](#2472)
* **service:** roadmap-service runs at one replica, and each model call
in the cluster is sent at most two times
([#2500](#2500))
([2d32dae](2d32dae)),
closes [#2494](#2494)


### Bug Fixes

* **cli:** every command reports a DevOpsCLIError through one exit seam
([#2502](#2502))
([eadd55f](eadd55f)),
closes [#2487](#2487)
* **github:** pr monitor waits until the checks settle and names every
blocker, and pr ready reads the merge-readiness verdict
([#2498](#2498))
([43326ea](43326ea))
* **k8s:** a pod that does not call the Kubernetes API mounts no service
account token
([#2522](#2522))
([305d3ba](305d3ba))
* **k8s:** the cloudflared tunnel replicas prefer different nodes and
keep one up through a drain
([#2499](#2499))
([d4edaf6](d4edaf6)),
closes [#1023](#1023)
* **k8s:** the grafana, prometheus, argo cd and loki clients dial
through the egress-checked factory, and their pre-flight address checks
go ([#2497](#2497))
([e7ca1d5](e7ca1d5))
* **monitoring:** the roadmap Service alerts count a series that starts
in the hour, and a lane of a new pod can stall
([#2514](#2514))
([c7692b2](c7692b2)),
closes [#2505](#2505)
* **review:** a review's scanners leave out the rules that never gave a
valid finding here
([#2508](#2508))
([fe953ac](fe953ac))
* **roadmap:** a refine round leaves an outside account issue to a
person, and refine neutralizes comment openers, www links and
cross-repository references
([#2507](#2507))
([e6230dc](e6230dc)),
closes [#2478](#2478)
* **sandbox:** the metrics scrape and the whitelist NetworkPolicy
resolve each host one time, through the egress check
([#2521](#2521))
([7c01426](7c01426))
* **security:** the subprocess environment guard refuses the zsh and
interpreter keys that make a child run code
([#2510](#2510))
([459621a](459621a))
* **service:** a restart keeps the halt, the budget window and the
failure ledger, and a rate limit or a suspended installation stops every
worker ([#2515](#2515))
([3630de1](3630de1)),
closes [#2474](#2474)


### Code Refactoring

* **config:** settings resolve in one declared order through
pydantic-settings sources
([#2518](#2518))
([6a5447a](6a5447a)),
closes [#2445](#2445)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(github): pr ready and pr monitor read the merge-readiness verdict, and pr monitor waits until the checks settle and names every blocker

1 participant