doc/contributing/large-pull-requests.md
Large pull requests are difficult to review or sometimes impossible to review in the GitHub UI. They are likely to sit for a long time without receiving adequate review, and when they do get reviewed, the quality of that review is often lower due to reviewer fatigue. Contributors should avoid creating large pull requests except in those cases where it is effectively unavoidable, such as when adding new dependencies.
This document outlines the policy for authoring and reviewing large pull requests in the Node.js project.
A pull request is considered large when it exceeds 5000 lines of net
change (lines added minus lines deleted). This threshold applies across all
files in the pull request, including changes in deps/, test/, doc/,
lib/, src/, and tools/.
Any pull request that adds a new subsystem, e.g. node:foo or node:foo/bar,
is automatically considered a large pull request and subject to the same rules.
Changes in deps/ are included in this count. Dependency changes are
sensitive because they often receive less scrutiny than first-party code.
The following categories of pull requests are excluded from this policy, even if they exceed the line threshold:
Large pull requests may only be opened by existing collaborators. Non-collaborators are strongly discouraged from opening pull requests of this size. Large pull requests from non-collaborators will be closed unless it has been discussed in an issue and has a collaborator to champion the work.
All large pull requests must satisfy the following requirements in addition to the standard pull request requirements.
The pull request description must provide sufficient context for reviewers to understand the change. The description should explain:
A thorough pull request description is sufficient. There is no requirement to produce a separate design document, although contributors may choose to link to a GitHub issue or other discussion where the design was developed.
The pull request description must include a review guide that helps reviewers navigate the change. The review guide should:
Large pull requests follow the same approval path as semver-major changes:
When a large pull request adds or modifies a dependency in deps/:
git log clearly reflects the
overall change.Contributors should always consider whether a large pull request can be split into smaller, independently reviewable pull requests. Strategies include:
Each pull request in a split series should remain self-contained: it should include the implementation, tests, and documentation needed for that piece to stand on its own.
Large pull requests may involve a longer review process that becomes practically impossible to track on GitHub due to UI limitations. These strategies help reduce the review length in a single pull request.
dont-land-* labels to avoid releasing the initial changes until it has been more
thoroughly tested and iterated in follow-up pull requests.For extremely large or complex changes that develop over time, such as adding a major new subsystem, contributors should consider using a feature fork. This approach has been used successfully in the past for subsystems like QUIC.
The feature fork must be hosted in a separate GitHub repository, managed
by the collaborator championing the change. The repository can live in the
nodejs organization or be a personal repository
of the champion. The champion is responsible for coordinating development,
managing access, and ensuring the fork stays up to date with main.
A feature fork allows:
When the work is ready, the final merge into main via a pull request still
requires the same approval and review requirements as any other large pull
request.
Reviewing a large pull request is a significant time investment. Reviewers should:
lib/ and src/ changes, which have the highest
impact on the runtime. test/ and doc/ changes, while important, are
lower risk.