Always show courtesy to individuals submitting issues and pull requests. Be welcoming to first-time contributors, identified by the GitHub badge.
For first-time contributors, check if the commit author is the same as the pull request author. This way, once their pull request lands, GitHub will show them as a Contributor. Ask if they have configured their git username and email to their liking.
Collaborators may close any issue or pull request that is not relevant to the future of the Node.js project. Where this is unclear, leave the issue or pull request open for several days to allow for discussion. Where this does not yield evidence that the issue or pull request has relevance, close it. Remember that issues and pull requests can always be re-opened if necessary.
A pull request is author ready when:
Please always add the
author ready label to the pull request in that case. Please always remove it again as soon as the conditions are not met anymore.
When you open a pull request, start a CI right away and post the link to it in a comment in the pull request. Later, after new code changes or rebasing, start a new CI.
As soon as the pull request is ready to land, please do so. This allows other Collaborators to focus on other pull requests. If your pull request is not ready to land but is author ready, add the
author ready label. If you wish to land the pull request yourself, use the “assign yourself” link to self-assign it.
Contributors propose modifications to Node.js using GitHub pull requests. This includes modifications proposed by TSC members and other Collaborators. A pull request must pass code review and CI before landing into the codebase.
At least two Collaborators must approve a pull request before the pull request lands. One Collaborator approval is enough if the pull request has been open for more than seven days.
Approving a pull request indicates that the Collaborator accepts responsibility for the change.
Approval must be from Collaborators who are not authors of the change.
In some cases, it may be necessary to summon a GitHub team to a pull request for review by @-mention. See Who to CC in the issue tracker.
If you are the first Collaborator to approve a pull request that has no CI yet, please start one. Post the link to the CI in the PR. Please also start a new CI if the PR creator pushed new code since the last CI run.
If there are no objecting Collaborators, a pull request may land if it has the needed approvals, CI, and wait time. If a pull request meets all requirements except the wait time, please add the
author ready label.
Where there is disagreement among Collaborators, consensus should be sought if possible. If reaching consensus is not possible, a Collaborator may escalate the issue to the TSC.
Collaborators should not block a pull request without providing a reason. Another Collaborator may ask an objecting Collaborator to explain their objection. If the objector is unresponsive, another Collaborator may dismiss the objection.
Breaking changes must receive TSC review. If two TSC members approve the pull request and no Collaborators object, then it may land. If there are objections, a Collaborator may apply the
tsc-agenda label. That will put the pull request on the TSC meeting agenda.
Before landing pull requests, allow 48 hours for input from other Collaborators. Certain types of pull requests can be fast-tracked and may land after a shorter delay. For example:
code-and-learntasks often fall into this category.
good-first-issuepull requests may also be suitable.
To propose fast-tracking a pull request, apply the
fast-track label. Then add a comment that Collaborators may upvote.
If someone disagrees with the fast-tracking request, remove the label. Do not fast-track the pull request in that case.
The pull request may be fast-tracked if two Collaborators approve the fast-tracking request. To land, the pull request itself still needs two Collaborator approvals and a passing CI.
Collaborators may request fast-tracking of pull requests they did not author. In that case only, the request itself is also one fast-track approval. Upvote the comment anyway to avoid any doubt.
All fixes must have a test case which demonstrates the defect. The test should fail before the change, and pass after the change.
All pull requests must pass continuous integration tests on the project CI server.
Do not land any pull requests without passing (green or yellow) CI runs. If there are CI failures unrelated to the change in the pull request, try “Resume Build”. It is in the left navigation of the relevant
node-test-pull-request job. It will preserve all the green results from the current job but re-run everything else.
node-test-pull-request is the CI job to test pull requests. It runs the
test-ci targets on all supported platforms.
node-test-pull-request-lite-pipeline runs the linter job. It also runs the tests on a very fast host. This is useful for changes that only affect comments or documentation.
CitGM to allow you to run
npm install && npm test on a large selection of common modules. This is useful to check whether a change will cause breakage in the ecosystem. To test Node.js ABI changes you can run
node-stress-single-test can run a group of tests over and over on a specific platform. Use it to check that the tests are reliable.
node-test-commit-v8-linux runs the standard V8 tests. Run it when updating V8 in Node.js or floating new patches on V8.
node-test-commit-custom-suites enables customization of test suites and parameters. It can execute test suites not used in other CI test runs (such as tests in the
pummel directories). It can also make sure tests pass when provided with a flag not used in other CI test runs (such as
All functionality in the official Node.js documentation is part of the public API. Any undocumented object, property, method, argument, behavior, or event is internal. There are exceptions to this rule. Node.js users have come to rely on some undocumented behaviors. Collaborators treat many of those undocumented behaviors as public.
All undocumented functionality exposed via
process.binding(...) is internal.
All undocumented functionality in
lib/internal/**/*.js is internal. It is public, though, if it is re-exported by code in
Symbol properties and methods are internal.
Any undocumented object property or method that begins with
_ is internal.
Any native C/C++ APIs/ABIs requiring the
NODE_WANT_INTERNALS flag are internal.
Sometimes, there is disagreement about whether functionality is internal or public. In those cases, the TSC makes a determination.
For undocumented APIs that are public, open a pull request documenting the API.
At least two TSC members must approve backward-incompatible changes to the master branch.
Examples of breaking changes include:
Existing stable public APIs that change in a backward-incompatible way must undergo deprecation. The exceptions to this rule are:
For more information, see Deprecations.
Breaking changes to internal elements may occur in semver-patch or semver-minor commits. Take significant care when making and reviewing such changes. Make an effort to determine the potential impact of the change in the ecosystem. Use Canary in the Goldmine to test such changes. If a change will cause ecosystem breakage, then it is semver-major. Consider providing a Public API in such cases.
Sometimes, a change intended to be non-breaking turns out to be a breaking change. If such a change lands on the master branch, a Collaborator may revert it. As an alternative to reverting, the TSC may apply the semver-major label after-the-fact.
Revert commits with
git revert <HASH> or
git revert <FROM>..<TO>. The generated commit message will not have a subsystem and may violate line length rules. That is OK. Append the reason for the revert and any
Fixes metadata. Raise a Pull Request like any other change.
Treat commits that introduce new core modules with extra care.
Check if the module's name conflicts with an existing ecosystem module. If it does, choose a different name unless the module owner has agreed in writing to transfer it.
If the new module name is free, register a placeholder in the module registry as soon as possible. Link to the pull request that introduces the new core module in the placeholder's
For pull requests introducing new core modules:
N-API provides an ABI-stable API guaranteed for future Node.js versions. N-API additions call for unusual care and scrutiny. If a change adds to
node_api_types.h, consult the relevant guide.
Node.js uses three Deprecation levels. For all deprecated APIs, the API documentation must state the deprecation status.
--throw-deprecationflag, will throw a runtime error.
notable change label to all pull requests that introduce Documentation-Only Deprecations. Such deprecations have no impact on code execution. Thus, they are not breaking changes (
Runtime Deprecations and End-of-Life APIs (internal or public) are breaking changes (
semver-major). The TSC may make exceptions, deciding that one of these deprecations is not a breaking change.
All deprecations receive a unique and immutable identifier. Documentation, warnings, and errors use the identifier when referring to the deprecation. The documentation for the deprecation identifier must always remain in the API documentation. This is true even if the deprecation is no longer in use (for example, due to removal of an End-of-Life deprecated API).
A deprecation cycle is a major release during which an API has been in one of the three Deprecation levels. Documentation-Only Deprecations may land in a minor release. They may not change to a Runtime Deprecation until the next major release.
No API can change to End-of-Life without going through a Runtime Deprecation cycle. There is no rule that deprecated code must progress to End-of-Life. Documentation-Only and Runtime Deprecations may remain in place for an unlimited duration.
Communicate pending deprecations and associated mitigations with the ecosystem as soon as possible. If possible, do it before the pull request adding the deprecation lands on the master branch.
notable-change label on pull requests that add or change the deprecation level of an API.
Collaborators may opt to elevate pull requests or issues to the TSC. Do this if a pull request or issue:
@nodejs/tsc GitHub team if you want to elevate an issue to the TSC. Do not use the GitHub UI on the right-hand side to assign to
@nodejs/tsc or request a review from
The TSC should serve as the final arbiter where required.
For pull requests from first-time contributors, be welcoming. Also, verify that their git settings are to their liking.
All commits should be self-contained, meaning every commit should pass all tests. This makes it much easier when bisecting to find a breaking change.
$ npm install -g node-core-utils $ git node land $PRID
node-core-utils, you will need a GitHub access token. If you do not have one,
node-core-utils will create one for you the first time you use it. To do this, it will ask for your GitHub password and two-factor authentication code. If you wish to create the token yourself in advance, see the
rebase that may already be underway:
$ git am --abort $ git rebase --abort
Checkout proper target branch:
$ git checkout master
Update the tree (assumes your repo is set up as detailed in CONTRIBUTING.md):
$ git fetch upstream $ git merge --ff-only upstream/master
Apply external patches:
$ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am --whitespace=fix
If the merge fails even though recent CI runs were successful, then a 3-way merge may be required. In this case try:
$ git am --abort $ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am -3 --whitespace=fix
If the 3-way merge succeeds you can proceed, but make sure to check the changes against the original PR carefully and build/test on at least one platform before landing. If the 3-way merge fails, then it is most likely that a conflicting PR has landed since the CI run and you will have to ask the author to rebase.
Check and re-review the changes:
$ git diff upstream/master
Check the number of commits and commit messages:
$ git log upstream/master...master
Squash commits and add metadata:
$ git rebase -i upstream/master
This will open a screen like this (in the default shell editor):
pick 6928fc1 crypto: add feature A pick 8120c4c add test for feature A pick 51759dc crypto: feature B pick 7d6f433 test for feature B # Rebase f9456a2..7d6f433 onto f9456a2 # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # # These lines can be re-ordered; they are executed from top to bottom. # # If you remove a line here THAT COMMIT WILL BE LOST. # # However, if you remove everything, the rebase will be aborted. # # Note that empty commits are commented out
Replace a couple of
fixup to squash them into a previous commit:
pick 6928fc1 crypto: add feature A fixup 8120c4c add test for feature A pick 51759dc crypto: feature B fixup 7d6f433 test for feature B
reword to change the commit message:
reword 6928fc1 crypto: add feature A fixup 8120c4c add test for feature A reword 51759dc crypto: feature B fixup 7d6f433 test for feature B
Save the file and close the editor. You'll be asked to enter a new commit message for that commit. This is a good moment to fix incorrect commit logs, ensure that they are properly formatted, and add
Modify the original commit message to include additional metadata regarding the change process. (The
git node metadata command can generate the metadata for you.)
PR-URL:line that references the full GitHub URL of the original pull request being merged so it's easy to trace a commit back to the conversation that led up to that change.
Fixes: Xline, where X either includes the full GitHub URL for an issue, and/or the hash and commit message if the commit fixes a bug in a previous commit. Multiple
Fixes:lines may be added if appropriate.
Refs:lines referencing a URL for any relevant background.
Reviewed-By: Name <email>line for yourself and any other Collaborators who have reviewed the change.
Run tests (
make -j4 test or
vcbuild test). Even though there was a successful continuous integration run, other changes may have landed on master since then, so running the tests one last time locally is a good practice.
Validate that the commit message is properly formatted using core-validate-commit.
$ git rev-list upstream/master...HEAD | xargs core-validate-commit
Optional: When landing your own commits, force push the amended commit to the branch you used to open the pull request. If your branch is called
bugfix, then the command would be
git push --force-with-lease origin master:bugfix. Don't manually close the PR, GitHub will close it automatically later after you push it upstream, and will mark it with the purple merged status rather than the red closed status. If you close the PR before GitHub adjusts its status, it will show up as a 0 commit PR and the changed file history will be empty. Also if you push upstream before you push to your branch, GitHub will close the issue with red status so the order of operations is important.
Time to push it:
$ git push upstream master
Close the pull request with a “Landed in
<commit hash>” comment. If your pull request shows the purple merged status then you should still add the “Landed in ..” comment if you added multiple commits.
Sometimes, when running
git push upstream master, you may get an error message like this:
To https://github.com/nodejs/node ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/nodejs/node' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g. 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
That means a commit has landed since your last rebase against
upstream/master. To fix this, pull with rebase from upstream and run the tests again (to make sure no interactions between your changes and the new changes cause any problems), and push again:
git pull upstream master --rebase make -j4 test git push upstream master
git, there‘s a way to override remote trees by force pushing (
git push -f). This should generally be seen as forbidden (since you’re rewriting history on a repository other people are working against) but is allowed for simpler slip-ups such as typos in commit messages. However, you are only allowed to force push to any Node.js branch within 10 minutes from your original push. If someone else pushes to the branch or the 10 minute period passes, consider the commit final.
--force-with-leaseto minimize the chance of overwriting someone else's change.
#node-dev(IRC) if you force push.
Long Term Support (often referred to as LTS) guarantees application developers a 30-month support cycle with specific versions of Node.js.
You can find more information in the full release plan.
Once a Current branch enters LTS, changes in that branch are limited to bug fixes, security updates, possible npm updates, documentation updates, and certain performance improvements that can be demonstrated to not break existing applications. Semver-minor changes are only permitted if required for bug fixes and then only on a case-by-case basis with LTS WG and possibly Technical Steering Committee (TSC) review. Semver-major changes are permitted only if required for security-related fixes.
Once a Current branch moves into Maintenance mode, only critical bugs, critical security fixes, and documentation updates will be permitted.
The default policy is to not land semver-minor or higher commits in any LTS branch. However, the LTS WG or TSC can evaluate any individual semver-minor commit and decide whether a special exception ought to be made. It is expected that such exceptions would be evaluated, in part, on the scope and impact of the changes on the code, the risk to ecosystem stability incurred by accepting the change, and the expected benefit that landing the commit will have for the ecosystem.
Any Collaborator who feels a semver-minor commit should be landed in an LTS branch should attach the
lts-agenda label to the pull request. The LTS WG will discuss the issue and, if necessary, will escalate the issue up to the TSC for further discussion.
There are multiple LTS branches, e.g.
v8.x. Each of these is paired with a staging branch:
As commits land on the master branch, they are cherry-picked back to each staging branch as appropriate. If the commit applies only to the LTS branch, the PR must be opened against the staging branch. Commits are selectively pulled from the staging branch into the LTS branch only when a release is being prepared and may be pulled into the LTS branch in a different order than they were landed in staging.
Only the members of the @nodejs/backporters team should land commits onto LTS staging branches.
When you send your pull request, please include information about whether your change is breaking. If you think your patch can be backported, please include that information in the PR thread or your PR description. For more information on backporting, please see the backporting guide.
Several LTS related issue and PR labels have been provided:
lts-watch-v10.x- tells the LTS WG that the issue/PR needs to be considered for landing in the
lts-watch-v8.x- tells the LTS WG that the issue/PR needs to be considered for landing in the
lts-watch-v6.x- tells the LTS WG that the issue/PR needs to be considered for landing in the
land-on-v10.x- tells the release team that the commit should be landed in a future v10.x release.
land-on-v8.x- tells the release team that the commit should be landed in a future v8.x release.
land-on-v6.x- tells the release team that the commit should be landed in a future v6.x release.
Any Collaborator can attach these labels to any PR/issue. As commits are landed into the staging branches, the
lts-watch- label will be removed. Likewise, as commits are landed in a LTS release, the
land-on- label will be removed.
Collaborators are encouraged to help the LTS WG by attaching the appropriate
lts-watch- label to any PR that may impact an LTS release.
When the LTS working group determines that a new LTS release is required, selected commits will be picked from the staging branch to be included in the release. This process of making a release will be a collaboration between the LTS working group and the Release team.
|@nodejs/async_hooks for bugs/reviews (+ @nodejs/diagnostics for API)|
|@bnoordhuis, @indutny, @nodejs/streams|
|upgrading http-parser||@nodejs/http, @nodejs/http2|
|upgrading npm||@fishrock123, @MylesBorins|
|upgrading V8||@nodejs/V8, @nodejs/post-mortem|
|Embedded use or delivery of Node.js||@nodejs/delivery-channels|
When things need extra attention, are controversial, or
If you cannot find who to cc for a file,
git shortlog -n -s <file> may help.