Code Review and Git Merge Requests
Learning the workflow...

Getting started with git merge requests and code review workflows can be daunting. But as your projects grow, merge requests and code review can supercharge your development. Here are a few of the benefits:

  • Code reviews enable knowledge sharing across your team.
  • Code reviews encourage a more unified and consistent code base.
  • Code reviews enable better estimates.
  • Code reviews allow you to take more vacations
  • Code reviews save your team time in the long-run.

Unfuddle makes it very easy to get started with code review in your team. Let's look at how it works.

Git Branches

Code review starts with great task management. You are probably already keeping track of bugs and upcoming features in your products. But are you using git branches to empower your workflow? Many teams make code changes right in the master branch of their repositories. They then close the task and move on.

Bug and issue tracking in Unfuddle

Rather than working only in master, code review depends on branching. Before working on any new task, developers should first create a branch and make all modifications in that branch. When the work is complete, it's time to create a merge request.

Merge Requests

Merge requests give your team the opportunity to review and comment on the work BEFORE we allow a merge into the master branch.

Let's say we are working to resolve a bug in our product.

A task representing a bug

First, we create a branch called "12-bat-gloves-bug" and do all our work there. When we finish, we push our branch to the server. Then we create a merge request from the task in Unfuddle. We need only to specify the branch where we did our work.

Creating a merge request

Our task now has some new tabs that show the contents of the merge request. Our team members can now easily see that this task has an open merge request waiting for review.

An open merge request

It's time for the team to help out. Team members have the opportunity to review our code and comment. The team will be looking for these kinds of issues:

  • Does the code look right?
  • Does the code conform to the team's style guidelines?
  • Are there any obvious logical errors?
  • Does the code meet the requirements of the original specification?
  • Were tests written and were they sufficient?
  • Do we need to update any other areas of the code to conform to these changes?

The team can comment on any of the lines in the commit. These comments will appear inline with the code, but they will also appear on the task activity.

Code review comments

Making Modifications

Code review discussions will often lead to modifications to the code. We can make modifications directly in the branch that we want to merge. These changes will automatically appear in the merge request. Conversation can continue until the team reaches consensus on the code.

Merging

So discussion has ended and we have decided that the code is good! Yay! Now, we need to merge the code into master. We can do this using our git client, as normal. Or we can perform the merge right in Unfuddle:

Accepting a merge request

After the merge is complete, we can delete the branch where we did our work.

Congratulations, you just rocked code review!

Get Started

Merge requests and formal code review can supercharge your development. Get started with Unfuddle today and gain access to some of the best code review tools on the planet.

Sign Up Now