@@ -10,7 +10,8 @@ good faith both with other contributors and with the community. No contribution
1010is too small and all contributions are valued.
1111
1212This guide details the basic steps for getting started contributing to the
13- Node.js project's core ` nodejs/node ` GitHub Repository.
13+ Node.js project's core ` nodejs/node ` GitHub Repository and describes what to
14+ expect throughout each step of the process.
1415
1516* [ Code of Conduct] ( #code-of-conduct )
1617* [ Issues] ( #issues )
@@ -67,6 +68,22 @@ Open, diverse and inclusive communities live and die on the basis of trust.
6768Contributors can disagree with one another so long as they trust that those
6869disagreements are in good faith and everyone is working towards a common goal.
6970
71+ ### Bad actors
72+
73+ A * bad actor* is someone who repeatedly violates the * spirit* of the Code of
74+ Conduct through consistent failure to self-regulate the way in which they
75+ interact with other contributors in the project. In so doing, bad actors
76+ alienate other contributors, discourage collaboration, and generally reflect
77+ poorly on the project as a whole.
78+
79+ Being a bad actor may be intentional or unintentional. Typically, unintentional
80+ bad behavior can be easily corrected by being quick to apologize and correct
81+ course * even if you are not entirely convinced you need to* . Giving other
82+ contributors the benefit of the doubt and have a sincere willingness to admit
83+ that you * might* be wrong is critical for any successful open collaboration.
84+
85+ Don't be a bad actor.
86+
7087## Issues
7188
7289Issues in ` nodejs/node ` are the primary means by which bug reports and
@@ -248,7 +265,7 @@ time to ensure that the changes follow the Node.js code style guide.
248265
249266Any documentation you write (including code comments and API documentation)
250267should follow the [ Style Guide] ( doc/STYLE_GUIDE.md ) . Code samples included
251- in the API docs will also be checked when running ` make lint ` (or
268+ in the API docs will also be checked when running ` make lint ` (or
252269` vcbuild.bat lint ` on Windows).
253270
254271#### Step 4: Commit
@@ -530,6 +547,156 @@ contributor to make the pull request better.
530547Reviews that are dismissive or disrespectful of the contributor or any other
531548reviewers are strictly counter to the [ Code of Conduct] [ ] .
532549
550+ When reviewing a pull request, the primary goals are for the codebase to improve
551+ and for the person submitting the request to succeed. Even if a pull request
552+ does not land, the submitters should come away from the experience feeling like
553+ their effort was not wasted or unappreciated. Every pull request from a new
554+ contributor is an opportunity to grow the community.
555+
556+ #### Review a bit at a time.
557+
558+ Do not overwhelm new contributors.
559+
560+ It is tempting to micro-optimize and make everything about relative performance,
561+ perfect grammar, or exact style matches. Do not succumb to that temptation.
562+
563+ Focus first on the most significant aspects of the change:
564+
565+ 1 . Does this change make sense for Node.js?
566+ 2 . Does this change make Node.js better, even if only incrementally?
567+ 3 . Are there clear bugs or larger scale issues that need attending to?
568+
569+ When changes are necessary, * request* them, do not * demand* them, and do not
570+ assume that the submitter already knows how to add a test or run a benchmark.
571+
572+ Specific performance optimization techniques, coding styles and conventions
573+ change over time. The first impression you give to a new contributor never does.
574+
575+ Nits (requests for small changes that are not essential) are fine, but try to
576+ avoid stalling the pull request. Most nits can typically be fixed by the
577+ Node.js Collaborator landing the pull request but they can also be an
578+ opportunity for the contributor to learn a bit more about the project.
579+
580+ It is always good to clearly indicate nits when you comment: e.g.
581+ ` Nit: change foo() to bar(). But this is not blocking. `
582+
583+ #### Be aware of the person behind the code
584+
585+ Be aware that * how* you communicate requests and reviews in your feedback can
586+ have a significant impact on the success of the pull request. Yes, we may land
587+ a particular change that makes Node.js better, but the individual might just
588+ not want to have anything to do with Node.js every again. The goal is not just
589+ having good code.
590+
591+ #### Respect the minimum wait time for comments
592+
593+ There is a minimum waiting time which we try to respect for non-trivial
594+ changes, so that people who may have important input in such a distributed
595+ project are able to respond.
596+
597+ For non-trivial changes, pull requests must be left open for * at least* 48
598+ hours during the week, and 72 hours on a weekend. In most cases, when the
599+ PR is relatively small and focused on a narrow set of changes, these periods
600+ provide more than enough time to adequately review. Sometimes changes take far
601+ longer to review, or need more specialized review from subject matter experts.
602+ When in doubt, do not rush.
603+
604+ Trivial changes, typically limited to small formatting changes or fixes to
605+ documentation, may be landed within the minimum 48 hour window.
606+
607+ #### Abandoned or Stalled Pull Requests
608+
609+ If a pull request appears to be abandoned or stalled, it is polite to first
610+ check with the contributor to see if they intend to continue the work before
611+ checking if the they would mind if you took it over (especially if it just has
612+ nits left). When doing so, it is courteous to give the original contributor
613+ credit for the work they started.
614+
615+ #### Approving a change
616+
617+ Any Node.js core Collaborator (any GitHub user with commit rights in the
618+ ` nodejs/node ` repository) is authorized to approve any other contributor's
619+ work. Collaborators are not permitted to approve their own pull requests.
620+
621+ Collaborators indicate that they have reviewed and approve of the changes in
622+ a pull request either by using GitHub's Approval Workflow, which is preferred,
623+ or by leaving an ` LGTM ` ("Looks Good To Me") comment.
624+
625+ When explicitly using the "Changes requested" component of the GitHub Approval
626+ Workflow, show empathy. That is, do not be rude or abrupt with your feedback
627+ and offer concrete suggestions for improvement, if possible. If you're not
628+ sure * how* a particular change can be improved, say so.
629+
630+ Most importantly, after leaving such requests, it is courteous to make yourself
631+ available later to check whether your comments have been addressed.
632+
633+ If you see that requested changes have been made, you can clear another
634+ collaborator's ` Changes requested ` review.
635+
636+ Change requests that are vague, dismissive, or unconstructive may also be
637+ dismissed if requests for greater clarification go unanswered within a
638+ reasonable period of time.
639+
640+ If you do not believe that the pull request should land at all, use
641+ ` Changes requested ` to indicate that you are considering some of your comments
642+ to block the PR from landing. When doing so, explain * why* you believe the
643+ pull request should not land along with an explanation of what may be an
644+ acceptable alternative course, if any.
645+
646+ #### Accept that there are different opinions about what belongs in Node.js
647+
648+ Opinions on this vary, even among the members of the Technical Steering
649+ Committee.
650+
651+ One general rule of thumb is that if Node.js itself needs it (due to historic
652+ or functional reasons), then it belongs in Node.js. For instance, ` url `
653+ parsing is in Node.js because of HTTP protocol support.
654+
655+ Also, functionality that either cannot be implemented outside of core in any
656+ reasonable way, or only with significant pain.
657+
658+ It is not uncommon for contributors to suggest new features they feel would
659+ make Node.js better. These may or may not make sense to add, but as with all
660+ changes, be courteous in how you communicate your stance on these. Comments
661+ that make the contributor feel like they should have "known better" or
662+ ridiculed for even trying run counter to the [ Code of Conduct] [ ] .
663+
664+ #### Performance isn't everything
665+
666+ Node.js has always optimized for speed of execution. If a particular change
667+ can be shown to make some part of Node.js faster, it's quite likely to be
668+ accepted. Claims that a particular code request will make things faster will
669+ almost always be met by requests for performance benchmark results that
670+ demonstrate the improvement.
671+
672+ That said, performance is not the only factor to consider. Node.js also
673+ optimizes in favor of not breaking existing code in the ecosystem, and not
674+ changing working functional code just for the sake of changing.
675+
676+ If a particular pull request introduces a performance or functional
677+ regression, rather than simply rejecting the pull request, take the time to
678+ work * with* the contributor on improving the change. Offer feedback and
679+ advice on what would make the pull request acceptable, and do not assume that
680+ the contributor should already know how to do that. Be explicit in your
681+ feedback.
682+
683+ #### Continuous Integration (CI) Testing:
684+
685+ All pull requests that contain changes to code must be run through
686+ continuous integration (CI) testing at [ https://ci.nodejs.org/ ] [ ] .
687+
688+ Only Node.js core Collaborators with commit rights to the ` nodejs/node `
689+ repository may start a CI testing run. The specific details of how to do
690+ this are included in the new Collaborator [ Onboarding guide] [ ] .
691+
692+ Ideally, the code change will pass ("be green") on all platform configurations
693+ supported by Node.js (there are over 30 platform configurations currently).
694+ This means that all tests pass and there are no linting errors. In reality,
695+ however, it is not uncommon for the CI infrastructure itself to fail on
696+ specific platforms or for so-called "flaky" tests to fail ("be red"). It is
697+ vital to visually inspect the results of all failed ("red") tests to determine
698+ whether the failure was caused by the changes in the pull request.
699+
533700## Additional Notes
534701
535702### Commit Squashing
@@ -590,7 +757,7 @@ you can take a look at the
590757The following additional resources may be of assistance:
591758
592759* [ How to create a Minimal, Complete, and Verifiable example] ( https://stackoverflow.com/help/mcve )
593- * [ core-validate-commit] ( https://github.com/evanlucas/core-validate-commit ) -
760+ * [ core-validate-commit] ( https://github.com/evanlucas/core-validate-commit ) -
594761 A utility that ensures commits follow the commit formatting guidelines.
595762
596763<a id =" developers-certificate-of-origin " ></a >
@@ -629,3 +796,5 @@ By making a contribution to this project, I certify that:
629796[ approved ] : #getting-approvals-for-your-pull-request
630797[ CI (Continuous Integration) test run ] : #ci-testing
631798[ notes about the waiting time ] : #waiting-until-the-pull-request-gets-landed
799+ [ https://ci.nodejs.org/ ] : https://ci.nodejs.org/
800+ [ Onboarding guide ] : ./docs/onboarding.md
0 commit comments