Skip to content

Latest commit

 

History

History
executable file
·
523 lines (288 loc) · 21.8 KB

merge-requests.md

File metadata and controls

executable file
·
523 lines (288 loc) · 21.8 KB

Reviewing Pull Requests

git-pull-request Pull Requests present the best opportunity to interact with the community and gain contributor loyalty. Therefore, it's important that Pull Requests are well-reviewed before being merged and that interactions on Pull Requests are positive.

Who Can Review Pull Requests

Specifically, if someone can view Pull Requests, they should be allowed and encouraged to comment on Pull Requests.

Reviewing a Pull Request

Tip! Read "The ultimate guide to code reviews" PDF file for more efficient, objective, and positive Pull Requests.

When a Pull Request is opened, either an automated bot like Zappr (ideally) or a human should validate the following:

  1. Is the commit message summary in the correct format?
  2. Is the commit summary too long?

Invalid commit message validation

The validator should then add a comment specifying the problems that it finds. You do not need to look at the Pull Request any further until those problems have been addressed (there's no need to comment on the Pull Request to ask the submitter to do what the bot asked - that's why we have the bot!).

Evaluating changes

Once the bot checks have been satisfied, you check the following:

  1. Double-check that the commit message tag ("fix(<scope>):", "feat(<scope>):", etc.) is correct based on the issue (or, if no issue is referenced, based on the stated problem).

  2. If the Pull Request makes a change to core, ensure that an issue exists and the Pull Request references the issue in the commit message.

  3. Does the code follow our conventions (including header comments, JSDoc comments, etc.)? If not, please leave that feedback and reference the conventions document.

  4. For code changes:

    • Are there tests that verify the change? If not, please ask for them.

    • Is documentation needed for the change? If yes, please let the submitter know.

  5. Are there any automated testing errors? If yes, please ask the submitter to check on them.

  6. If you've reviewed the Pull Request and there are no outstanding issues, leave a comment "LGTM" to indicate your approval. If you would like someone else to verify the change, comment "LGTM but would like someone else to verify."

Note: If you are a team member and you've left a comment on the Pull Request, please follow up to verify that your comments have been addressed.

Who Can Merge a Pull Request

PMC Members and Maintainers may merge Pull Requests, depending on the contents of the Pull Request.

Committers may merge a Pull Request if it is a non-breaking change and is:

  1. A documentation change

  2. A defect fix (for either rules or core)

  3. A dependency upgrade

  4. Related to the build tool

  5. A chore

In addition, committers may merge any non-breaking Pull Request if it has been approved by at least one PMC member.

PMC members may merge all Pull Requests, including those that committers may merge.

When to Pull a Pull Request

We use the Squash and Merge button to merge requests into the repository. Before merging a Pull Request, verify that:

  1. All comments have been addressed

  2. Any team members who made comments have verified that their concerns were addressed

  3. All automated tests are passing (never merge a Pull Request with failing tests)

Be sure to say thank you to the submitter before merging, especially if they put a lot of work into the Pull Request.

Team members may merge a Pull Request immediately if it:

  1. Makes a small documentation change

  2. Is a chore

  3. Fixes a block of other work on the repository (build-related, test-related, dependency-related, etc.)

  4. Is an important fix to get into a patch release

Otherwise, team members should observe a waiting period before merging a Pull Request:

  • Wait 2 days if the Pull Request was opened Monday through Friday.
  • Wait 3 days if the Pull Request was opened on Saturday or Sunday.

The waiting period ensures that other team members have a chance to review the Pull Request before it is merged.

If the Pull Request was created from a branch on the eslint/eslint repository (as opposed to a fork), delete the branch after merging the Pull Request. (GitHub will display a "Delete branch" button after the Pull Request is merged.)


Stop! You should not merge your own Pull Request unless you've received feedback from at least one other team member.


When to Close a Pull Request

There are several times when it's appropriate to close a Pull Request without merging:

  1. The Pull Request addresses an issue that is already fixed
  2. The Pull Request hasn't been updated in 30 days
  3. The Pull Request submitter isn't willing to follow project guidelines.

In any of these cases, please be sure to leave a comment stating why the Pull Request is being closed.

Example Closing Comments

Abandoned Pull Requests

If a Pull Request hasn't been updated in 30 days, apply the label status: abandoned and submit a comment message like:

Closing because there hasn't been activity for 30 days. If you're still interested in submitting this code, please feel free to resubmit.

Incompliant Contributors

If a Pull Request submitter isn't willing to follow project guidelines, apply the label status: rejected and submit a comment like:

Unfortunately, we can't accept Pull Requests that don't follow our guidelines. I'm going to close this Pull Request now, but if you'd like to resubmit following our guidelines, we'll be happy to review.