Repository navigation
feat: add prw checks to list every check of a PR - #20
Conversation
`prw run` now also tells you when a watched PR is approved, gets changes
requested, runs into merge conflicts, or becomes ready to merge after branch
protection, conflicts or an outdated branch were holding it back.
- Review decision from /pulls/{n}/reviews: each reviewer's latest approval or
change request counts, comments don't, dismissals withdraw it. One extra
request per PR per poll, a free 304 when nothing changed.
- Merge state from the PR's mergeable_state (already fetched); "unknown" while
GitHub computes it keeps the last value.
- Quiet by design: nothing on the first check of a PR; "ready" is not sent
with the CI or approval notification that caused it, nor for repositories
without branch protection (unstable -> clean is just CI passing).
- Events carry a Kind; console, native, Slack/Discord ("Review:" / "Merge:")
and generic webhooks ("pr_review_change" / "pr_merge_state_change") render
them. --on fail keeps changes_requested and conflict, --on success approved
and ready.
- `prw list` gains REVIEW and MERGE columns (review/merge in --json and MCP
list_watched); `prw wait --json` and the MCP tools report merge_state.
- `prw config set pr_events false` turns it off.
Verified live: #12 ready, cli/cli#14727 blocked; a simulated
blocked -> ready notified once, ready -> blocked stayed silent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviews come oldest first, so the 3-page cap dropped the newest approvals, change requests and dismissals on PRs with more than 300 reviews, and the review state stayed stale. Pagination now runs to the last page, with a 100-page cap only as a runaway guard. Addresses Codex review on #19. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`prw checks <PR_URL>` shows each check run and commit status of the PR's head commit with its result, how long it took and a link: failures first, then cancelled and running ones, then passed, neutral and skipped. Superseded runs of the same check are left out, as they don't count towards the result. The header has the short SHA, overall state, counts per bucket and merge state. `--json` prints the same as an object with a `checks` array. Exit codes match `prw wait` (0 passed, 1 failed, 3 error, 4 no CI), plus 8 while checks are still running, like `gh pr checks`. Verified live on devblac/docker-lint#5, zephyrproject-rtos/zephyr#105183 (35 checks; the cancelled run superseded by a newer one is hidden) and #13. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d6f230797
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case "success", "merged", "closed": | ||
| return nil |
There was a problem hiding this comment.
Return an error for PRs closed without merging
When a PR is closed without merging, fetchChecks replaces its CI result with "closed", and this branch then exits successfully—even if the listed checks failed or never ran. This contradicts the documented promise that exit codes match prw wait, whose waitResult.exitErr returns code 3 for this situation, and lets scripts using prw checks "$PR_URL" && ... proceed on an abandoned PR. Handle "closed" separately and return exitWaitError instead of success.
Useful? React with 👍 / 👎.
It exited 0, so `prw checks "$PR" && ...` went ahead on an abandoned PR, and the exit codes didn't match `prw wait` as documented. Addresses Codex review on #20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit only updated the README; this is the code change: a PR closed without merging now exits 3 (like `prw wait`) instead of 0. Addresses Codex review on #20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Roadmap #12.
prw checks <PR_URL>shows every check run and commit status of the PR's head commit with its result, duration and link — failures first.fail,cancel,pending,pass,neutral,skipping(classified like the overall CI state).github.LatestCheckRuns, now exported).CheckRungainsstarted_at/completed_atfor durations (running checks show elapsed time with…).--json: object withchecks: [{name, bucket, state, kind, url, started_at, completed_at}], plus overallstateandmerge_state.prw wait(0 / 1 / 3 / 4) plus8while running, likegh pr checks.Test plan
go test ./... -race,go vet ./...--jsonwith no checksprw waitto block until CI finishes (exit 0/1/2/3) #13 (--json)Stacked on #19.
🤖 Generated with Claude Code