Repository navigation
fix(github): pull requests short of required approvals no longer show as approved - #25725
juliusmarminge wants to merge 3 commits into
Conversation
…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]>
ApprovabilityVerdict: Approved at 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. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review.
|
| 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:
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: 
3 · 
1
-
Failed checks: 1 inconclusiveCheck name Status Explanation Resolution Description check 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 #25717together 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 checks: 3 passed-
Full details: Linked Issues check
-
Explanation
Issue
#25717requires T3 Code to avoid implying full approval when required approvals are incomplete. The decoder now preserves GitHub'sREVIEW_REQUIREDresult when an approval exists, and the regression test verifiesreview-requiredfor that case. The fallback still maps an approval toapprovedwhen 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
#25717together 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.
… as approved (upstream pingdotgg#25725) Cherry-picked from pingdotgg#25725 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 reportsREVIEW_REQUIREDfor that PR, with one APPROVED review, yet the row shows the green "Approved" glyph.Change
toReviewDecisionWithReviewsinpackages/source-control-github/src/server/gitHubPullRequestJson.tsderives a verdict from the latest reviews when GitHub's summary does not settle it. Before this change it also turned an explicitREVIEW_REQUIREDinto "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:
reviewDecision/ latest reviewsREVIEW_REQUIRED/ 1 × APPROVEDnull/ 1 × APPROVEDNot 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