Jira and Code Reviews

Jeffrey Dake Senior Director of Technology
Jira and Code Reviews
Recently our company was researching switching from our current issue tracking system over to using Atlassian’s Jira product.  While doing the switchover I wanted to make sure that my team would be able to do formal code reviews to guarantee quality of code changes.  While looking at all the plug-ins and external products that Atlassian offers, our team was unable to figure out exactly which products we should use.  We had it narrowed down between Stash, Bitbucket and Fisheye and Crucible, but really couldn’t tell which one was best for us.  We eventually needed to call a sales engineer to figure it out, so I would like to share what we learned from that call.

Fisheye and Crucible
Fisheye and Crucible is a tool that Atlassian recommends for users that are not using a DCVS system.  This would include using revision control systems like CVS and SVN.  Since we were looking at using GIT as our repository, the sales engineer did not recommend using Fisheye and Crucible.

Stash is a useful tool that can be used for GIT repositories.  Stash can also be used for code reviews.  The sales engineer recommended using this product if you want to host the GIT repository yourself.  Since our team wanted to host our repository in the cloud we decided that this was not the solution for us.

Bitbucket is Atlassian’s cloud based solution for hosting GIT repositories.  Since we wanted a cloud solution, this was the tool that Atlassian recommended for us.  They actually recommended that we use their GIT Essentials offering (https://www.atlassian.com/solutions/git-essentials) which they do a horrible job at advertising what it is.  Basically it is a bundled offering for Bitbucket, Jira and Bamboo.  Bamboo is Atlassian’s product for doing automatic builds and deployments.  So, if you are using GIT and want to have a cloud hosted solution, GIT Essentials is the solution for you.

Code Reviews in Bitbucket
Since originally this all started with me trying to do code reviews, I will walk through how you can do them in Bitbucket using Jira.  When you integrate Jira with Bitbucket it allows you to create a branch in GIT straight from the issue in Jira.

1) First Click the Create Branch button in the right nav.

 2) This will take you into Bitbucket where you can create the branch.

After you complete your work and commit your code to the branch, you can create a pull request from the Issue.  This will allow you to create a pull request in Bitbucket to merge your code from the branch into the master branch.  When you create the pull request you can assign the pull request to a user in Bitbucket for them to review.  The reviewer will be able to see the changes directly within Bitbucket.  This will allow another user to do a quick code review without having to pass code around via patch files or checking out other branches.

3) Create a Pull Request through Jira.

 4) Fill out request information and submit pull request in Bitbucket.

5) Once the request is made another user can approve with the top right button while looking at the code changes below.

Once the pull request is approved you can then merge the code into the master branch through Bitbucket.  This allows you to easily have other team members review code changes and increase code quality.
Jeffrey Dake Senior Director of Technology

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.