Skip to content

feat(pr-review): show existing reviews/approvals on the PR at load - #413

Merged
jrothrock merged 1 commit into
mainfrom
feat/pr-review-status
Sep 11, 2026
Merged

jrothrock merged 1 commit into
mainfrom
feat/pr-review-status

Conversation

@jrothrock

Copy link
Copy Markdown
Collaborator

What

At PR load, show whether someone has already reviewed/approved it — so you don't redo a review that's already done, and you can see if it's close to mergeable.

A compact strip under the action bar shows:

  • Approval tally — X / N approvals, where N is the branch rule's required_approving_review_count (from branch protection). ✓ once it has enough to merge. Falls back to just X approvals when the required count can't be read.
  • Change requests — a red ✗ Changes requested chip when a reviewer is blocking.
  • Who reviewed — per-reviewer state (approved / changes / commented).
  • Comment count — discussion comments on the PR.

Is it lightweight? Yes.

One gh pr view <n> --json reviewDecision,reviews,comments,baseRefName call gives the decision, per-reviewer state, and comment count. A second best-effort gh api repos/<repo>/branches/<base>/protection call gets the required-approval count.

Everything degrades gracefully: a private repo, offline gh, or unreadable branch protection yields {status:null} (or requiredApprovals: 0) and the strip simply doesn't render — it never errors or blocks the page.

Endpoints

  • GET /prs/<id>/review-status (browser) and GET /api/prs/<id>/review-status (conductor, in the OpenAPI spec so it's discoverable). Read-only.

Tests

TestAPIPRReviewStatusRoute (the graceful-null path, no network needed); OpenAPI drift passes; internal/prreview + internal/dashboard build & pass; frontend typechecks + builds.

🤖 Generated with Claude Code

At PR load, surface whether someone has already reviewed it — so you don't
duplicate a review that's already done:

- Approval tally: "X / N approvals" where N is the branch rule's
  required_approving_review_count (from branch protection), or just "X
  approvals" when that count can't be read. "✓" once it has enough to merge.
- Change requests: a red "✗ Changes requested" chip when a reviewer is blocking.
- Who reviewed: per-reviewer state (approved / changes / commented).
- Discussion comment count.

All read live from GitHub in ONE `gh pr view --json reviewDecision,reviews,
comments,baseRefName` call, plus a best-effort branch-protection lookup for the
required count. Read-only and cheap. Everything degrades gracefully: a private
repo / offline gh / unreadable protection yields {status:null} (or 0 required)
and the strip simply doesn't render — never blocks the page.

Backend: prreview.ReviewStatus + GET /prs/<id>/review-status (browser) and
/api/prs/<id>/review-status (conductor, in the OpenAPI spec). Frontend: a
compact ReviewStatusStrip under the action bar.

Tests: TestAPIPRReviewStatusRoute (graceful null path); OpenAPI drift passes;
prreview + dashboard build & pass; frontend typechecks + builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jrothrock
jrothrock merged commit d95d55b into main Sep 11, 2026
1 check passed
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.

1 participant