Repository navigation
feat(finishingbot): report whether each pull request is ready to merge - #693
Merged
Merged
Conversation
finishing-bot `audit --pr N --pr-repo o/r` now also reads the pull
request from GitHub and adds one advisory analyzer, `pr_readiness`, whose
findings flatten into the fleet report-back like the others:
PRR-001 unresolved review conversations (count, a link to each)
PRR-002 a reviewer whose latest review is CHANGES_REQUESTED
PRR-003 head behind base PRR-004 merge conflict
PRR-005 checks failing PRR-006 checks pending
PRR-007 a required status context (rulesets and classic protection)
that no check run or commit status on the head provides
PRR-008 draft (informational)
The verdict (ready / not ready with reasons / unknown, naming what could
not be read; plus draft and auto-merge) becomes the envelope reason, so
the grid row "finishingbot (release readiness)" states it. It never
changes the exit status and gates nothing.
The logic is pure (`evaluate` over a Snapshot of GitHub response shapes)
and tested on responses recorded 2026-11-17: rsr-template-repo#435
yields exactly PRR-007 for `CI/gate`; standards#1619 yields one PRR-001
with 20 conversations; a clean PR yields no finding; one unresolved
thread yields exactly one. Requests are REST plus GraphQL
reviewThreads { isResolved }, via the crate's existing reqwest and
tokio (no Cargo.toml change).
Driver: --pr/--pr-repo; the token arrives as FLEET_PR_TOKEN, is unset
before any adapter runs and is exported to finishing-bot alone (as
GH_TOKEN, never on a command line); PRR findings are exempt from the
no-path warning because they are change-scoped by design. The reusable
workflow passes the caller's PR number and its read-only token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDj7XpKyxE4WbsgTsTh
…ks run
Dogfooding on this PR (gitbot-fleet#693) showed PRR-007 naming `CI/gate`,
`scan / rust-secrets` and `scan / shell-secrets` as missing while 47
checks were still queued: a job waiting on `needs:`, or a called
workflow's job, has no check run until it starts. Claiming the absence
as settled then would be an overclaim.
PRR-007 is now a warning ("not provided yet", checks still running)
while any check run or status on the head is unfinished, and the error
("every check has finished, so nothing on the pull request produces
them") only once all have. rsr-template-repo#435 (all 54 checks
finished, no `CI/gate`) still yields the error. New unit test covers
both states.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDj7XpKyxE4WbsgTsTh
hyperpolymath
marked this pull request as ready for review
November 17, 2026 17:48
hyperpolymath
enabled auto-merge (squash)
November 17, 2026 20:48
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
hyperpolymath
disabled auto-merge
November 17, 2026 20:59
hyperpolymath
enabled auto-merge (squash)
November 17, 2026 20:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
finishingbot now reports whether each pull request is ready for the owner to review and merge, and the verdict reaches the fleet report-back. The grid row "finishingbot (release readiness)" then states it on every PR without spending Claude credit. Advisory only: it never changes finishing-bot's exit status and gates nothing.
finishing-bot audit --pr N --pr-repo owner/name [--exclude-run-id ID]adds one analyzer,pr_readiness. Each unmet condition is one finding:needs:job has no check run until it starts; seen on this PR itself); error once every check has finishedThe verdict is one of
ready,not readywith reasons, orreadiness unknown, which names any source that could not be read. It also states draft and auto-merge, and it becomes the envelopereason. A PR with an unread source is never reportedready. There is also a standalone command,finishing-bot pr-readiness --repo o/r --pr N(or--snapshot FILE).Why finishingbot's row read "no report-back was received"
The adapter was not the cause. finishingbot already produces an envelope wherever it is enrolled: gitbot-fleet main run 44109280783 shows
finishingbot -> ran (802 finding(s)), and rsr-template-repo fork-governance run 44124672727 showsran (150 finding(s)). The orange row comes from the consumer side, in rsr-template-repoPublish verdict grid. That workflow fires when any of Fork governance, Hypatia or Static Analysis completes. It looks for a completed Fork governance run on the SHA, and when there is none it renders without fleet evidence. On rsr-template-repo#436 (publisher run 44127710882), Fork governance run 44127169826 was stillqueuedwhen the publisher ran. So all three fleet rows (rhodibot, glambot, finishingbot) read "not_run: enrolled, but no report-back was received". The fix belongs in that publisher, not here (see Next).Wiring
scripts/fleet-report-back.shgains--prand--pr-repo, validated as both-or-neither. The token arrives asFLEET_PR_TOKEN. The driver unsets it before any adapter runs and exports it only into finishing-bot's subshell, asGH_TOKEN, never on a command line. PRR findings are exempt from the no-path warning because they are about the change as a whole.fleet-report-back-reusable.ymlpassesgithub.event.pull_request.number,GITHUB_REPOSITORYand the job's token. Permissions are unchanged (contents: read). Nouses:changed, soactions.lockis untouched;scripts/check-lock-sync.shpasses, with output identical to main.reqwest(rustls) andtokioare used. This avoids the files feat(finishingbot,glambot): read the chora deed, not the retired .scm files #689 edits.Evidence (run locally)
cargo test --locked(bots/finishingbot): 84 passed (lib), 84 passed (bin), 37 passed (analyzer_tests), 0 failed. Baseline before this change: 65/65/37.cargo clippy --locked --all-targets -- -D warnings: clean.cargo fmt --check: clean.cargo build --release --locked: ok.bash tests/fleet-report-back-test.sh: 228 passed, 0 failed (baseline 214); build helper: 69 passed, 0 failed. The new section 12 covers argument passing, token isolation (another adapter sees no token), the token never reaching the log, the verdict as the reason, and refusal of bad--prvalues.shellcheck -S warning: only the SC2140 warning that main already has.`CI/gate`(none of its 54 check runs or statuses provides it). standards#1619 → one PRR-001 with 20 conversations, plus PRR-003 (14 behind). Negative controls: a clean PR yields no finding and isready; exactly one unresolved thread yields exactly one finding.finishingbot -> ran (151 finding(s)) [PR #435 not ready: required context(s) not provided: CI/gate; ...].Not verified
reviewThreadswas not run live: GraphQL is blocked from the authoring session, which read it as "could not read". The standards#1619 thread fixture is reconstructed from REST review comments to reproduce the prototype's count of 20, and its_sourcesays so.contents: readGITHUB_TOKENcan read pulls, reviews, check runs, rules and GraphQL threads for public repos has not been observed in Actions yet. This PR's own Fleet report-backs run is the first test.info.Next (outside this repo)
fork-governance.yml. To get the readiness they must pass--pr/--pr-repoandFLEET_PR_TOKENand bump the gitbot-fleet pin.verdict-grid-publish.yml. It should either wait for or re-trigger on the Fork governance completion, or render "fleet evidence pending (run N queued)" instead of "no report-back".https://claude.ai/code/session_01J4QvDj7XpKyxE4WbsgTsTh
Generated by Claude Code