« Read the Docs Updates | Read the Docs Update »
Reviewboard is a great tool for managing the process of Code Reviews. It has pretty good git support, but it might not be obvious what the best way is to use it. At work, I have a couple of different ways of pushing up code for reviews, which I'll talk about.
This guide is assuming you are using your own bare repositories, on the server hosting the Reviewboard instance. It's mainly here so that I can remember how to do this next time I need to. Also, thanks to Travis Cline for the initial pointers for this post.
Once you have Reviewboard installed, you need to add a Repository in the admin, which is located at /admin/db/scmtools/repository/. The required fields have the following values:
The Repository Documentation has more about why you need this screwy configuration.
Before we get started, you're going to want to get the post-review tool that works along with Reviewboard. The easiest way to get it is to pip install RBTools.
The easiest way to make sure your pointing at the right Reviewboard instance is the .reviewboardrc file in your home directory. You only need to add one line to that file, which is:
REVIEWBOARD_URL = "https://path.to.your.instance"
If you are working with multiple instances that map to different repos, you can set the Reviewboard instance for the specific repo as well:
git config reviewboard.url https://path.to.your.instance
Alright, now you are all setup to start posting reviews. The easiest way to do that is to branch off of master, and start committing. If you are following something similar to this awesome branching model, this should be your normal workflow. Once your branch is ready to be merged back into your project, you want to get it reviewed. You can send a review equivalent to "this branch diffed against master" like so:
post-review --guess-summary --guess-description
Another thing I find myself doing a lot is working on my master, and only having one commit to review. In theory this should probably be done on a bugfix branch, but such is life. There are other good use cases for only reviewing the latest commit as well. It's done like so:
post-review --guess-summary --guess-description --parent=HEAD^
It's also possible to review any number of previous commits. It looks a lot like the previous command:
post-review -o --guess-summary --guess-description --parent=HEAD~4 #To review last 4 commits.
If you are familiar with git, you will understand that there is a lot more that you can do with the --parent argument. I'll leave the possibilities up to your imagination.
The are a couple of other useful post-review flags, that I use from time to time.
I hope this makes it a little easier for you to set up a git repository with reviewboard.
Posted at 12:25 a.m. on January 24, 2011
Comments: 0
Tags: git , reviewboard
Welcome to the home of Eric Holscher on the web. I talk about software development, mostly in the realm of Django. I am interested in the real time web, testing, mobile apps, and other things.
Why Read the Docs matters
1 month ago (Comments: 7)
Read the Docs Update
10 months, 2 weeks ago (Comments: 2)
Using Reviewboard with Git
1 year ago (Comments: 0)
Read the Docs Updates
1 year, 1 month ago (Comments: 1)
Handling Django Settings Files
1 year, 1 month ago (Comments: 12)
Required Reading
1 year, 3 months ago (Comments: 0)
Using Haystack to index non-database content
1 year, 3 months ago (Comments: 4)
Correct commands to check out and update VCS repos
1 year, 3 months ago (Comments: 0)
Site upgrades
1 year, 3 months ago (Comments: 0)
Building a Django App Server with Chef: Part 4
1 year, 3 months ago (Comments: 1)
Setting up Django and mod_wsgi
Building a Django App Server with Chef: Part 1
Screencast: Django Command Extensions
Big list of Django tips (and some python tips too)
Handling Django Settings Files
Lessons Learned From The Dash: Easy Django Deployment
Large Problems in Django, Mostly Solved: Delayed Execution
Building a Django App Server with Chef: Part 2

