Skip to content

fix(github): pull requests short of required approvals no longer show as approved - #25725

Open
juliusmarminge wants to merge 3 commits into
mainfrom
fix/issue-25717
Open

juliusmarminge wants to merge 3 commits into
mainfrom
fix/issue-25717

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Problem

When a branch needs more approvals than a PR has, GitHub reports reviewDecision: REVIEW_REQUIRED. T3 Code still showed the PR as "Approved" if any one latest review was an approval. To reproduce on main (becf853), link nodejs/node#67028 to a thread and open the thread's Pull requests panel. GitHub reports REVIEW_REQUIRED for that PR, with one APPROVED review, yet the row shows the green "Approved" glyph.

Change

toReviewDecisionWithReviews in packages/source-control-github/src/server/gitHubPullRequestJson.ts derives a verdict from the latest reviews when GitHub's summary does not settle it. Before this change it also turned an explicit REVIEW_REQUIRED into "approved". Now an approving review produces "approved" only when GitHub reported no decision at all, which is the case the fallback exists for (for example a bot approval on a branch without review rules). A PR that is short of its required approvals stays "review-required", shown as "Awaiting review". This also covers an approval GitHub does not count toward a review rule, such as one from an app or from a user without write access: it now reads "Awaiting review", which matches GitHub's own status. A changes-requested review still shows as "Changes requested", as before. The list and the linked-PR summary both decode through this function, so the thread panel, the Pull requests page and mobile all pick up the fix.

Scope and approval

Fixes #25717

Verification

  • vp test run packages/source-control-github/src/server/gitHubPullRequestJson.test.ts: the new test "keeps review required when an approval falls short of the branch's required count" fails on main (expected [ 'approved' ] to deeply equal [ 'review-required' ]) and passes with the fix. The other 50 tests pass, including the existing case where a bot approval with no GitHub decision still reads "approved".

  • vp run check:changed: format, lint, knip, graphql, typecheck (11 packages) and tests pass.

  • Real web app, dev server on a fresh database, both PRs linked to one thread through "Link pull request to thread", then "Show linked pull requests". GitHub values read live via GraphQL:

    PR GitHub reviewDecision / latest reviews Row label on main (becf853) Row label with fix (dcbaace)
    nodejs/node#67028 REVIEW_REQUIRED / 1 × APPROVED Approved (green) Awaiting review (muted)
    juliusmarminge/turbo-respect-pnpm-configs#1 (control, no review rule) null / 1 × APPROVED Approved Approved
  • Not checked: before/after screenshots are not attached. The table above records the row labels read from the rendered panel on each side. Mobile was not run; it renders the same server-decoded value.

Model and harness: Claude Opus 5.5 (issue lead, tests, implementation) with GPT-6.1-sol reviews, via Claude Code in T3 Code.

🤖 Generated with Claude Code

juliusmarminge and others added 3 commits October 27, 2026 01:50
…s approved

These tests reproduce #25717: a PR whose branch rule still needs more
approvals (reviewDecision REVIEW_REQUIRED) with one APPROVED latest review
decodes as "approved" instead of "review-required".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… as approved

GitHub reports REVIEW_REQUIRED when a PR has fewer approvals than its
branch rules require, but one APPROVED latest review upgraded it to
approved. Derive approval from latest reviews only when GitHub reports
no verdict at all, as for a bot's approval on an unprotected branch.

Fixes #25717

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 27, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 0402298

Macroscope's review found this PR approvable — This narrowly scoped fix prevents an individual approval from making a pull request appear approved when GitHub reports that required branch approvals are still missing. A focused regression test covers the behavior, with no product-default or static-analysis configuration changes.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB −7 B (−0.1%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB −7 B (−0.6%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: daa720a · PR result: 0402298 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between daa720a and 0402298.

Files selected for processing: 2
  • packages/source-control-github/src/server/gitHubPullRequestJson.test.ts
  • packages/source-control-github/src/server/gitHubPullRequestJson.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The decoder now uses an approved latest review as a fallback only when GitHub’s summarized review decision is null. A regression test verifies that REVIEW_REQUIRED remains review-required when the latest review is approved.

Changes: Review decision decoding

Layer / File(s) Summary
Review decision fallback and regression test
packages/source-control-github/src/server/gitHubPullRequestJson.ts, packages/source-control-github/src/server/gitHubPullRequestJson.test.ts
An approved latest review sets the decoded decision to approved only when the summarized decision is null. The test checks that a summarized REVIEW_REQUIRED decision remains review-required.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: maria-rcks

Merge Risk: Minimal · up to 04022

The change correctly preserves required-review status, with no actionable merge risk established.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description follows the repository template closely. It has a clear Problem section with a reproduction path and environment (main at becf853, a nodejs/node PR linked to a thread). The Change s… Add a link to the triaged issue #25717 together with the maintainer approval comment or discussion that approved the direction and scope, or explain why the fix qualifies as a very small, focused bug fix without prior approval. Because this…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the fix: pull requests with insufficient required approvals no longer appear approved.
Linked Issues check Passed Issue #25717 requires T3 Code to avoid implying full approval when required approvals are incomplete. The decoder now preserves GitHub's REVIEW_REQUIRED result when an approval exists, and the regre…
Out of Scope Changes check Passed The pull request changes only the shared review-decision decoder and its focused regression test. These changes directly address required-review display behavior. The diff does not add changes for che…
Full details: Linked Issues check

Explanation

Issue #25717 requires T3 Code to avoid implying full approval when required approvals are incomplete. The decoder now preserves GitHub's REVIEW_REQUIRED result when an approval exists, and the regression test verifies review-required for that case. The fallback still maps an approval to approved when GitHub reports no decision. This meets the issue's equivalent-status requirement without requiring an approval count.

Full details: Out of Scope Changes check

Explanation

The pull request changes only the shared review-decision decoder and its focused regression test. These changes directly address required-review display behavior. The diff does not add changes for checks, merge queues, or unrelated functionality.

Full details: Description check

Explanation

The description follows the repository template closely. It has a clear Problem section with a reproduction path and environment (main at becf853, a nodejs/node PR linked to a thread). The Change section explains the fix in toReviewDecisionWithReviews and why the shared decoder reaches the thread panel, Pull requests page, and mobile. The Scope and approval section links the issue (#25717) but does not link a maintainer approval comment or discussion. It only gives a bare issue reference, so the template's approval requirement is not clearly met. The Verification section is strong: it names the focused test and its fail-then-pass result, the full check run, and a live before/after table of row labels. It also states what was not checked (screenshots, mobile). Remaining gaps: no explicit maintainer approval link or comment, and no before/after screenshots, which the template requires for UI changes. The author did note screenshots were not attached and that the table records rendered labels instead.

Resolution

Add a link to the triaged issue #25717 together with the maintainer approval comment or discussion that approved the direction and scope, or explain why the fix qualifies as a very small, focused bug fix without prior approval. Because this changes a user-visible UI label, attach before/after screenshots of the thread panel row (main versus fix) and embed or link them in the Verification section. Mobile was not run, so either run it or keep the note that it was not checked.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

GigaZoro pushed a commit to GigaZoro/CodeShip that referenced this pull request Oct 30, 2026
… as approved (upstream pingdotgg#25725)

Cherry-picked from pingdotgg#25725

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge juliusmarminge added bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed labels Oct 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR section shows “Approved” before the required number of approvals is reached

1 participant