Skip to content

doc: add large pull requests contributing guide#62829

Open
mcollina wants to merge 13 commits intonodejs:mainfrom
mcollina:doc/large-pull-requests
Open

doc: add large pull requests contributing guide#62829
mcollina wants to merge 13 commits intonodejs:mainfrom
mcollina:doc/large-pull-requests

Conversation

@mcollina
Copy link
Copy Markdown
Member

@mcollina mcollina commented Apr 19, 2026

Fixes: #62752

Adds a contributing guide for large pull requests (5000+ lines), covering:

  • Threshold definition and applicability
  • Restriction to collaborators only
  • Design document and review guide requirements
  • Two TSC approvals (same as semver-major)
  • Dependency change separation
  • Feature fork workflow in separate repositories
  • Reviewer guidance

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/tsc

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Apr 19, 2026
Copy link
Copy Markdown
Member

@panva panva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We should link to it from CONTRIBUTING.md, pull-requests.md, collaborator-guide.md (or some subset of those)
  • We should exclude routine dependency/wpt/test bot-issued PRs, this can either be excluded explicitly with additional rules or by changing the classification put forth by the Overview or What qualifies as a large pull request sections
  • dependency changes in a separate commit is at odds with having each commit self-contained, this is fine when the commits get squashed but the first commit's message is used for the squash so the first commit would be the non-deps changes? seems odd and counter-intuitive
  • Design document - I 100% discourage linking outside documents, a detailed PR description should also suffice, 3000 can easily be hit with just thorough test coverage for an otherwise trivial change, how would a design document help such PRs?
  • Both Separating test additions from implementation changes. and Splitting documentation into its own pull request. strategies to avoiding large PRs are contrary to what we usually request of contributions. Those strategies only work when the contribution isn't "done" or "shipped" and is excluded from builds.

- Exclude routine dependency/WPT/bot PRs from the policy
- Replace design document requirement with detailed PR description
- Clarify dependency commit ordering for squash landing
- Remove splitting strategies that contradict self-contained PRs
- Add links from CONTRIBUTING.md, pull-requests.md,
  collaborator-guide.md

Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
@mcollina mcollina force-pushed the doc/large-pull-requests branch from e9d9a4c to 7552c50 Compare April 20, 2026 10:28
Copy link
Copy Markdown
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it. LGTM

Comment thread doc/contributing/large-pull-requests.md
@joyeecheung
Copy link
Copy Markdown
Member

The specification here doesn't seem very clear:

  1. What are 3000 line of changes: deletion and addition combined? Or just one of them? Splitting a flaky test monolith to avoid hiding regressions for example can easily pass the threshold even though there's not really an interesting architecture to explain and 2 TSC review seems like overkill
  2. What happens when a PR initially isn't big but grows to be bigger as more tests/docs are added?

@mcollina
Copy link
Copy Markdown
Member Author

The specification here doesn't seem very clear:

  1. What are 3000 line of changes: deletion and addition combined? Or just one of them? Splitting a flaky test monolith to avoid hiding regressions for example can easily pass the threshold even though there's not really an interesting architecture to explain and 2 TSC review seems like overkill

We have to draw a line, and this is as good as any. I proposed 5k but I was asked to lower it.
We need this to be "easy" to check from the GitHub interface.

I would be happier with a 3k of non-test/non-doc changes, but that would require better tooling, which I'd prefer to avoid creating now.

What would work for you?

  1. What happens when a PR initially isn't big but grows to be bigger as more tests/docs are added?

The number that matters is at landing time.

@ShogunPanda
Copy link
Copy Markdown
Contributor

The specification here doesn't seem very clear:

  1. What are 3000 line of changes: deletion and addition combined? Or just one of them? Splitting a flaky test monolith to avoid hiding regressions for example can easily pass the threshold even though there's not really an interesting architecture to explain and 2 TSC review seems like overkill

In the document it says: A pull request is considered large when it exceeds **3000 lines** of combined additions and deletions..

So ADD + (- DEL) > 3000

  1. What happens when a PR initially isn't big but grows to be bigger as more tests/docs are added?

I would say as soon as it reaches the threshold the new rules apply. This also means that if with further commits the PR shrinks, rules do not apply anymore.
I guess the commit-queue bot must have a rule to ultimately enforce this.

@jasnell
Copy link
Copy Markdown
Member

jasnell commented Apr 22, 2026

FYI, I've added the new large-pr label that we can use to explicitly marge large PRs that would fall under this policy

@jasnell
Copy link
Copy Markdown
Member

jasnell commented Apr 22, 2026

ADD + ( -DEL) > 3000 is more complicated than I think it needs to be. I'd prefer just to look at additions but happy to go with consensus if others agree with the proposed alternative.

@jasnell
Copy link
Copy Markdown
Member

jasnell commented Apr 22, 2026

@nodejs/tsc ... we could use some more TSC scrutiny on this policy change.

Comment thread doc/contributing/large-pull-requests.md
@mcollina mcollina force-pushed the doc/large-pull-requests branch 2 times, most recently from 57506d2 to 104bc61 Compare April 23, 2026 09:06
@ShogunPanda
Copy link
Copy Markdown
Contributor

ADD + ( -DEL) > 3000 is more complicated than I think it needs to be. I'd prefer just to look at additions but happy to go with consensus if others agree with the proposed alternative.

To be honest I don't have strong opinions on this. I just wrote out how I interpreted the rule to make sure we're on the same page.

Thinking about it, my formula above probably would easily trigger this limit. Just making out an example, if I have a JS function which body is 100 lines long and I wrap the entire body inside a if (horrible, but...why not? :)), it already is 2 pure additions and then 100 removed, 100 lines added (because of indentation). We're already at 202. With something like this you often reach 3000.

So either we only count additions or we raised the combined limit.

@mcollina
Copy link
Copy Markdown
Member Author

I've updated it to to be ADDED - DELETED > LIMIT

Comment thread doc/contributing/large-pull-requests.md Outdated
Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina mcollina force-pushed the doc/large-pull-requests branch from 407ac3f to 2d0bc1d Compare April 29, 2026 11:01
Copy link
Copy Markdown
Member

@marco-ippolito marco-ippolito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md
Comment thread doc/contributing/large-pull-requests.md
Comment thread doc/contributing/large-pull-requests.md
Comment thread doc/contributing/large-pull-requests.md
mcollina and others added 7 commits May 6, 2026 06:02
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Comment thread doc/contributing/collaborator-guide.md
Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md
Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md Outdated
Comment thread doc/contributing/large-pull-requests.md Outdated
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
@mcollina
Copy link
Copy Markdown
Member Author

mcollina commented May 8, 2026

PTAL @trivikr @jasnell

Copy link
Copy Markdown
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@trivikr
Copy link
Copy Markdown
Member

trivikr commented May 8, 2026

Linter is failing. Run make format-md?

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

Labels

doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Authoring a large PR" contribution guide