-
Notifications
You must be signed in to change notification settings - Fork 2
CodeReview
In order to request a code review you must create a pull request (PR) on GitHub.
Once you are happy that your PR is ready for review please give it the "ready for review" label and request a review from one or more people: Andy [andrewcoughtrie
], Maff [mo-mglover
] or Iva [TeranIvy
]. Although you can request a review from multiple people, only one review actually needs to be performed.
A review is performed in GitHub by creating comments on points in the code that need attention. The PR author may respond to these comments and the result is a 'conversation'. It is up to the reviewer to decide when a conversation can be marked as 'resolved' (i.e. the point has been dealt with to their satisfaction).
- Replace the "ready for review" label on the PR with the "under review" label. This helps to prevent multiple people attempting to review the same thing and also makes it clear at what stage in the workflow the PR is.
- Check that branch is up-to-date with master (the pull request should report that the branch can be "merged automatically"). If not, return to developer for them to bring it up-to-date (this can be done when requesting changes).
- Check that there are no TODOs in the code that refer to the current issue/PR.
- Use the "Files changed" tab on the pull request to review all code changes. Check that all code modifications are well commented, easy to understand and that the code is correct. Comments and requests for changes may be made in-line on the "Files changed" tab. This makes it easier for the developer to see which part of the code is being discussed.
- If there are suggested or/and requested code changes then return the PR developer to address the review remarks.
- Check that the copyright/author details are correct in any modified files.
Once the review is complete there are two options:
- If the reviewer is happy with the pull request then they can proceed to merge the branch onto master (see below).
- If the reviewer is requesting changes, then the "under review" label on the PR should be replaced by "reviewed with actions" and it is then up to the original developer to address the reviewer's concerns.
Once a pull request has passed code review, the code reviewer should merge the associated branch onto master:
- Check out the most recent version of the branch.
- Check that all tests pass in this version (sanity check).
- Update the
CHANGELOG.md
in the top-level directory (using the text describing the Issue or PR). - Commit these changes and push branch to GitHub.
- On the pull-request page on GitHub, request the branch be merged to master. Use Squash and merge option.
- Check out the latest master branch and check that all tests still pass!
- Delete the original branch.
- If there is an Issue associated with the pull request, close it (note, this can be done automatically by linking the pull request to the associated issue).