Reference Guide: Conducting a Code Review
Tags: codenewbie, beginners, webdev, productivity
Published: 2018-12-26 21:35:42

---
cover_image: https://www.albert.io/blog/wp-content/uploads/2016/04/Early-Action-vs.-Early-Decision-What-to-Do.png
title: Reference Guide: Conducting a Code Review
published: true
description: A reference guide series for new web developers. 
tags: #codenewbie #beginners #webdev #productivity
---
Code review is the process of reviewing and approving code changes for collaborators, someone other than the author of the pushed changes. It's basically code inspections conducted by peers working on the same project with a protected master branch. For more details on the code review process and benefits check out my post [here](https://dev.to/kymiddleton/what-is-a-code-review-4gpa). 

When a notification has been received to review changes, go into GitHub and access the project repository. 

Select the `Pull requests` tab.
- A number next the `Pull requests` tab indicates the number of requests pending review.

![Pull Request](https://thepracticaldev.s3.amazonaws.com/i/xl26ylw2foiq6j1sixbg.jpeg)

Select the `Pull requests` from the listed items.

![Pull Request](https://thepracticaldev.s3.amazonaws.com/i/uvp32fzc0zfgjh2ag8qi.jpeg)

Once the `Pull requests` has been selected a new page will display several details:
- Number of commits to be merged
- Number of files changed
- Contributors branch name

Before continuing in GitHub, make note of the contributors `branch name` and return to the terminal.  Once inside the projects root directory:
- `git fetch origin <branch name>`
- `git checkout <branch name>`

From here, run the application to identify any potential issues. 

Go back to GitHub to review the code changes in the pull request.
- Select the `Commits` tab or the `Files changed` tab

![PR Commits](https://thepracticaldev.s3.amazonaws.com/i/j56m5ft0epyy6mhjk760.jpeg)

**`Commits` tab**

- This tab displays the history of the commits submitted for the specified pull request
- Each `commit` can be selected to review the progression of changes made

**`Files changed` tab**

This tab provides a side by side comparison of the file changes.  
- `New` changes are on the right-hand side highlighted in `green`.
- On the left-hand side, `old` changes are highlighted in `red` 

The next step of the process will be to complete the pull request review.  That process will provide the opportunity to make comments, approve the reviewed changes or request changes to be made before it can be approved.  Therefore, if any issues were identified when the application was checked out and run locally be sure to make notes of the specific issues identified.  If there is something noticeable when looking at the side by side view in the `Files changed` tab also be sure to mention specifics in the next step of the process [Complete and Merge a Pull Request](https://dev.to/kymiddleton/reference-guide-complete-and-merge-a-pull-request--12n4). 

For the completed Reference Guide Series: 
- [Part One:](https://dev.to/kymiddleton/reference-guide-common-commands-for-terminal-6no) Reference Guide: Common Commands for Terminal. 
- [Part two:](https://dev.to/kymiddleton/reference-guide-create-a-github-repository-30f8) Create a GitHub Repository
- [Part three:](https://dev.to/kymiddleton/reference-guide-committing-changes-43el) Committing Changes
- [Part four:](https://dev.to/kymiddleton/reference-guide-committing-changes-with-branches-2f8d) Committing Changes with Branches
-[Part five:]( https://dev.to/kymiddleton/reference-guide-merge-conflicts-6op) Merge Conflicts
- [Part six:](https://dev.to/kymiddleton/reference-guide-pull-requests-5an9) Pull Requests
- [Part seven:](https://dev.to/kymiddleton/reference-guide-conducting-a-code-review-k6m) Conducting a Code Review
-[Part eight:]( https://dev.to/kymiddleton/reference-guide-complete-and-merge-a-pull-request--12n4) Complete and Merge a Pull Request