The goal of this activity it to practice the code review process using Github pull requests.
In teams of 2-3:
- Select one student who will fork and add teammates as collaborators.
- Individually, clone the repository and select one (1) function from the list of functions to add.
- Individually, create a branch, write your function and tests (the code is provided), commit your changes, and push the branch up to the remote repository.
- For example: If Jaeda is working on the
merge_sorted_lists
function- They could create a branch named
jaeda/merge_sorted_lists
- Then write their code and tests
- Verify the code works by creating a virtual environment, installing the dependencies, and running the tests with
pytest
- Then use
git add
andgit commit
to commit their changes - Then use
git push origin jaeda/merge_sorted_lists
to push the branch up to Github
- They could create a branch named
- For example: If Jaeda is working on the
- Open a pull request and add your teammates as reviewers.
- As a team, review each pull request using Github, writing comments and suggestions.
- Specifically, look for:
- Style and readability issues
- Efficiency issues
- Testing Issues
- In addition, look for items to praise and learn from
- Specifically, look for:
In the Github repository, click on Pull requests and click on the pull request you want to review. Then select Files changed.
Fig. Selecting a PR to Review
Fig. Selecting Files Changed
Then we can click on the + sign to add comments to lines of code.
Fig. Using the + sign to comment on a line
Fig. Writing a comment
Finally, we will wrap up our review leaving a more general comment and Comment, Approve or Request Changes to submit.