-
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).
- Check that branch is up-to-date with the main branch (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 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 the main branch (see below).
- If the reviewer is requesting changes, the request changes option in the review should be selected 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 the main branch:
- Check out the most recent version of the branch.
- Check that all tests pass in this version (sanity check).
- Commit these changes and push branch to GitHub (Commit message should include the pull request number).
- On the pull-request page on GitHub, request the branch be merged to the main branch. Use Squash and merge option.
- Check out the latest main 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).