Skip to content

Task 4 — Conducting a Code Review

James edited this page Jul 11, 2023 · 3 revisions

Code reviews are an opportunity for other team members to read over your changes before they are merged into main, helping to catch any problems before they have a chance to break things.

Although pull request authors can't approve their own pull requests (that'd be cheeky), we can simulate the process.

  1. From the pull request, click on the Files changed button below the title.
  1. Examine the diffs that are being shown to you—this page shows everything that has changed between the branch being merged (readme-name) and the branch being merged into (main).

    💡 Note
    If you are unsatisfied with something, you can click on the specific line and leave a comment to request changes before merging.

  1. Once you are satisfied, click the Review changes button in the top right, select Comment, and leave an approval comment.

    💡 Note
    As you'd expect, you'd usually click Approve if you weren't the pull request author.

  1. Click Submit review.

  2. Once you are returned to the pull request, click Merge pull request, followed by Confirm merge.

  1. Switch to the main branch, pull any changes (if you are checking from your local machine), and check README.md—you should now see your name!

This process might seem like a bit of a hassle, and, for such a simple change, it is—but consider working in a team with multiple developers all working on their own tasks, changing the same files—it would very quickly devolve into a nightmare.

🎉 Congratulations!
You have just completed your first code review, and merged your first branch!

Clone this wiki locally