feat: check large pull request approvals in git node land - #1173
Open
zeexzeex wants to merge 1 commit into
Open
Conversation
Node.js requires two TSC approvals for pull requests over 5000 lines of net change, but nothing enforces it at land time. Report a pull request that exceeds the threshold and does not carry two TSC approvals. semver-major pull requests are already held to the same requirement, so they are left to the existing check. The policy also exempts routine dependency updates, WPT imports, bot-issued pull requests and test-only refactors. Whether a change is routine or functional is not something this can decide from the pull request data, so it only skips the categories a label identifies on its own, meaning `dependencies` and `release`. A release proposal is the case that matters most here, since those run to hundreds of thousands of lines and blocking one would stall a release. Missing line counts leave the check inactive rather than treating the pull request as small, so a query that predates the new fields does not silently pass a large pull request through. Refs: https://github.com/nodejs/node/blob/main/doc/contributing/large-pull-requests.md Refs: nodejs#1063 Signed-off-by: Avocado <ujubongbong@gmail.com>
zeexzeex
force-pushed
the
feat/large-pr-checks
branch
from
August 31, 2026 07:00
2149ab7 to
f8afeef
Compare
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.
Node.js requires two TSC approvals for pull requests over 5000 lines of net change, but nothing enforces it at land time. This adds that check to
git node land.A pull request over the threshold that does not carry two TSC approvals is now reported and blocked.
The check is separate from the existing semver-major one rather than folded into it. The two happen to share an approval requirement today, but they are different rules: they need distinct messages and reason codes so a failure tells the author what to actually do, the reason payload carries a line count that means nothing for semver-major, and the exemptions below apply only to the size rule. A semver-major pull request is skipped here so the two never fire at once.
The policy also exempts routine dependency updates, WPT imports, bot-issued pull requests and test-only refactors. Whether a change is routine or functional is not something this can decide from the pull request data, so it only skips the categories a label identifies on its own, meaning
dependenciesandrelease. Everything else is reported rather than silently allowed, and a reviewer can still tell an exempt pull request apart.releasematters more than it looks. Release proposals run to hundreds of thousands of lines, and blocking one would stall a release.checkReviewsAndWait()does take anisReleaseProposalargument, but it is only passed frompromote_release.js; on thegit node landpath it isundefined, so the label is what identifies them here.Missing line counts leave the check inactive rather than treating the pull request as small, so a query made before
additions/deletionswere added toPR.gqldoes not silently pass a large pull request through.I ran the check against the last 500 merged pull requests in
nodejs/node. Four were exempt, all of them release proposals. Two were reported: nodejs/node#64339 (zlib ZIP support, +9679) and nodejs/node#63696 (Windows PGO workload scripts, +5643). Both are the kind of pull request the policy targets.Refs: https://github.com/nodejs/node/blob/main/doc/contributing/large-pull-requests.md
Fixes: #1063