Code review is important for the quality of a software product. It used to be a meeting activity where a small group of engineers walk through changes and provide the author feedbacks. This is highly effective but not flexible enough, especially when there are frequent code changes.
To address the issue, new tools have been invented for conducting code review. One of such tools is the Review Board developed by VMware employees and open sourced for public usage. The other popular tool is Gerrit started by a Google employee. I used the Review Board while working at VMware and really liked it. That is why I picked it for my current team at VCE. My choice of Review Board just means that it’s good enough for my requirements but that it’s better than Gerrit which I have never used before.
Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.
The review board is essentially a Web application that facilitates the review process in a development team. At a high level, the workflow is pretty straight forward. Whoever wants to get her code reviewed first generate a diff, which is uploaded to the Review Board. Then she fills a quick Web form with summary, description, reviewers, etc. Once submitted, emails are sent to the reviewers who can click the link from the email and start to view the changes and make comments. The comments are then posted back and available for the author and other reviewers.
Download and Deploy Virtual Appliance
To avoid the hassles of installation, I decided to download the virtual appliance created by Bitnami. The virtual machine was targeted for VMware workstation or VMware Server which is now VMware Player. You cannot deploy it as it is onto vSphere, but you can use either vmkfstools or VMware vCenter Converter to convert the virtual machine. As described in the Virtual Appliances Quick Start Guide, the process is mostly straightforward, therefore I don’t repeat it. There are a few steps that can be improved or added as follows, for example, how to configure DNS client so that your code repository and SMTP server hostnames can be resolved.
Configure Virtual Appliance
After getting the virtual machine running, you want to configure the networking, for example, IP address and DNS, etc. For that, several changes need to be made with the following command.
$sudo vi /etc/network/interfaces
Changing the original eth0 interface as follows.
# The primary network interface auto eth0 iface eth0 inet static address 192.168.100.108 network 192.168.100.0 broadcast 192.168.100.255 netmask 255.255.255.0 gateway 192.168.100.1 dns-nameservers 192.168.100.254 192.168.100.253
After the configuration is done, you need to restart the network services for the new configuration to take effect.
$sudo /etc/init.d/networking restart
Once these changes are done, you can pick up a browser from another computer to configure the Review Board itself. The URL for admin page is like http://192.168.100.108/reviewboard/admin
These important steps include:
- Configure email settings. You will need to configure admin email address, SMTP server so that the Review Board can email author and reviewers.
- Add new repositories. This is important because the diff does not include full source code therefore not enough context for understanding the changes. With this setting, the review board can show changes in bigger code blocks.
- Add new users and optionally review groups. By default, the module required for using Active Directory or LDAP is not included in the virtual appliance. So there are extra steps to go that path. An alternative is to manually create several users, or open up the registration that users can register themselves. Given the nature of the Review Board, it’s not necessary to enforce any strong security policy for users at all.
After the configurations are done, users can log in and submit review requests and review others’ code. The URL for users is:
Important Usernames and Passwords
For the virtual machine, the default username is “bitnami” with initial password “bitnami”. If you choose to change password, make sure you memorize it or make a note of it.
The default administrator for review board is called “user”, which is a little counter-intuitive, with password “bitnami”. You can change the administrator user name and password to something else like “admin.” Again, write it down before you forget the new username and password. Just imagine how many questions on the Web asking for “How to reset password?”