Skip to content

Commit dc1a570

Browse files
committed
Merge remote-tracking branch 'origin/doc/large-pull-requests' into doc/large-pull-requests
2 parents 7552c50 + 5284244 commit dc1a570

3 files changed

Lines changed: 55 additions & 29 deletions

File tree

doc/contributing/collaborator-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Pay special attention to pull requests for dependencies which have not
132132
been automatically generated and follow the guidance in
133133
[Maintaining Dependencies](https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-dependencies.md#updating-dependencies).
134134

135-
Pull requests that exceed 3000 lines of changes have additional requirements.
135+
Pull requests that exceed 5000 lines of changes have additional requirements.
136136
See the [large pull requests][] guide.
137137

138138
In some cases, it might be necessary to summon a GitHub team to a pull request

doc/contributing/large-pull-requests.md

Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,26 @@
1414

1515
## Overview
1616

17-
Large pull requests are difficult to review thoroughly. They are likely to sit
18-
for a long time without receiving adequate review, and when they do get reviewed,
19-
the quality of that review is often lower due to reviewer fatigue. Contributors
20-
should avoid creating large pull requests except in those cases where it is
21-
effectively unavoidable, such as when adding a major new subsystem.
17+
Large pull requests are difficult to review and can be impossible to review in
18+
the GitHub UI. They are likely to sit for a long time without receiving
19+
adequate review, and when they do get reviewed, the quality of that review is
20+
often lower due to reviewer fatigue. Contributors should avoid creating large
21+
pull requests except in those cases where it is effectively unavoidable, such
22+
as when adding a major new subsystem.
2223

2324
This document outlines the policy for authoring and reviewing large pull
2425
requests in the Node.js project.
2526

2627
## What qualifies as a large pull request
2728

28-
A pull request is considered large when it exceeds **3000 lines** of combined
29-
additions and deletions. This threshold applies across all files in the pull
30-
request, including changes in `deps/`, `test/`, `doc/`, `lib/`, `src/`, and
31-
`tools/`.
29+
A pull request is considered large when it exceeds **5000 lines** of net
30+
change (lines added minus lines deleted). This threshold applies across all
31+
files in the pull request, including changes in `deps/`, `test/`, `doc/`,
32+
`lib/`, `src/`, and `tools/`.
33+
34+
Any pull request that adds a new subsystem, e.g. `node:foo` or
35+
`node:foo/bar`, is automatically considered a large pull request and subject
36+
to the same rules.
3237

3338
Changes in `deps/` are included in this count. Dependency changes are
3439
sensitive because they often receive less scrutiny than first-party code.
@@ -42,6 +47,7 @@ even if they exceed the line threshold:
4247
* Web Platform Tests (WPT) imports and updates.
4348
* Other bot-issued or automated pull requests (e.g., license updates, test
4449
fixture regeneration).
50+
* Test-only refactoring that involves no functional changes.
4551

4652
These pull requests already have established review processes and do not
4753
benefit from the additional requirements described here.
@@ -51,9 +57,9 @@ benefit from the additional requirements described here.
5157
Large pull requests may only be opened by existing
5258
[collaborators](https://github.com/nodejs/node/#current-project-team-members).
5359
Non-collaborators are strongly discouraged from opening pull requests of this
54-
size. Collaborators should close large pull requests from non-collaborators and
55-
direct the author to discuss the proposed changes in an issue first, and to
56-
find a collaborator to champion the work.
60+
size. Collaborators should close large pull requests from non-collaborators
61+
unless the proposed change has been discussed in an issue first and a
62+
collaborator has agreed to champion the work.
5763

5864
## Requirements
5965

@@ -62,17 +68,17 @@ the standard [pull request requirements](./pull-requests.md).
6268

6369
### Detailed pull request description
6470

65-
The pull request description must provide sufficient context for reviewers
66-
to understand the change. The description should explain:
71+
The pull request description must provide sufficient context for reviewers to
72+
understand the change. The description should explain:
6773

6874
* The motivation for the change.
6975
* The high-level approach and architecture.
7076
* Any alternatives that were considered and why they were rejected.
7177
* How the change interacts with existing subsystems.
7278

73-
A thorough pull request description is sufficient. There is no requirement
74-
to produce a separate design document, although contributors may choose to
75-
link to a GitHub issue or other discussion where the design was developed.
79+
A thorough pull request description is sufficient. There is no requirement to
80+
produce a separate design document, although contributors may choose to link
81+
to a GitHub issue or other discussion where the design was developed.
7682

7783
### Review guide
7884

@@ -82,8 +88,8 @@ navigate the change. The review guide should:
8288
* Identify the key files and directories to review.
8389
* Describe the order in which files should be reviewed.
8490
* Highlight the most critical sections that need careful attention.
85-
* Include a testing plan explaining how the change has been validated and
86-
how reviewers can verify the behavior.
91+
* Include a testing plan explaining how the change has been validated and how
92+
reviewers can verify the behavior.
8793

8894
### Approval requirements
8995

@@ -102,11 +108,11 @@ When a large pull request adds or modifies a dependency in `deps/`:
102108
pull request. This makes it easier to review the dependency update
103109
independently from the first-party code changes. When the pull request is
104110
squashed on landing, the dependency commit should be the one that carries
105-
the squashed commit message, so that `git log` clearly reflects the
106-
overall change.
107-
* The provenance and integrity of the dependency must be verifiable.
108-
Include documentation of how the dependency was obtained and how
109-
reviewers can reproduce the build artifact.
111+
the squashed commit message, so that `git log` clearly reflects the overall
112+
change.
113+
* The provenance and integrity of the dependency must be verifiable. Include
114+
documentation of how the dependency was obtained and how reviewers can
115+
reproduce the build artifact.
110116

111117
## Splitting large pull requests
112118

@@ -117,8 +123,27 @@ into smaller, independently reviewable pieces. Strategies include:
117123
* Landing refactoring or preparatory changes before the main feature.
118124

119125
Each pull request in a split series should remain self-contained: it should
120-
include the implementation, tests, and documentation needed for that piece
121-
to stand on its own.
126+
include the implementation, tests, and documentation needed for that piece to
127+
stand on its own.
128+
129+
### Strategies for reducing review length in a single pull request
130+
131+
Large pull requests may involve a longer review process that becomes
132+
practically impossible to track on GitHub due to UI limitations. These
133+
strategies help reduce the review length in a single pull request.
134+
135+
* Open an issue first to confirm that a substantial change is indeed desired
136+
in core, reducing lengthy discussions unrelated to the implementation in the
137+
pull request.
138+
* Use proposal issues, RFCs, design documents, or other venues to explore
139+
high-level design and cross-cutting concerns.
140+
* Keep the initial change provisional to reduce the thoroughness required in a
141+
single pull request. Gate premature changes behind build or runtime flags,
142+
or apply `dont-land-*` labels to avoid releasing the initial changes until
143+
they have been more thoroughly tested and iterated in follow-up pull
144+
requests.
145+
* Leave non-blocking issues (e.g. stylistic preferences) to follow-up pull
146+
requests, with a TODO comment in appropriate places.
122147

123148
### Feature forks and branches
124149

@@ -155,4 +180,5 @@ should:
155180
lower risk.
156181
* Not hesitate to request that the author split the pull request if it can
157182
reasonably be broken into smaller pieces.
158-
* Coordinate with other reviewers to divide the review workload when possible.
183+
* Coordinate with other reviewers to divide the review workload when
184+
possible.

doc/contributing/pull-requests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ From within GitHub, opening a new pull request will present you with a
289289
[pull request template][]. Please try to do your best at filling out the
290290
details, but feel free to skip parts if you're not sure what to put.
291291

292-
If your pull request exceeds 3000 lines of changes, see the
292+
If your pull request exceeds 5000 lines of changes, see the
293293
[large pull requests][] guide for additional requirements.
294294

295295
Once opened, pull requests are usually reviewed within a few days.

0 commit comments

Comments
 (0)