Overview
This document explains how collaborators manage the Node.js project. Collaborators should understand the guidelines for new contributors and the project governance model.Who Are Collaborators?
Node.js core collaborators maintain the nodejs/node GitHub repository. The GitHub team for Node.js core collaborators is @nodejs/collaborators. Collaborators have:- Commit access to the nodejs/node repository
- Access to the Node.js continuous integration (CI) jobs
Collaborator Activities
- Helping users and novice contributors
- Contributing code and documentation changes that improve the project
- Reviewing and commenting on issues and pull requests
- Participation in working groups
- Merging pull requests
Issues and Pull Requests
Mind these guidelines, the opinions of other collaborators, and guidance of the TSC. Notify other qualified parties for more input on an issue or a pull request.Welcoming First-Time Contributors
Always show courtesy to individuals submitting issues and pull requests. Be welcoming to first-time contributors, identified by the GitHub First-time contributor badge.Closing Issues and Pull Requests
Collaborators can 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.Remember that issues and pull requests can always be re-opened if necessary.
Author Ready Pull Requests
A pull request is author ready when:- There is a CI run in progress or completed
- There is at least one collaborator approval
- There are no outstanding review comments
Handling Own Pull Requests
When you open a pull request, start a CI right away. 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.Managing Security Issues
Use the process outlined in SECURITY.md to report security issues. If a user opens a security issue in the public repository:- Ask the user to submit a report through HackerOne
- Move the issue to the private premature-disclosures repository
- For related pull requests, create an associated issue in the
premature-disclosuresrepository - Open a ticket with GitHub to delete the pull request
- Open a new issue in the public repository explaining the deletion
- Email
[email protected]with links to the issues
Accepting Modifications
Contributors propose modifications to Node.js using GitHub pull requests. A pull request must pass code review and CI before landing into the codebase.Code Reviews
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.
Special Attention for Dependencies
Ideally pull requests for dependencies should be generated by automation. Pay special attention to pull requests for dependencies which have not been automatically generated and follow the guidance in Maintaining Dependencies.Starting CI
If you are the first collaborator to approve a pull request that has no CI yet, please start one. Please also start a new CI if the pull request creator pushed new code since the last CI run.Consensus Seeking
A pull request can land if it has:- The needed approvals
- Passing CI
- Required wait time
- No outstanding objections
Objections
Collaborators can object to a pull request by using the “Request Changes” GitHub feature. Requirements for objections:- Must be made in the pull request
- Must include a clear reason
- Objector must remain responsive for further discussion
- Should provide actionable steps to resolve the objection
- Pinging
@nodejs/tsc - Adding the
tsc-agendalabel
All Collaborator objections are considered equal. There is no greater weight given to objections from TSC members than from any other Collaborator.
Waiting for Approvals
Before landing pull requests, allow 48 hours for input from other collaborators.Fast-Track Eligible Changes
Certain types of pull requests can be fast-tracked and can land after a shorter delay:- Focused changes that affect only documentation and/or the test suite
code-and-learntasksgood-first-issuepull requests- Changes that fix regressions (red CI or broken compilation)
- Regressions that happen right before a release
- Apply the
fast-tracklabel - GitHub Actions workflow adds a comment that collaborators can upvote
- If someone disagrees, remove the label
- Two collaborators must approve the fast-tracking request
- The pull request itself still needs two collaborator approvals and passing CI
Testing and CI
All fixes must have a test case which demonstrates the defect. The test should fail before the change, and pass after the change. Required CI:- GitHub Actions CI: Must be passing (green)
- Jenkins CI: Required if the pull request contains changes that affect the
nodebinary (green or yellow)
Changes That Affect the Node Binary
Changes in the following folders (except comment-only changes) affect the node binary:deps/lib/src/test/tools/code_cache/tools/gyp/tools/icu/tools/inspector-protocol/tools/msvs/tools/snapshot/tools/v8_gypfiles/
tools/*.py*.gyp*.gypiconfigureconfigure.pyMakefilevcbuild.bat
Useful Jenkins CI Jobs
- node-test-pull-request: Test pull requests on all supported platforms
- citgm-smoker: Test against common modules in the ecosystem
- node-stress-single-test: Run tests repeatedly to check reliability
- node-test-commit-v8-linux: Run standard V8 tests
- node-test-commit-custom-suites-freestyle: Customize test suites and parameters
Starting a Jenkins CI Job
- Click “Build with Parameters” on the left side
- Enter the parameters:
GIT_REMOTE_REF: For pull requests userefs/pull/PR_NUMBER/headREBASE_ONTO: Set toorigin/mainto rebase onto main
- Copy the URL and paste it in a pull request comment
Internal vs. Public API
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. Internal APIs:- All undocumented functionality via
process.binding(...) - All undocumented functionality in
lib/internal/**/*.js - Non-exported
Symbolproperties and methods - Any undocumented object property or method that begins with
_ - Any native C/C++ APIs/ABIs requiring the
NODE_WANT_INTERNALSflag
Functionality in
lib/internal/**/*.js is public if it is re-exported by code in lib/*.js.Breaking Changes
At least two TSC voting members must approve backward-incompatible changes to themain branch.
Examples of breaking changes:
- Removal or redefinition of existing API arguments
- Changing return values
- Removing or modifying existing properties on an options argument
- Adding or removing errors
- Altering expected timing of an event
- Changing the side effects of using a particular API
Breaking Changes and Deprecations
Existing stable public APIs that change in a backward-incompatible way must undergo deprecation. Exceptions to deprecation requirement:- Adding or removing errors thrown or reported by a public API
- Emitting a runtime warning
- Changing error messages for errors without error code
- Altering the timing and non-internal side effects of the public API
- Changes to errors thrown by dependencies of Node.js, such as V8
- One-time exceptions granted by the TSC
Breaking Changes to Internal Elements
Breaking changes to internal elements can occur in semver-patch or semver-minor commits. Take significant care when making such changes.Unintended Breaking Changes
Sometimes, a change intended to be non-breaking turns out to be breaking. If such a change lands on themain branch:
- A collaborator can revert it
- The TSC can apply the semver-major label after-the-fact
Introducing New Modules
Treat commits that introduce new core modules with extra care. Requirements:- New modules must only be added with the
node:prefix - When adding promises to an existing API, add
/promises(inspector/promises, etc.) - Apply the
semver-majorlabel - Register a placeholder in npm (if the name is free)
- Allow at least one week for review
- Land only after sign-off from at least two TSC voting members
- Land with a Stability Index of Experimental
Deprecations
Node.js uses three Deprecation levels:Documentation-Only Deprecation
- A deprecation notice appears in the API documentation
- No functional changes
- No runtime warnings by default
- Might cause a runtime warning with the
--pending-deprecationflag - Apply the
notable-changelabel - Not a breaking change (not semver-major)
Runtime Deprecation
- Emits a warning at runtime on first use of the deprecated API
- Throws a runtime error with the
--throw-deprecationflag - Breaking change (semver-major)
End-of-Life
- The API is no longer subject to semantic versioning rules
- Backward-incompatible changes including complete removal can occur at any time
- Breaking change (semver-major)
Documentation-Only Deprecations can land in a minor release. They cannot change to a Runtime Deprecation until the next major release.
Involving the TSC
Collaborators can opt to elevate pull requests or issues to the TSC if they:- Have a significant impact on the codebase
- Are controversial
- Are at an impasse among collaborators
- @-mention the
@nodejs/tscGitHub team - Do not use the GitHub UI to assign to
@nodejs/tsc - For semver-major PRs, you can request a review from
@nodejs/tsc
Landing Pull Requests
Pre-Landing Checklist
- Avoid landing pull requests that have someone else as an assignee
- Never use GitHub’s green “Merge pull request” button
- Make sure CI is complete and green
- Check that the commit message adheres to commit message guidelines
- Add all necessary metadata to commit messages
Using the Commit Queue
See the commit queue guide.Using git-node
In most cases, using the git-node command of @node-core/utils is enough to land a pull request.
Commit Message Metadata
When landing, add metadata to commit messages:- Required:
PR-URL:line that references the full GitHub URL of the pull request - Optional:
Fixes: Xline, where X is the full GitHub URL for an issue - Optional:
Refs:lines referencing a URL for relevant background - Required:
Reviewed-By: Name <email>line for each collaborator who reviewed the change
Commit Squashing
If a pull request contains more than one commit, it can be landed either by:- Squashing into one commit
- Rebasing all the commits
- A mix of the two
Generally, a collaborator should land a pull request by squashing. If a pull request has more than one self-contained subsystem commits, a collaborator may land it as several commits.
Long Term Support
What is LTS?
Long Term Support (LTS) guarantees 30-month support cycles for specific Node.js versions. Once a branch enters LTS, the release plan limits the types of changes permitted in the branch. For more information, see the full release plan.How are LTS Branches Managed?
Each LTS release has:- A corresponding branch (v10.x, v8.x, etc.)
- A corresponding staging branch (v10.x-staging, v8.x-staging, etc.)
main are cherry-picked to each staging branch as appropriate.
LTS-Related Labels
lts-watch-v?.x: For pull requests to consider for landing in staging branchesland-on-v?.x: For pull requests that should land in a future v*.x releasebackport-requested-v?.x: Indicates that a pull request needs a manual backportbackported-to-v?.x: Applied to pull requests for which a backport has been mergeddont-land-on-v?.x: For changes that do not apply to a certain release line
Who to CC in the Issue Tracker
Common Subsystems
| Subsystem | Maintainers |
|---|---|
benchmark/* | @nodejs/benchmarking |
doc/*, *.md | @nodejs/documentation |
lib/assert | @nodejs/assert |
lib/buffer | @nodejs/buffer |
lib/{crypto,tls,https} | @nodejs/crypto |
lib/fs, src/{fs,file} | @nodejs/fs |
lib/{_}http{*} | @nodejs/http |
lib/{_}stream{*} | @nodejs/streams |
test/* | @nodejs/testing |
If you cannot find who to cc for a file,
git shortlog -n -s <file> can help.Labels
General Labels
confirmed-bug: Bugs you have verifieddiscuss: Things that need larger discussionfast-track: PRs that need to land fasterfeature request: Any issue that requests a new featuregood first issue: Issues suitable for newcomers to fixmeta: Governance, policies, procedures, etc.request-ci: When added to a PR, CI will be started automaticallytsc-agenda: Will be added to TSC meeting agendaauthor-ready: PR is ready to land (has CI, approvals, no outstanding comments)
Semver Labels
semver-minor: Adds new functionality in a backward-compatible mannersemver-major: Breaking changes