Skip to content

refactor(github): pr check-readiness reads one merge-readiness verdict from github/ - #2456

Merged
dan-petty merged 3 commits into
mainfrom
refactor/2442-merge-readiness-verdict
Oct 28, 2026
Merged

dan-petty merged 3 commits into
mainfrom
refactor/2442-merge-readiness-verdict

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The merge-readiness rules of devops pr check-readiness lived inside the Typer module commands/pr.py, about 620 lines that printed their own warnings while they decided. No other caller could get the verdict as data, and the readiness tests patched commands.pr.run_gh, imported private names and replaced the GitHub session.

  • github/merge_readiness.py returns the verdict as data: the blockers, the advisories (the warnings and information lines of today), the checks still running, the review threads that block and the grounding facts. It prints nothing and raises no typer.Exit. It reads gh through a runner and the GitHub session through a session that a caller gives, as GitHubRoadmapStore does.
  • roadmap/grounding.py holds the item rules as public pure predicates over the grounding facts, in GROUNDING_RULES.
  • devops pr check-readiness renders the verdict. Its exit codes and its lines do not change; the thread table now prints after the advisories.
  • check_verdict.read_commit_checks replaces the private _fetch_checks_from_rest, and list_pr_review_threads takes an optional runner. _classify_check_run, which no code called, is deleted.
  • The rules are table tests (tests/test_item_grounding.py), the verdict runs over GitHubApiFake and process_fake through the new github_api_and_gh fixture (tests/test_merge_readiness.py), and the command has a table of its exit codes and lines (tests/commands/test_pr.py). The replaced tests, tests/test_pr_check_runs.py and the routed_session fixture are deleted.

This is part 1 of #998. #2443 moves devops pr ready and devops pr monitor onto the verdict.

Closes #2442

Change: openspec/changes/archive/2026-10-28-2442-merge-readiness-verdict/

…t from github/

The merge-readiness rules of `devops pr check-readiness` move out of
the Typer module into `github/merge_readiness.py`, which returns the
verdict as data: the blockers, the advisories, the checks still running,
the review threads that block and the grounding facts. It prints nothing
and raises no `typer.Exit`, and it reads `gh` through a runner and the
GitHub session through a session that a caller gives.

The item rules become public pure predicates in `roadmap/grounding.py`.
The command renders the verdict with the same exit codes and lines.
`read_commit_checks` replaces the private `_fetch_checks_from_rest`, and
`list_pr_review_threads` takes an optional runner.

The readiness tests no longer patch `commands.pr.run_gh` or replace the
GitHub session: the rules are table tests, the verdict runs over
`GitHubApiFake` and `process_fake` through the new `github_api_and_gh`
fixture, and the command has a table of its exit codes and lines.
@dan-petty

Copy link
Copy Markdown
Owner Author

Test evidence:

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

@dan-petty
dan-petty force-pushed the refactor/2442-merge-readiness-verdict branch from e791dbe to f9200bf Compare October 28, 2026 17:09
@dan-petty
dan-petty marked this pull request as ready for review October 28, 2026 17:16
@dan-petty
dan-petty merged commit 16442c4 into main Oct 28, 2026
16 checks passed
@dan-petty
dan-petty deleted the refactor/2442-merge-readiness-verdict branch October 28, 2026 17:17
dan-petty pushed a commit that referenced this pull request Oct 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.10.0](v0.9.0...v0.10.0)
(2026-10-28)


### Features

* **review:** devops review intake hands the findings of a session on
merged code to roadmap intake
([#2455](#2455))
([a5c7b82](a5c7b82))
* **security:** devops k8s audit runs Popeye in the tool sandbox with a
kube-api network profile that only reads the API server
([#2467](#2467))
([e02c3fb](e02c3fb))
* **security:** the App's installation tokens carry only the permissions
the roadmap jobs use
([#2482](#2482))
([9599ef2](9599ef2)),
closes [#2473](#2473)


### Bug Fixes

* **config:** a config file that is not valid YAML stops the load with
an error that quotes none of its text
([#2468](#2468))
([91fe5dc](91fe5dc))
* **config:** config set reports an unknown key as unknown, not as a key
that needs a value
([#2465](#2465))
([8b650a6](8b650a6))
* **devcontainer:** run the checkout's devops in devcontainer terminals
([#2460](#2460))
([abd2d41](abd2d41))
* **k8s:** loki runs from the grafana-community chart on loki 3.7.9, out
of reach of CVE-2026-21729
([#2470](#2470))
([96c50c9](96c50c9))
* **security:** a credential keyword at the end of a line no longer
masks the first word of the next line
([#2461](#2461))
([b754a73](b754a73))
* **security:** a credential value is masked also when the next line
starts with a parenthesis
([#2477](#2477))
([ece25ca](ece25ca)),
closes [#2471](#2471)
* **security:** pin kubeconform and replace Checkov with Trivy's
misconfiguration scan
([#2464](#2464))
([960e357](960e357))
* **security:** refuse GCONV_PATH, SHELLOPTS, BASHOPTS and PS4 from a
caller, and archive the merged security changes
([#2453](#2453))
([1f9231d](1f9231d))


### Code Refactoring

* **ai:** chat_structured is the one structured-output path
([#2452](#2452))
([3509732](3509732))
* **github:** pr check-readiness reads one merge-readiness verdict from
github/ ([#2456](#2456))
([16442c4](16442c4))

---
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 check-readiness reads one merge-readiness verdict from github/, and the item rules are public predicates in roadmap/

1 participant