From f1ea86317af137bd793c3a7d412396f1c53efe05 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 13:06:16 -0700 Subject: [PATCH 01/17] meta: improve contributors guide --- CONTRIBUTING.md | 385 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 314 insertions(+), 71 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f9bd33e055db1..1d984946a2957a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,44 +1,152 @@ # Contributing to Node.js +Contributions to Node.js may come in many forms. Some contribute code changes, +others contribute docs, others help answer questions from users, help keep the +infrastructure running, or seek out ways of advocating for Node.js users of all +types. + +The Node.js project welcomes all contributions from anyone willing to work in +good faith both with other contributors and with the community. No contribution +is too small and all contributions are valued. + +This guide details the basic steps for getting started contributing to the +Node.js projects core `nodejs/node` GitHub Repository. + ## Code of Conduct -Please read the -[Code of Conduct](https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md) -which explains the minimum behavior expectations for Node.js contributors. +The Node.js project has a [Code of Conduct][] that *all* contributors are +expected to follow. This code describes the *minimum* behavior expectations +for all contributors. -## Issue Contributions +As a contributor to Node.js, how you choose to act and interact towards your +follow contributors, as well as to the community, will reflect back not only +on yourself but on the project as a whole. The Code of Conduct is designed and +intended, above all else, to help establish a culture within the project that +allows anyone and everyone who wants to continue to feel safe doing so. -When opening issues or commenting on existing issues, please make sure -discussions are related to concrete technical issues with Node.js. +Should any individual act in any way that is considered in violation of the +[Code of Conduct], corrective actions will be taken. It is possible, however, +for any individual to *act* in such a manner that is not in violation of the +strict letter of the Code of Conduct guidelines while still going completely +against the spirit of what that Code is intended to accomplish. -* For general help using Node.js, please file an issue at the -[Node.js help repository](https://github.com/nodejs/help/issues). +Open, diverse and inclusive open communities live and die on the basis of trust. +Contributors can disagree with one another so long as they trust that those +disagreements are in good faith and everyone is working towards a common goal. -* Discussion of non-technical topics (such as intellectual property and -trademark) should use the -[Technical Steering Committee (TSC) repository](https://github.com/nodejs/TSC/issues). +## Issues -## Code Contributions +Issues in `nodejs/node` are the primary means by which bug reports and +general discussions are made. For any issue, there are fundamentally three +ways an individual can contribute: -This section will guide you through the contribution process. +1. By opening the issue for discussion: For instance, if you believe that you + have uncovered a bug in Node.js, creating a new issue in the nodejs/node + issue tracker is the way to report it. +2. By helping to triage the issue: This can be done either by providing + supporting details (a test case that demonstrates a bug), or providing + suggestions on how to address the issue. +3. By helping to resolve the issue: Typically this is done either in the form + of demonstrating that the issue reported is not a problem after all, or more + often, by opening a Pull Request that changes some bit of something in + `nodejs/node` in a concrete and reviewable manner. -### Step 1: Fork +### Asking for General Help -Fork the project [on GitHub](https://github.com/nodejs/node) and clone your fork -locally. +Because the level of activity in the `nodejs/node` repository is so high, +questions or requests for general help using Node.js should be directed at +the [Node.js help repository][]. -```text -$ git clone git@github.com:username/node.git -$ cd node -$ git remote add upstream https://github.com/nodejs/node.git +### Discussing non-technical topics + +Discussion of non-technical topics (such as intellectual property and trademark) +should be directed to the [Technical Steering Committee (TSC) repository][]. + +### Submitting a Bug Report + +When opening a new issue in the `nodejs/node` issue tracker, users will be +presented with a basic template that should be filled in. + +```markdown + + +* **Version**: +* **Platform**: +* **Subsystem**: + + ``` -#### Which branch? +If you believe that you have uncovered a bug in Node.js, please fill out this +form, following the template to the best of your ability. Do not worry if you +cannot answer every detail, just fill in what you can. + +The two most important pieces of information we need in order to properly +evaluate the report is a description of the behavior you are seeing and a simple +test case we can use to recreate the problem on our own. If we cannot recreate +the issue, it becomes impossible for us to fix. + +In order to rule out the possibility of bugs introduced by userland code, test +cases should be limited, as much as possible, to using *only* Node.js APIs. +If the bug occurs only when you're using a specific userland module, there is +a very good chance that either (a) the module has a bug or (b) something in +Node.js changed that broke the module. + +### Triaging a Bug Report -For developing new features and bug fixes, the `master` branch should be pulled -and built upon. +Once an issue has been opened, it is not uncommon for there to be discussion +around it. Some contributors may have differing opinions about the issue, +including whether the behavior being seen is a bug or a feature. This discussion +is part of the process and should be kept focused, helpful and professional. -#### Dependencies +Short, clipped responses that do not provide either additional context nor +supporting detail are neither helpful nor professional. To many, such responses +are simply annoying and unfriendly. + +Contributors are encouraged to help one another make forward progress as much +as possible, empowering one another to solve issues collaboratively. If you +choose to comment on an issue that you feel either is not a problem that needs +to be fixed, or if you encounter information in an issue that you feel is +incorrect, explain *why* you feel that way with additional supporting context, +and be willing to be convinced that you may be wrong. By doing so, we can often +reach the correct outcome much faster. + +### Resolving a Bug Report + +In the vast majority of cases, issues are resolved by opening a pull request. +The process for opening an reviewing a pull request is simliar to that of +opening and triaging issues but carries with in a necessary review and approval +workflow that ensures that the proposed changes meet the minimal quality and +functional guidelines of the Node.js project. + +## Pull Requests + +Pull Requests are the way in which concrete changes are made to the code, +documentation, dependencies, and tools contained with the `nodejs/node` +repository. + +There are two fundamental components of the Pull Request process: one concrete +and technical, and one more process oriented. The concete and technical +component involves the specific details of setting up your local environment +so that you can make the actual changes. This is where we will start. + +### Dependencies Node.js has several bundled dependencies in the *deps/* and the *tools/* directories that are not part of the project proper. Changes to files in those @@ -54,36 +162,78 @@ questions, and [#Node-dev](http://webchat.freenode.net/?channels=node-dev) for development of Node.js core specifically. -### Step 2: Branch +### Setting up your local environment + +To get started, you will need to have `git` installed locally. Depending on +your operating system, there are also a number of other dependencies required. +These are detailed in the [Building guide][]. -Create a branch and start hacking: +Once you have `git` and are sure you have all of the necessary dependencies, +it's time to create a fork. + +Before getting started, it is recommend to configure `git` so that it knows +who you are: ```text -$ git checkout -b my-branch -t origin/master +$ git config --global user.name "J. Random User" +$ git config --global user.email "j.random.user@example.com" ``` -Any text you write should follow the [Style Guide](doc/STYLE_GUIDE.md), -including comments and API documentation. +#### Step 1: Fork + +Fork the project [on GitHub](https://github.com/nodejs/node) and clone your fork +locally. + +```text +$ git clone git@github.com:username/node.git +$ cd node +$ git remote add upstream https://github.com/nodejs/node.git +$ git fetch upstream +``` -### Step 3: Commit +#### Step 2: Branch -Make sure git knows your name and email address: +As a best practice to keep your development environment as organized as +possible, create local branches to work within. These should also be created +directly off of the `master` branch. ```text -$ git config --global user.name "J. Random User" -$ git config --global user.email "j.random.user@example.com" +$ git checkout -b my-branch -t origin/master ``` -Add and commit: +### The Process of Making Changes + +#### Step 3: Code + +The vast majority of pull requests opened against the `nodejs/node` +repository includes changes to either the C/C++ code contained in the `src` +directory, the JavaScript code contained in the `lib` directory, the +documentation in `docs/api` or tests within the `test` directory. + +If you are modifying code, please be sure to run `make lint` from time to +time to ensure that the changes follow the Node.js code style guide. + +Any documentation you write (including code comments and API documentation) +should follow the [Style Guide](doc/STYLE_GUIDE.md). + +#### Step 4: Commit + +It is a recommended best practice to keep your changes as logically grouped +as possible within individual commits. There is no limit to the number of +commits any single pull request may have, and many contributors find it easier +to review changes that are split across multiple commits. ```text $ git add my/changed/files $ git commit ``` -### Commit message guidelines +Note that multiple commits often get squashed when they are landed (see the +notes about [commit squashing](#commit-squashing)). -The commit message should describe what changed and why. +##### Commit message guidelines + +A good commit message should describe what changed and why. 1. The first line should: - contain a short description of the change @@ -129,9 +279,16 @@ Fixes: https://github.com/nodejs/node/issues/1337 Refs: http://eslint.org/docs/rules/space-in-parens.html ``` -### Step 4: Rebase +If you are new to contributing to Node.js, please try to do your best at +conforming to these guidelines but do not worry if you get something wrong. +One of the existing contributors will help get things situated and the +contributor landing the pull request will ensure that everything follows +the project guidelines. + +#### Step 5: Rebase -Use `git rebase` (not `git merge`) to synchronize your work with the main +As a best practice, once you have committed your changes, it is a good idea +to use `git rebase` (not `git merge`) to synchronize your work with the main repository. ```text @@ -139,20 +296,29 @@ $ git fetch upstream $ git rebase upstream/master ``` -### Step 5: Test +The ensures that your working branch has the latest changes from `nodejs/node` +master. + +#### Step 6: Test -Bug fixes and features should come with tests. Read the -[guide for writing tests in Node.js](./doc/guides/writing-tests.md). Looking at -other tests to see how they should be structured can also help. Add your -tests in the `test/parallel/` directory if you are unsure where to put them. +Bug fixes and features should always come with tests. A +[guide for writing tests in Node.js](./doc/guides/writing-tests.md) has been +provided to make the proces easier. Looking at other tests to see how they +should be structured can also help. -To run the tests (including code linting) on Unix / macOS: +The `test` directory within the `nodejs/node` repository is complex and it is +often not clear where a new test file should go. When in doubt, add new tests +to the `test/parallel/` directory and the right location will be sorted out +later. + +Before submitting your changes in a pull requests, always run the full Node.js +test suite. To run the tests (including code linting) on Unix / macOS: ```text $ ./configure && make -j4 test ``` -Windows: +And on Windows: ```text > vcbuild test @@ -189,24 +355,59 @@ $ ./node ./test/parallel/test-stream2-transform.js Remember to recompile with `make -j4` in between test runs if you change code in the `lib` or `src` directories. -### Step 6: Push +#### Step 7: Push + +Once you are sure your commits are ready to go, with passing tests and linting, +begin the process of opening a pull requests by pushing your working branch to +your fork on GitHub. ```text $ git push origin my-branch ``` -Pull requests are usually reviewed within a few days. +#### Step 8: Opening the Pull Request -### Step 7: Discuss and update +From within GitHub, opening a new Pull Request will present you with a template +that should be filled out: -You will probably get feedback or requests for changes to your Pull Request. -This is a big part of the submission process so don't be discouraged! +```markdown + + +##### Checklist + + +- [ ] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes +- [ ] tests and/or benchmarks are included +- [ ] documentation is changed or added +- [ ] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines) + +##### Affected core subsystem(s) + +``` -You can push more commits to your branch: +Please try to do your best at filling out the details but feel free to skip +parts if you're not sure what to put. + +Once opened, pull requests are usually reviewed within a few days. + +#### Step 9: Discuss and update + +You will probably get feedback or requests for changes to your Pull Request. +This is a big part of the submission process so don't be discouraged! Some +contributors may sign off on the pull request right away, others may have +more detailed comments or feedback. This is a necessary part of the process +in order to evaluate whether the changes are correct and necessary. + +To make changes to an existing Pull Request, make the changes to your local +branch, add a new commit with those changes, and push those to your fork. +GitHub will automatically update the Pull Request. ```text $ git add my/changed/files @@ -214,7 +415,8 @@ $ git commit $ git push origin my-branch ``` -Or you can rebase against master: +It is also frequently necessary to synchronize your pull request with other +changes that have landed in `master` by using `git rebase`: ```text $ git fetch --all @@ -222,8 +424,13 @@ $ git rebase origin/master $ git push --force-with-lease origin my-branch ``` -Or you can amend the last commit (for example if you want to change the commit -log). +**Important:** The `git push --force-with-lease` command is one of the few ways +to delete history in git. Before you use it, make sure you understand the risks. +If in doubt, you can always ask for guidance in the Pull Request or on +[IRC in the #node-dev channel](https://webchat.freenode.net?channels=node-dev&uio=d4). + +If you happen to make a mistake in any of your commits, do not worry. You can +amend the last commit (for example if you want to change the commit log). ```text $ git add any/changed/files @@ -231,28 +438,39 @@ $ git commit --amend $ git push --force-with-lease origin my-branch ``` -**Important:** The `git push --force-with-lease` command is one of the few ways -to delete history in git. Before you use it, make sure you understand the risks. -If in doubt, you can always ask for guidance in the Pull Request or on -[IRC in the #node-dev channel](https://webchat.freenode.net?channels=node-dev&uio=d4). +There are a number of more advanced mechanisms for managing commits using +`git rebase` that can be used but are beyond the scope of this guide. Feel free to post a comment in the Pull Request to ping reviewers if you are awaiting an answer on something. If you encounter words or acronyms that seem unfamiliar, refer to this [glossary](https://sites.google.com/a/chromium.org/dev/glossary). -Note that multiple commits often get squashed when they are landed (see the -notes about [commit squashing](#commit-squashing)). +##### Approval and Request Changes Workflow + +All pull requests require "sign off" in order to land. Whenever a contributor +reviews a pull request they may find specific details that they would like to +see changed or fixed. These may be as simple as fixing a typo, or may involve +substantive changes to the code you have written. In general, such request +are intended to be helpful, but at times may come across as abrupt or unhelpful, +especially requests to change things that do not include concrete suggestions +on *how* to change them. -### Step 8: Landing +Try not to be discouraged. If you feel that a particular review is unfair, +say so, or contact one of the other contributors in the project and seek their +input. Often such comments are the result of the reviewer having only taken a +short amount of time to review and are not ill-intended. Such issues can often +be resolved with a bit of patience. That said, reviewers should be expected to +be helpful in their feedback, and feedback that is simply vague, dismissive and +helpful is likely safe to ignore. -In order to land, a Pull Request needs to be reviewed and -[approved](#getting-approvals-for-your-pull-request) by +#### Step 10: Landing + +In order to land, a Pull Request needs to be reviewed and [approved][] by at least one Node.js Collaborator and pass a -[CI (Continuous Integration) test run](#ci-testing). -After that, as long as there are no objections -from a Collaborator, the Pull Request can be merged. If you find your -Pull Request waiting longer than you expect, see the +[CI (Continuous Integration) test run][]. After that, as long as there are no +objections from other contributors, the Pull Request can be merged. If you find +your Pull Request waiting longer than you expect, see the [notes about the waiting time](#waiting-until-the-pull-request-gets-landed). When a collaborator lands your Pull Request, they will post @@ -262,11 +480,26 @@ point, but don't worry. If you look at the branch you raised your Pull Request against (probably `master`), you should see a commit with your name on it. Congratulations and thanks for your contribution! +### Reviewing Pull Requests + +All Node.js contributors who choose to review and provide feedback on pull +requests have a responsibility both the project and the individual making the +contribution. Reviews and feedback must be helpful, insightful, and geared +towards improving the contribution as opposed to simply blocking it or +stopping it. If there are reasons why you feel the PR should not land, explain +what those are. Do not expect to be able to block a pull request from advancing +simply because you say "No" without giving an explanation. It is also important +to be open to having your mind changed, and to being open to working with the +contributor to make the pull request better. + +Reviews that are dismissive or disrespectful of the contributor or any other +reviewers are strictly counter to the [Code of Conduct][]. + ## Additional Notes ### Commit Squashing -When the commits in your Pull Request land, they will be squashed +When the commits in your Pull Request land, they may be squashed into one commit per logical change. Metadata will be added to the commit message (including links to the Pull Request, links to relevant issues, and the names of the reviewers). The commit history of your Pull Request, @@ -343,3 +576,13 @@ By making a contribution to this project, I certify that: personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. + +[Code of Conduct]: https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md +[Node.js help repository]: https://github.com/nodejs/help/issues +[Technical Steering Committee (TSC) repository]: https://github.com/nodejs/TSC/issues +[Building guide]: ./BUILDING.md +[on GitHub]: https://github.com/nodejs/node +[guide for writing tests in Node.js]: ./doc/guides/writing-tests.md +[approved]: #getting-approvals-for-your-pull-request +[CI (Continuous Integration) test run]: #ci-testing +[notes about the waiting time]: #waiting-until-the-pull-request-gets-landed From f3cfc25bced35e35ceeccc9b7f2b12f77be5eac3 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 13:17:55 -0700 Subject: [PATCH 02/17] [Squash] Add table of contents --- CONTRIBUTING.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d984946a2957a..32095607238eba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,37 @@ is too small and all contributions are valued. This guide details the basic steps for getting started contributing to the Node.js projects core `nodejs/node` GitHub Repository. +* [Code of Conduct](#code-of-conduct) +* [Issues](#issues) + * [Asking for General Help](#asking-for-general-help) + * [Discussing non-technical topics](#discussing-non-technical-topics) + * [Submitting a Bug Report](#submitting-a-bug-report) + * [Triaging a Bug Report](#triaging-a-bug-report) + * [Resolving a Bug Report](#resolving-a-bug-report) +* [Pull Requests](#pull-requests) + * [Dependencies](#dependencies) + * [Setting up your local environment](#setting-up-your-local-environment) + * [Step 1: Fork](#step-1-fork) + * [Step 2: Branch](#step-2-branch) + * [The Process of Making Changes](#the-process-of-making-changes) + * [Step 3: Code](#step-3-code) + * [Step 4: Commit](#step-4-commit) + * [Commit message guidelines](#commit-message-guidelines) + * [Step 5: Rebase](#step-5-rebase) + * [Step 6: Test](#step-6-test) + * [Step 7: Push](#step-7-push) + * [Step 8: Opening the Pull Request](#step-8-opening-the-pull-request) + * [Step 9: Discuss and Upadte](#step-9-discuss-and-update) + * [Approval and Request Changes Workflow](#approval-and-request-changes-workflow) + * [Step 10: Landing](#step-10-landing) + * [Reviewing Pull Requests](#reviewing-pull-requests) +* [Additional Notes](#additional-notes) + * [Commit Squashing](#commit-squashing) + * [Getting Approvals for your Pull Request](#getting-approvals-for-your-pull-request) + * [CI Testing](#ci-testing) + * [Waiting Until the Pull Request Gets Landed](#waiting-until-the-pull-request-gets-landed) +* [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin-11) + ## Code of Conduct The Node.js project has a [Code of Conduct][] that *all* contributors are From b12145ba2ee905f0a92d1ac24e04608d616cfe16 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 13:45:19 -0700 Subject: [PATCH 03/17] [Squash] Nits --- CONTRIBUTING.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32095607238eba..5db3b3bb4a4cc3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ good faith both with other contributors and with the community. No contribution is too small and all contributions are valued. This guide details the basic steps for getting started contributing to the -Node.js projects core `nodejs/node` GitHub Repository. +Node.js project's core `nodejs/node` GitHub Repository. * [Code of Conduct](#code-of-conduct) * [Issues](#issues) @@ -41,6 +41,7 @@ Node.js projects core `nodejs/node` GitHub Repository. * [Getting Approvals for your Pull Request](#getting-approvals-for-your-pull-request) * [CI Testing](#ci-testing) * [Waiting Until the Pull Request Gets Landed](#waiting-until-the-pull-request-gets-landed) + * [Check Out the Collaborator's Guide](#check-out-the-collaborators-guide) * [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin-11) ## Code of Conduct @@ -50,18 +51,18 @@ expected to follow. This code describes the *minimum* behavior expectations for all contributors. As a contributor to Node.js, how you choose to act and interact towards your -follow contributors, as well as to the community, will reflect back not only +fellow contributors, as well as to the community, will reflect back not only on yourself but on the project as a whole. The Code of Conduct is designed and intended, above all else, to help establish a culture within the project that allows anyone and everyone who wants to continue to feel safe doing so. Should any individual act in any way that is considered in violation of the -[Code of Conduct], corrective actions will be taken. It is possible, however, +[Code of Conduct][], corrective actions will be taken. It is possible, however, for any individual to *act* in such a manner that is not in violation of the strict letter of the Code of Conduct guidelines while still going completely against the spirit of what that Code is intended to accomplish. -Open, diverse and inclusive open communities live and die on the basis of trust. +Open, diverse and inclusive communities live and die on the basis of trust. Contributors can disagree with one another so long as they trust that those disagreements are in good faith and everyone is working towards a common goal. @@ -72,7 +73,7 @@ general discussions are made. For any issue, there are fundamentally three ways an individual can contribute: 1. By opening the issue for discussion: For instance, if you believe that you - have uncovered a bug in Node.js, creating a new issue in the nodejs/node + have uncovered a bug in Node.js, creating a new issue in the `nodejs/node` issue tracker is the way to report it. 2. By helping to triage the issue: This can be done either by providing supporting details (a test case that demonstrates a bug), or providing From ba61d4fd87b80468687917b330db8f00927e2ab4 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 13:52:26 -0700 Subject: [PATCH 04/17] [Squash] Nits --- CONTRIBUTING.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5db3b3bb4a4cc3..6b2a6ec8b80012 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -147,9 +147,9 @@ around it. Some contributors may have differing opinions about the issue, including whether the behavior being seen is a bug or a feature. This discussion is part of the process and should be kept focused, helpful and professional. -Short, clipped responses that do not provide either additional context nor -supporting detail are neither helpful nor professional. To many, such responses -are simply annoying and unfriendly. +Short, clipped responses--that provide neither additional context nor supporting +detail--are not helpful or professional. To many, such responses are simply +annoying and unfriendly. Contributors are encouraged to help one another make forward progress as much as possible, empowering one another to solve issues collaboratively. If you @@ -162,7 +162,7 @@ reach the correct outcome much faster. ### Resolving a Bug Report In the vast majority of cases, issues are resolved by opening a pull request. -The process for opening an reviewing a pull request is simliar to that of +The process for opening an reviewing a pull request is similar to that of opening and triaging issues but carries with in a necessary review and approval workflow that ensures that the proposed changes meet the minimal quality and functional guidelines of the Node.js project. @@ -174,7 +174,7 @@ documentation, dependencies, and tools contained with the `nodejs/node` repository. There are two fundamental components of the Pull Request process: one concrete -and technical, and one more process oriented. The concete and technical +and technical, and one more process oriented. The concrete and technical component involves the specific details of setting up your local environment so that you can make the actual changes. This is where we will start. @@ -343,7 +343,7 @@ often not clear where a new test file should go. When in doubt, add new tests to the `test/parallel/` directory and the right location will be sorted out later. -Before submitting your changes in a pull requests, always run the full Node.js +Before submitting your changes in a pull request, always run the full Node.js test suite. To run the tests (including code linting) on Unix / macOS: ```text @@ -390,7 +390,7 @@ the `lib` or `src` directories. #### Step 7: Push Once you are sure your commits are ready to go, with passing tests and linting, -begin the process of opening a pull requests by pushing your working branch to +begin the process of opening a pull request by pushing your working branch to your fork on GitHub. ```text From 94adf37aa52e3fc7fb547c4aedbf3c85739ddb31 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 15:02:32 -0700 Subject: [PATCH 05/17] [Squash] Nits --- CONTRIBUTING.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6b2a6ec8b80012..536d6e7b34a234 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -147,8 +147,8 @@ around it. Some contributors may have differing opinions about the issue, including whether the behavior being seen is a bug or a feature. This discussion is part of the process and should be kept focused, helpful and professional. -Short, clipped responses--that provide neither additional context nor supporting -detail--are not helpful or professional. To many, such responses are simply +Short, clipped responses—that provide neither additional context nor supporting +detail—are not helpful or professional. To many, such responses are simply annoying and unfriendly. Contributors are encouraged to help one another make forward progress as much @@ -162,7 +162,7 @@ reach the correct outcome much faster. ### Resolving a Bug Report In the vast majority of cases, issues are resolved by opening a pull request. -The process for opening an reviewing a pull request is similar to that of +The process for opening and reviewing a pull request is similar to that of opening and triaging issues but carries with in a necessary review and approval workflow that ensures that the proposed changes meet the minimal quality and functional guidelines of the Node.js project. @@ -246,7 +246,9 @@ If you are modifying code, please be sure to run `make lint` from time to time to ensure that the changes follow the Node.js code style guide. Any documentation you write (including code comments and API documentation) -should follow the [Style Guide](doc/STYLE_GUIDE.md). +should follow the [Style Guide](doc/STYLE_GUIDE.md). Code samples included +in the API docs will also be checked when running `make lint` (or +`vsbuild.bat lint` on Windows). #### Step 4: Commit @@ -457,7 +459,7 @@ $ git push --force-with-lease origin my-branch ``` **Important:** The `git push --force-with-lease` command is one of the few ways -to delete history in git. Before you use it, make sure you understand the risks. +to delete history in `git`. Before you use it, make sure you understand the risks. If in doubt, you can always ask for guidance in the Pull Request or on [IRC in the #node-dev channel](https://webchat.freenode.net?channels=node-dev&uio=d4). @@ -582,6 +584,14 @@ If you want to know more about the code review and the landing process, you can take a look at the [collaborator's guide](https://github.com/nodejs/node/blob/master/COLLABORATOR_GUIDE.md). +### Helpful Resources + +The following additional resources may be of assistance: + +* [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) +* [core-validate-commit](https://github.com/evanlucas/core-validate-commit) - + A utility that ensures commits follow the commit formatting guidelines. + ## Developer's Certificate of Origin 1.1 From 89f13de5a0a399c427547203275090983bc5ce64 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 15:15:55 -0700 Subject: [PATCH 06/17] [Squash] Nit --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 536d6e7b34a234..10712e9f6f0815 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -248,7 +248,7 @@ time to ensure that the changes follow the Node.js code style guide. Any documentation you write (including code comments and API documentation) should follow the [Style Guide](doc/STYLE_GUIDE.md). Code samples included in the API docs will also be checked when running `make lint` (or -`vsbuild.bat lint` on Windows). +`vcbuild.bat lint` on Windows). #### Step 4: Commit From ce0840359966e937a82a4045aff1e2f70b893703 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 15:17:03 -0700 Subject: [PATCH 07/17] [Squash] Nit --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10712e9f6f0815..517a51b2cc3c46 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,7 @@ Node.js project's core `nodejs/node` GitHub Repository. * [CI Testing](#ci-testing) * [Waiting Until the Pull Request Gets Landed](#waiting-until-the-pull-request-gets-landed) * [Check Out the Collaborator's Guide](#check-out-the-collaborators-guide) + * [Helpful Resources](#helpful-resources) * [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin-11) ## Code of Conduct From daf0847cde8a029d16993a1a9ba4205cf7225820 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 16:44:33 -0700 Subject: [PATCH 08/17] [Squash] Pull in specific details of review process, define bad actors One of the most significant bits of feedback I have received with regards to our contribution process is that they have no idea what to expect during the review process. We cover this in detail in the onboarding guide for new collaborators but it makes far more sense to have it in the contribution guide. --- CONTRIBUTING.md | 175 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 172 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 517a51b2cc3c46..4066b1b6d8e46b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,8 @@ good faith both with other contributors and with the community. No contribution is too small and all contributions are valued. This guide details the basic steps for getting started contributing to the -Node.js project's core `nodejs/node` GitHub Repository. +Node.js project's core `nodejs/node` GitHub Repository and describes what to +expect throughout each step of the process. * [Code of Conduct](#code-of-conduct) * [Issues](#issues) @@ -67,6 +68,22 @@ Open, diverse and inclusive communities live and die on the basis of trust. Contributors can disagree with one another so long as they trust that those disagreements are in good faith and everyone is working towards a common goal. +### Bad actors + +A *bad actor* is someone who repeatedly violates the *spirit* of the Code of +Conduct through consistent failure to self-regulate the way in which they +interact with other contributors in the project. In so doing, bad actors +alienate other contributors, discourage collaboration, and generally reflect +poorly on the project as a whole. + +Being a bad actor may be intentional or unintentional. Typically, unintentional +bad behavior can be easily corrected by being quick to apologize and correct +course *even if you are not entirely convinced you need to*. Giving other +contributors the benefit of the doubt and have a sincere willingness to admit +that you *might* be wrong is critical for any successful open collaboration. + +Don't be a bad actor. + ## Issues Issues 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. Any documentation you write (including code comments and API documentation) should follow the [Style Guide](doc/STYLE_GUIDE.md). Code samples included -in the API docs will also be checked when running `make lint` (or +in the API docs will also be checked when running `make lint` (or `vcbuild.bat lint` on Windows). #### Step 4: Commit @@ -530,6 +547,156 @@ contributor to make the pull request better. Reviews that are dismissive or disrespectful of the contributor or any other reviewers are strictly counter to the [Code of Conduct][]. +When reviewing a pull request, the primary goals are for the codebase to improve +and for the person submitting the request to succeed. Even if a pull request +does not land, the submitters should come away from the experience feeling like +their effort was not wasted or unappreciated. Every pull request from a new +contributor is an opportunity to grow the community. + +#### Review a bit at a time. + +Do not overwhelm new contributors. + +It is tempting to micro-optimize and make everything about relative performance, +perfect grammar, or exact style matches. Do not succumb to that temptation. + +Focus first on the most significant aspects of the change: + +1. Does this change make sense for Node.js? +2. Does this change make Node.js better, even if only incrementally? +3. Are there clear bugs or larger scale issues that need attending to? + +When changes are necessary, *request* them, do not *demand* them, and do not +assume that the submitter already knows how to add a test or run a benchmark. + +Specific performance optimization techniques, coding styles and conventions +change over time. The first impression you give to a new contributor never does. + +Nits (requests for small changes that are not essential) are fine, but try to +avoid stalling the pull request. Most nits can typically be fixed by the +Node.js Collaborator landing the pull request but they can also be an +opportunity for the contributor to learn a bit more about the project. + +It is always good to clearly indicate nits when you comment: e.g. +`Nit: change foo() to bar(). But this is not blocking.` + +#### Be aware of the person behind the code + +Be aware that *how* you communicate requests and reviews in your feedback can +have a significant impact on the success of the pull request. Yes, we may land +a particular change that makes Node.js better, but the individual might just +not want to have anything to do with Node.js every again. The goal is not just +having good code. + +#### Respect the minimum wait time for comments + +There is a minimum waiting time which we try to respect for non-trivial +changes, so that people who may have important input in such a distributed +project are able to respond. + +For non-trivial changes, pull requests must be left open for *at least* 48 +hours during the week, and 72 hours on a weekend. In most cases, when the +PR is relatively small and focused on a narrow set of changes, these periods +provide more than enough time to adequately review. Sometimes changes take far +longer to review, or need more specialized review from subject matter experts. +When in doubt, do not rush. + +Trivial changes, typically limited to small formatting changes or fixes to +documentation, may be landed within the minimum 48 hour window. + +#### Abandoned or Stalled Pull Requests + +If a pull request appears to be abandoned or stalled, it is polite to first +check with the contributor to see if they intend to continue the work before +checking if the they would mind if you took it over (especially if it just has +nits left). When doing so, it is courteous to give the original contributor +credit for the work they started. + +#### Approving a change + +Any Node.js core Collaborator (any GitHub user with commit rights in the +`nodejs/node` repository) is authorized to approve any other contributor's +work. Collaborators are not permitted to approve their own pull requests. + +Collaborators indicate that they have reviewed and approve of the changes in +a pull request either by using GitHub's Approval Workflow, which is preferred, +or by leaving an `LGTM` ("Looks Good To Me") comment. + +When explicitly using the "Changes requested" component of the GitHub Approval +Workflow, show empathy. That is, do not be rude or abrupt with your feedback +and offer concrete suggestions for improvement, if possible. If you're not +sure *how* a particular change can be improved, say so. + +Most importantly, after leaving such requests, it is courteous to make yourself +available later to check whether your comments have been addressed. + +If you see that requested changes have been made, you can clear another +collaborator's `Changes requested` review. + +Change requests that are vague, dismissive, or unconstructive may also be +dismissed if requests for greater clarification go unanswered within a +reasonable period of time. + +If you do not believe that the pull request should land at all, use +`Changes requested` to indicate that you are considering some of your comments +to block the PR from landing. When doing so, explain *why* you believe the +pull request should not land along with an explanation of what may be an +acceptable alternative course, if any. + +#### Accept that there are different opinions about what belongs in Node.js + +Opinions on this vary, even among the members of the Technical Steering +Committee. + +One general rule of thumb is that if Node.js itself needs it (due to historic +or functional reasons), then it belongs in Node.js. For instance, `url` +parsing is in Node.js because of HTTP protocol support. + +Also, functionality that either cannot be implemented outside of core in any +reasonable way, or only with significant pain. + +It is not uncommon for contributors to suggest new features they feel would +make Node.js better. These may or may not make sense to add, but as with all +changes, be courteous in how you communicate your stance on these. Comments +that make the contributor feel like they should have "known better" or +ridiculed for even trying run counter to the [Code of Conduct][]. + +#### Performance isn't everything + +Node.js has always optimized for speed of execution. If a particular change +can be shown to make some part of Node.js faster, it's quite likely to be +accepted. Claims that a particular code request will make things faster will +almost always be met by requests for performance benchmark results that +demonstrate the improvement. + +That said, performance is not the only factor to consider. Node.js also +optimizes in favor of not breaking existing code in the ecosystem, and not +changing working functional code just for the sake of changing. + +If a particular pull request introduces a performance or functional +regression, rather than simply rejecting the pull request, take the time to +work *with* the contributor on improving the change. Offer feedback and +advice on what would make the pull request acceptable, and do not assume that +the contributor should already know how to do that. Be explicit in your +feedback. + +#### Continuous Integration (CI) Testing: + +All pull requests that contain changes to code must be run through +continuous integration (CI) testing at [https://ci.nodejs.org/][]. + +Only Node.js core Collaborators with commit rights to the `nodejs/node` +repository may start a CI testing run. The specific details of how to do +this are included in the new Collaborator [Onboarding guide][]. + +Ideally, the code change will pass ("be green") on all platform configurations +supported by Node.js (there are over 30 platform configurations currently). +This means that all tests pass and there are no linting errors. In reality, +however, it is not uncommon for the CI infrastructure itself to fail on +specific platforms or for so-called "flaky" tests to fail ("be red"). It is +vital to visually inspect the results of all failed ("red") tests to determine +whether the failure was caused by the changes in the pull request. + ## Additional Notes ### Commit Squashing @@ -590,7 +757,7 @@ you can take a look at the The following additional resources may be of assistance: * [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) -* [core-validate-commit](https://github.com/evanlucas/core-validate-commit) - +* [core-validate-commit](https://github.com/evanlucas/core-validate-commit) - A utility that ensures commits follow the commit formatting guidelines. @@ -629,3 +796,5 @@ By making a contribution to this project, I certify that: [approved]: #getting-approvals-for-your-pull-request [CI (Continuous Integration) test run]: #ci-testing [notes about the waiting time]: #waiting-until-the-pull-request-gets-landed +[https://ci.nodejs.org/]: https://ci.nodejs.org/ +[Onboarding guide]: ./docs/onboarding.md From 7112e6ab9f80f2f61e2f6a5acf18a4457de90440 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 16:55:24 -0700 Subject: [PATCH 09/17] [Squash] Further clarification --- CONTRIBUTING.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4066b1b6d8e46b..ae1d076f34cd6c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ expect throughout each step of the process. * [Step 6: Test](#step-6-test) * [Step 7: Push](#step-7-push) * [Step 8: Opening the Pull Request](#step-8-opening-the-pull-request) - * [Step 9: Discuss and Upadte](#step-9-discuss-and-update) + * [Step 9: Discuss and Update](#step-9-discuss-and-update) * [Approval and Request Changes Workflow](#approval-and-request-changes-workflow) * [Step 10: Landing](#step-10-landing) * [Reviewing Pull Requests](#reviewing-pull-requests) @@ -70,6 +70,10 @@ disagreements are in good faith and everyone is working towards a common goal. ### Bad actors +All contributors to Node.js tacitly agree to abide by both the letter and +spirit of the [Code of Conduct][]. Failure, or unwillingness, to do so will +result in contributions being respectfully declined. + A *bad actor* is someone who repeatedly violates the *spirit* of the Code of Conduct through consistent failure to self-regulate the way in which they interact with other contributors in the project. In so doing, bad actors @@ -221,7 +225,7 @@ These are detailed in the [Building guide][]. Once you have `git` and are sure you have all of the necessary dependencies, it's time to create a fork. -Before getting started, it is recommend to configure `git` so that it knows +Before getting started, it is recommended to configure `git` so that it knows who you are: ```text @@ -348,14 +352,14 @@ $ git fetch upstream $ git rebase upstream/master ``` -The ensures that your working branch has the latest changes from `nodejs/node` +This ensures that your working branch has the latest changes from `nodejs/node` master. #### Step 6: Test Bug fixes and features should always come with tests. A [guide for writing tests in Node.js](./doc/guides/writing-tests.md) has been -provided to make the proces easier. Looking at other tests to see how they +provided to make the process easier. Looking at other tests to see how they should be structured can also help. The `test` directory within the `nodejs/node` repository is complex and it is @@ -477,9 +481,9 @@ $ git push --force-with-lease origin my-branch ``` **Important:** The `git push --force-with-lease` command is one of the few ways -to delete history in `git`. Before you use it, make sure you understand the risks. -If in doubt, you can always ask for guidance in the Pull Request or on -[IRC in the #node-dev channel](https://webchat.freenode.net?channels=node-dev&uio=d4). +to delete history in `git`. Before you use it, make sure you understand the +risks. If in doubt, you can always ask for guidance in the Pull Request or on +[IRC in the #node-dev channel][]. If you happen to make a mistake in any of your commits, do not worry. You can amend the last commit (for example if you want to change the commit log). @@ -503,7 +507,7 @@ seem unfamiliar, refer to this All pull requests require "sign off" in order to land. Whenever a contributor reviews a pull request they may find specific details that they would like to see changed or fixed. These may be as simple as fixing a typo, or may involve -substantive changes to the code you have written. In general, such request +substantive changes to the code you have written. In general, such requests are intended to be helpful, but at times may come across as abrupt or unhelpful, especially requests to change things that do not include concrete suggestions on *how* to change them. @@ -798,3 +802,4 @@ By making a contribution to this project, I certify that: [notes about the waiting time]: #waiting-until-the-pull-request-gets-landed [https://ci.nodejs.org/]: https://ci.nodejs.org/ [Onboarding guide]: ./docs/onboarding.md +[IRC in the #node-dev channel]: https://webchat.freenode.net?channels=node-dev&uio=d4 From 37658eba5c240fd1f707ebf13aef59f3145d07ed Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 17:00:11 -0700 Subject: [PATCH 10/17] [Squash] update ToC --- CONTRIBUTING.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae1d076f34cd6c..109027b2d7603e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,7 @@ Node.js project's core `nodejs/node` GitHub Repository and describes what to expect throughout each step of the process. * [Code of Conduct](#code-of-conduct) + * [Bad Actors](#bad-actors) * [Issues](#issues) * [Asking for General Help](#asking-for-general-help) * [Discussing non-technical topics](#discussing-non-technical-topics) @@ -37,6 +38,14 @@ expect throughout each step of the process. * [Approval and Request Changes Workflow](#approval-and-request-changes-workflow) * [Step 10: Landing](#step-10-landing) * [Reviewing Pull Requests](#reviewing-pull-requests) + * [Review a bit at a time](#review-a-bit-at-a-time) + * [Be aware of the person behind the code](#be-aware-of-the-person-behind-the-code) + * [Respect the minimum wait time for comments](#respect-the-minimum-wait-time-for-comments) + * [Abandoned or Stalled Pull Requests](#abandoned-or-stalled-pull-requests) + * [Approving a change](#approving-a-change) + * [Accept that there are different opinions about what belongs in Node.js](#accept-that-there-are-different-opinions-about-what-belongs-in-node-js) + * [Performance is not everything](#performance-is-not-everything) + * [Continuous Integration (CI) Testing](#continuous-integration-testing) * [Additional Notes](#additional-notes) * [Commit Squashing](#commit-squashing) * [Getting Approvals for your Pull Request](#getting-approvals-for-your-pull-request) @@ -665,7 +674,7 @@ changes, be courteous in how you communicate your stance on these. Comments that make the contributor feel like they should have "known better" or ridiculed for even trying run counter to the [Code of Conduct][]. -#### Performance isn't everything +#### Performance is not everything Node.js has always optimized for speed of execution. If a particular change can be shown to make some part of Node.js faster, it's quite likely to be @@ -684,7 +693,7 @@ advice on what would make the pull request acceptable, and do not assume that the contributor should already know how to do that. Be explicit in your feedback. -#### Continuous Integration (CI) Testing: +#### Continuous Integration Testing All pull requests that contain changes to code must be run through continuous integration (CI) testing at [https://ci.nodejs.org/][]. From c30e05b21b4b36ce10cdd21fe15dc18ca71773cc Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 17:02:54 -0700 Subject: [PATCH 11/17] [Squash] typo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 109027b2d7603e..d33bdb8a487a80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,7 +92,7 @@ poorly on the project as a whole. Being a bad actor may be intentional or unintentional. Typically, unintentional bad behavior can be easily corrected by being quick to apologize and correct course *even if you are not entirely convinced you need to*. Giving other -contributors the benefit of the doubt and have a sincere willingness to admit +contributors the benefit of the doubt and having a sincere willingness to admit that you *might* be wrong is critical for any successful open collaboration. Don't be a bad actor. From 4969cee897aece2ccec4a6732444568aa54bca97 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 17:07:22 -0700 Subject: [PATCH 12/17] [Squash] nits --- CONTRIBUTING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d33bdb8a487a80..a2a9821aea4f57 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,7 +85,7 @@ result in contributions being respectfully declined. A *bad actor* is someone who repeatedly violates the *spirit* of the Code of Conduct through consistent failure to self-regulate the way in which they -interact with other contributors in the project. In so doing, bad actors +interact with other contributors in the project. In doing so, bad actors alienate other contributors, discourage collaboration, and generally reflect poorly on the project as a whole. @@ -194,7 +194,7 @@ reach the correct outcome much faster. In the vast majority of cases, issues are resolved by opening a pull request. The process for opening and reviewing a pull request is similar to that of -opening and triaging issues but carries with in a necessary review and approval +opening and triaging issues, but carries with in a necessary review and approval workflow that ensures that the proposed changes meet the minimal quality and functional guidelines of the Node.js project. @@ -345,7 +345,7 @@ Refs: http://eslint.org/docs/rules/space-in-parens.html ``` If you are new to contributing to Node.js, please try to do your best at -conforming to these guidelines but do not worry if you get something wrong. +conforming to these guidelines, but do not worry if you get something wrong. One of the existing contributors will help get things situated and the contributor landing the pull request will ensure that everything follows the project guidelines. @@ -504,7 +504,7 @@ $ git push --force-with-lease origin my-branch ``` There are a number of more advanced mechanisms for managing commits using -`git rebase` that can be used but are beyond the scope of this guide. +`git rebase` that can be used, but are beyond the scope of this guide. Feel free to post a comment in the Pull Request to ping reviewers if you are awaiting an answer on something. If you encounter words or acronyms that @@ -678,7 +678,7 @@ ridiculed for even trying run counter to the [Code of Conduct][]. Node.js has always optimized for speed of execution. If a particular change can be shown to make some part of Node.js faster, it's quite likely to be -accepted. Claims that a particular code request will make things faster will +accepted. Claims that a particular pull request will make things faster will almost always be met by requests for performance benchmark results that demonstrate the improvement. From 384690ed54d72136a5c6881c076e2d28288508d6 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Aug 2017 17:09:40 -0700 Subject: [PATCH 13/17] [Squash] nits --- CONTRIBUTING.md | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a2a9821aea4f57..0ca9f407959b4b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -192,8 +192,8 @@ reach the correct outcome much faster. ### Resolving a Bug Report -In the vast majority of cases, issues are resolved by opening a pull request. -The process for opening and reviewing a pull request is similar to that of +In the vast majority of cases, issues are resolved by opening a Pull Request. +The process for opening and reviewing a Pull Request is similar to that of opening and triaging issues, but carries with in a necessary review and approval workflow that ensures that the proposed changes meet the minimal quality and functional guidelines of the Node.js project. @@ -268,7 +268,7 @@ $ git checkout -b my-branch -t origin/master #### Step 3: Code -The vast majority of pull requests opened against the `nodejs/node` +The vast majority of Pull Requests opened against the `nodejs/node` repository includes changes to either the C/C++ code contained in the `src` directory, the JavaScript code contained in the `lib` directory, the documentation in `docs/api` or tests within the `test` directory. @@ -285,7 +285,7 @@ in the API docs will also be checked when running `make lint` (or It is a recommended best practice to keep your changes as logically grouped as possible within individual commits. There is no limit to the number of -commits any single pull request may have, and many contributors find it easier +commits any single Pull Request may have, and many contributors find it easier to review changes that are split across multiple commits. ```text @@ -347,7 +347,7 @@ Refs: http://eslint.org/docs/rules/space-in-parens.html If you are new to contributing to Node.js, please try to do your best at conforming to these guidelines, but do not worry if you get something wrong. One of the existing contributors will help get things situated and the -contributor landing the pull request will ensure that everything follows +contributor landing the Pull Request will ensure that everything follows the project guidelines. #### Step 5: Rebase @@ -376,7 +376,7 @@ often not clear where a new test file should go. When in doubt, add new tests to the `test/parallel/` directory and the right location will be sorted out later. -Before submitting your changes in a pull request, always run the full Node.js +Before submitting your changes in a Pull Request, always run the full Node.js test suite. To run the tests (including code linting) on Unix / macOS: ```text @@ -423,7 +423,7 @@ the `lib` or `src` directories. #### Step 7: Push Once you are sure your commits are ready to go, with passing tests and linting, -begin the process of opening a pull request by pushing your working branch to +begin the process of opening a Pull Request by pushing your working branch to your fork on GitHub. ```text @@ -437,7 +437,7 @@ that should be filled out: ```markdown ``` -Please try to do your best at filling out the details but feel free to skip +Please try to do your best at filling out the details, but feel free to skip parts if you're not sure what to put. Once opened, Pull Requests are usually reviewed within a few days. From 122e36f89fe13d562435e461103138d1bd05b117 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 1 Sep 2017 07:14:19 -0700 Subject: [PATCH 15/17] [Squash] Nits --- CONTRIBUTING.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7d940a12383bc..c5ec20e471879d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,9 +43,9 @@ expect throughout each step of the process. * [Respect the minimum wait time for comments](#respect-the-minimum-wait-time-for-comments) * [Abandoned or Stalled Pull Requests](#abandoned-or-stalled-pull-requests) * [Approving a change](#approving-a-change) - * [Accept that there are different opinions about what belongs in Node.js](#accept-that-there-are-different-opinions-about-what-belongs-in-node-js) + * [Accept that there are different opinions about what belongs in Node.js](#accept-that-there-are-different-opinions-about-what-belongs-in-nodejs) * [Performance is not everything](#performance-is-not-everything) - * [Continuous Integration (CI) Testing](#continuous-integration-testing) + * [Continuous Integration Testing](#continuous-integration-testing) * [Additional Notes](#additional-notes) * [Commit Squashing](#commit-squashing) * [Getting Approvals for your Pull Request](#getting-approvals-for-your-pull-request) @@ -194,7 +194,7 @@ reach the correct outcome much faster. In the vast majority of cases, issues are resolved by opening a Pull Request. The process for opening and reviewing a Pull Request is similar to that of -opening and triaging issues, but carries with in a necessary review and approval +opening and triaging issues, but carries with it a necessary review and approval workflow that ensures that the proposed changes meet the minimal quality and functional guidelines of the Node.js project. @@ -547,8 +547,8 @@ your name on it. Congratulations and thanks for your contribution! ### Reviewing Pull Requests -All Node.js contributors who choose to review and provide feedback on pull -requests have a responsibility both the project and the individual making the +All Node.js contributors who choose to review and provide feedback on Pull +Requests have a responsibility both the project and the individual making the contribution. Reviews and feedback must be helpful, insightful, and geared towards improving the contribution as opposed to simply blocking it or stopping it. If there are reasons why you feel the PR should not land, explain @@ -621,7 +621,7 @@ documentation, may be landed within the minimum 48 hour window. If a Pull Request appears to be abandoned or stalled, it is polite to first check with the contributor to see if they intend to continue the work before -checking if the they would mind if you took it over (especially if it just has +checking if they would mind if you took it over (especially if it just has nits left). When doing so, it is courteous to give the original contributor credit for the work they started. @@ -679,7 +679,7 @@ ridiculed for even trying run counter to the [Code of Conduct][]. Node.js has always optimized for speed of execution. If a particular change can be shown to make some part of Node.js faster, it's quite likely to be accepted. Claims that a particular Pull Request will make things faster will -almost always be met by requests for performance benchmark results that +almost always be met by requests for performance [benchmark results][] that demonstrate the improvement. That said, performance is not the only factor to consider. Node.js also @@ -800,15 +800,16 @@ By making a contribution to this project, I certify that: maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -[Code of Conduct]: https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md -[Node.js help repository]: https://github.com/nodejs/help/issues -[Technical Steering Committee (TSC) repository]: https://github.com/nodejs/TSC/issues -[Building guide]: ./BUILDING.md -[on GitHub]: https://github.com/nodejs/node -[guide for writing tests in Node.js]: ./doc/guides/writing-tests.md [approved]: #getting-approvals-for-your-pull-request +[benchmark results]: ./doc/guides/writing-and-running-benchmarks.md +[Building guide]: ./BUILDING.md [CI (Continuous Integration) test run]: #ci-testing -[notes about the waiting time]: #waiting-until-the-pull-request-gets-landed +[Code of Conduct]: https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md +[guide for writing tests in Node.js]: ./doc/guides/writing-tests.md [https://ci.nodejs.org/]: https://ci.nodejs.org/ -[Onboarding guide]: ./docs/onboarding.md [IRC in the #node-dev channel]: https://webchat.freenode.net?channels=node-dev&uio=d4 +[Node.js help repository]: https://github.com/nodejs/help/issues +[notes about the waiting time]: #waiting-until-the-pull-request-gets-landed +[Onboarding guide]: ./doc/onboarding.md +[on GitHub]: https://github.com/nodejs/node +[Technical Steering Committee (TSC) repository]: https://github.com/nodejs/TSC/issues From 3a76fdf75367256f9596321bf3d8d40988d813c4 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 1 Sep 2017 08:42:02 -0700 Subject: [PATCH 16/17] [Squash] Nits --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5ec20e471879d..150e7932dfc19d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -527,7 +527,7 @@ input. Often such comments are the result of the reviewer having only taken a short amount of time to review and are not ill-intended. Such issues can often be resolved with a bit of patience. That said, reviewers should be expected to be helpful in their feedback, and feedback that is simply vague, dismissive and -helpful is likely safe to ignore. +unhelpful is likely safe to ignore. #### Step 10: Landing @@ -548,7 +548,7 @@ your name on it. Congratulations and thanks for your contribution! ### Reviewing Pull Requests All Node.js contributors who choose to review and provide feedback on Pull -Requests have a responsibility both the project and the individual making the +Requests have a responsibility to both the project and the individual making the contribution. Reviews and feedback must be helpful, insightful, and geared towards improving the contribution as opposed to simply blocking it or stopping it. If there are reasons why you feel the PR should not land, explain From 880c2f31a84fe2ef26b45fb04bc47a0da3080d3d Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 6 Sep 2017 15:09:04 -0700 Subject: [PATCH 17/17] [Squash] Nits --- CONTRIBUTING.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 150e7932dfc19d..26b083b867395d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,7 +65,7 @@ As a contributor to Node.js, how you choose to act and interact towards your fellow contributors, as well as to the community, will reflect back not only on yourself but on the project as a whole. The Code of Conduct is designed and intended, above all else, to help establish a culture within the project that -allows anyone and everyone who wants to continue to feel safe doing so. +allows anyone and everyone who wants to contribute to feel safe doing so. Should any individual act in any way that is considered in violation of the [Code of Conduct][], corrective actions will be taken. It is possible, however, @@ -261,7 +261,7 @@ possible, create local branches to work within. These should also be created directly off of the `master` branch. ```text -$ git checkout -b my-branch -t origin/master +$ git checkout -b my-branch -t upstream/master ``` ### The Process of Making Changes @@ -598,7 +598,7 @@ It is always good to clearly indicate nits when you comment: e.g. Be aware that *how* you communicate requests and reviews in your feedback can have a significant impact on the success of the Pull Request. Yes, we may land a particular change that makes Node.js better, but the individual might just -not want to have anything to do with Node.js every again. The goal is not just +not want to have anything to do with Node.js ever again. The goal is not just having good code. #### Respect the minimum wait time for comments @@ -623,7 +623,9 @@ If a Pull Request appears to be abandoned or stalled, it is polite to first check with the contributor to see if they intend to continue the work before checking if they would mind if you took it over (especially if it just has nits left). When doing so, it is courteous to give the original contributor -credit for the work they started. +credit for the work they started (either by preserving their name and email +address in the commit log, or by using an `Author: ` meta-data tag in the +commit. #### Approving a change