Fighting Review Board
We’ve been talking a bit about code reviews at work, I do a bit of this now by reading commit emails, and have been wondering if there was an easier solution. To that end, I started looking around for software that could help us out.
I ended up beating on Review Board for about six hours before getting it installed. Now that it’s running it looks pretty nice. I think we’ll end up doing more post-commits then pre-commits but hopefully it’ll fit into our workflow.
Anyway, I though I’d put up a quick post on what I needed to do it get it running. The docs do a good job of getting the base install done. So give that a gander but come back here before you start running rb-site install.
We need to setup our MySQL database before running the rb-site. I did this by initializing a reviewboard MySQL database with a reviewboard user. I then granted all priviledges by executing:
GRANT ALL PRIVILEGES ON reviewboard.* TO 'reviewboard'@'localhost'
IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON reviewboard.* TO 'reviewboard'@'% '
IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
Once rb-site install is run you’ll need to configure your webserver. In my case I ended up using Apache with FastCGI. When I tried to use the mod_python option the webserver would get a Segmentation Violation and terminate. Not so good.
The provided Apache FastCGI configuration script didn’t work for me and I ended up using the following.
AddHandler fastcgi-script fcgi
FastCGIExternalServer "/var/www/reviews/htdocs/reviewboard.fcgi" -host 127.0.0.1:3033 -idle-timeout 60
<VirtualHost *:8888>
ServerName reviews.local
DocumentRoot /var/www/reviews/htdocs
# Alias static media requests to filesystem
Alias /media /var/www/reviews/htdocs/media
Alias /errordocs /var/www/reviews/htdocs/errordocs
# Error handlers
ErrorDocument 500 /errordocs/500.html
# Direct all other requests to the fastcgi server
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ /reviewboard.fcgi/$1 [QSA,L]
</VirtualHost>
The first parameter to FastCGIExternalServer needs to be the full path to reviewboard.fcgi as if it existed in your DocumentRoot. Nothing else seemed to work for me.
Note, if you’re using VirtualHosts you’ll also need to make sure the NamedVirtualHost option is enabled in your httpd.conf file (or whatever your main Apache config file is named).
Now, this will run, but it won’t work. The reason it won’t work is that it needs an external server to send the FastCGI requests too. You can run this server by executing: rb-site manage /var/www/reviews/ runfcgi method=threaded port=3033 host=127.0.0.1 protocol=fcgi. You’ll notice the host and port match up to those specified in the Apache config file.
I ended up creating a simple shell script to handle starting and stopping the rb-site server.
#! /bin/sh
# chkconfig: 2345 90 90
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="reviewboard daemon"
NAME=reviewboard
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
/usr/bin/rb-site manage /var/www/reviews/ runfcgi method=threaded port=3033 host=127.0.0.1 protocol=fcgi
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
pkill rb-site
echo "."
;;
*)
echo "Usage: NAME {start|stop}" >&2
exit 3
;;
esac
exit 0
With that I was able to login and start playing with Review Board. I ended up doing a bit of extra work to disable registration (which is kind of nasty as I had to edit the base HTML templates and urls.py) but everything seems to be working well now.
Good article. I’m one of the lead developers of Review Board, and as you’ve discovered, our current documentation leaves a bit to be desired. This is basically because we’ve been trying to concentrate on getting the features people need out there and a release performed.
That said, I’ve spent the past couple of weeks working on an admin guide that covers, among other things, installation in greater detail. I’m bookmarking this page and making sure all the points you address will be in the official docs.
Thanks!
Review Board looks pretty cool. At my previous job we had to do mandatory ‘buddy checks’ before any code got checked into the repo. It meant that two programmers had looked over every change before it was checked in. It helped to avoid a lot of broken builds, but some kind of review tool would have been really handy too.
I’ve been digging through the web trying to find as much info as I could on getting ReviewBoard running.
Our team is wanting to start more formal peer reviews; and review board looked promising… Unfortunately; the install process is so cumbersome I’m about to throw in the towel and try a different peer review tool.