Review-Board

Review Board Status Update

It’s been just over a month since the last Review Board status update. I thought this time I’d start off with a few stats.

  • Bugs open: 19
  • Bugs fixed: 97
  • Feature requests open: 27
  • Contributors: 10
  • Companies using Review Board: at least 13

If you’re part of an open source project or company using Review Board, we’d love to hear from you and your experience. We’d like to make a list of who’s using Review Board, so if you’re able to list your project/company, please let us know!

Now on to the feature updates.

  • Internet Explorer compatibility. Internet Explorer should now work properly with Review Board. A lot of work was recently done to make this happen and it hasn’t been as extensively tested as we’d like just yet, but things do appear to be working. Firefox is still the preferred (and targetted) browser, but do feel free to try IE and let us know if anything breaks.
  • CVS support. Review Board now supports CVS repositories. Right now there’s only :pserver support, though, but patches are welcome.
  • Improved post-review script. post-review, the script of choice for creating and updating review requests from the command line, now supports both Perforce and Subversion, with support for more systems on the way. A single post-review script can now handle a variety of repositories for different projects, and projects can be set up to point post-review to the right Review Board server.
  • Column sorting and list paging. Columns in the dashboard and review request lists can now be sorted by summary, submitter, posted time or last updated time. There’s also an improved pager at the bottom for skipping to other pages in the list.
  • Collapsed diff sections can now be expanded. The brown “n lines hidden” boxes in the diff viewer can be individually expanded without reloading the page by clicking a little “Expand” link on the box. This makes it easy to get more context when needed without expanding the entire diff and having to reload the page.
  • Cross-platform CRLF support. Diffs generated on Windows will now apply correctly on Review Board instances running on Linux, and vice-versa.
  • Improved diff loading times. Large diffs take a while to load, but we’ve improved this slightly by caching much of the resulting diff so that it doesn’t have to be regenerated again. More work is planned in this area to improve loading times, but it’s a lot more usable now.
  • More reliable database migration. The database migration scripts didn’t scale very well due to the existing Django libraries we were making use of being problematic for large database sizes. We’ve now fixed this, and they should be more reliable and hopefully a bit faster as well. There’s now a percentage complete indicator when loading back in.
  • Anonymous access to Review Board. It’s no longer necessary to have an account in order to view review requests and diffs. This is desirable for most open source projects. The old behavior of requiring an account for site-wide access can still be enabled, but is disabled by default.

In the works is a much improved diff parser that won’t require lsdiff on the server hosting Review Board. This should make things a little easier for people installing on Windows, and it also cleans up the code quite nicely. This should be in sometime this week.

Syntax Highlighting in the Diff Viewer

I was up late last night experimenting with a new feature for Review Board. The idea was to introduce syntax highlighting for the code in the diff viewer through use of the Pygments library. Actually getting syntax highlighting to work was pretty easy, and before long I had it working. The trick, it turned out, was to get it working with our interline diff support.

Pygments generates a nice HTML-formatted string with span tags, but we need to insert our own span tags for the highlighting. This was a pain, since you need to make sure you place them at the correct locations, keeping in mind the existing span tags and entities. The code also needed to avoid messing up the nesting of tags. After working with it a bit, I had that working as well, and now the code is up for review. In a couple of days, Review Board will have nice syntax-highlighted diff output!

I have some new improvements in the works for the diff algorithm that should result in much better diffs (especially when moving functions around) and improved UI for that case as well. I’ll blog about that later when I have something to show 🙂

Syntax highlighting

Recent Happenings in Review Board

It’s only been a couple of weeks since the last update about Review Board, but too much is happening to stay quiet.

New Features

  • Interdiffs

    Ever go through a long patch review process only to find it’s getting harder and harder to review any new changes due to the size of the patch? I’m sure most large projects have had to deal with this at one point or another.

    Review Board can now display interdiffs, which are diffs between versions of diffs. This makes it easy to see what was modified since the last change. Currently, there’s no UI for this, as there’s still a few backend changes that need to be made before we allow commenting on interdiffs, but it’ll be a full, proper feature very soon.

  • New Diff Algorithm

    We were previously using Python’s SequenceMatcher, along with some hacks, to generate the diffs. SequenceMatcher, unfortunately, just isn’t a desirable diff generator, due to its algorithm, quirks (assuming every change between matching blocks consists entirely of inserts, deletes, or changes instead of a mix of them), and lack of extensibility (no leading whitespace trimming to simplify diffs containing lots of indents).

    I’ve known for a while that we needed a new algorithm, so I finally sat down to write one. The obvious choice was the algorithm used in GNU diff (amongst other programs) — Eugene Myers’ O(ND) Difference Algorithm. After a few frustrating nights that left me nearly bald (ok, not really), it worked! And the diffs were much better than the older diffs. I think this is the first Python implementation of this algorithm.

    This also gives us the ability to add some heuristics and other logic to clean up the diffs. The result is much more readable diffs that no longer show indentation changes or huge misaligned fragments.

  • Improved support for project maintainers

    Project maintainers can now quickly download the uploaded diff from the diff viewer in order to apply the patch to their own tree. They’re also able to mark contributors’ review requests as submitted. While small additions, these make Review Board much more useful to open source projects.

  • Better browser and SCM compatibility

    We’re working on better browser compatibility and better SCM compatibility.

    CVS is almost implemented. Contributors are working on Git and BZR support. We’re working on the best ways to get these distributed systems integrated cleanly into the system.

  • Subversion post-review script

    We just received a patch for adding a Subversion-specific post-review script. Soon, we’ll combine the two and add support for CVS and other systems. This will give us one tool for creating review requests in all systems.

We’ve had a number of good contributors come out of the wood work, and from the sounds of it, several companies are using it now. I’m planning to put up a page listing teams, companies and projects using Review Board, so let me know if you’d like to be on the list! 🙂

Review Board has a home and a demo server!

I was stunned by the response to my post announcing Review Board. We had so much feedback and so many users signed up. Last I checked, our production server (which has so far been used as a demo/test server by others) has had over 550 registered users. Part of this was due to us being posted on reddit, which actually took down my server while I was sleeping!

Now, immediately we realized three things: 1) Sleeping is dangerous, 2) We needed a demo server, and 3) We needed a friendly home page.

I’ve been trying my best not to sleep, but that’s a ongoing project. As for the demo server, we pointed to our production server. This was, in retrospect, not the wisest of moves, as it ended up with hundreds of test comments. Not good when we’re actually using this for Review Board code reviews!

Today I addressed these problems (not the sleep part).

Behold! review-board.org is born! It provides a brief overview of the features, blog posts from David and I, and a link to our new demo server.

Now that we have a proper demo server people can play with, we’re going to start cleaning up our production server. If you have an account on there but are not working with the project, it will be removed in favor of the demo server. If you’re planning to contribute and would like us not to obliterate your account, please do let us know 🙂

A lot has been happening with Review Board lately and several features are in the works. I won’t go into detail right now, but for all those who have asked, yes, we are adding CVS support and are more than happy to accept patches and proposals for Git, Monotone, BZR, etc. support.

Review Board

Reviewing code can suck

The open source world has given developers great tools to make their lives easier. We have editors, bug trackers, source code management tools, repository viewers. Bugzilla, for example, is a very popular bug tracker used by many open source projects and companies alike.

While the life of a developer has in many ways been improved by these tools, there’s one key area of software development that people still do the hard way: Code reviews.

You’re probably familiar with this. A contributor puts a patch up on Bugzilla, Trac, or your project’s listserv. It’s large and spans several files. Eventually you get around to it (if you haven’t lost it in your inbox yet). You open an e-mail or the Bugzilla page to respond, put the diff where you can see it, and start going through the changes, line by line, making comments as you go. It’s tedious. You have to make it clear what function you’re talking about, make references to the general area in the diff. It’s a pain for the contributor too, because they have to figure out what you’re referring to. This leaves room for error.

We’ve been working this way for years in open source projects and at VMware. Code reviews are important to us, and help to keep our code clean and our products stable. It keeps us honest prevents us from cutting corners unnecessarily. However, the process is a bit time-consuming and not at all optimal.

  1. Generate an htmldiff showing the old code and the new code side-by-side, highlighting the changes.
  2. Write an e-mail to the target reviewers/listservs explaining what changes we made, the testing that was done, links to screenshots we put up on a file server, a link to the diff, and whatever else.
  3. Wait for someone to go through the htmldiff and comment on the changes in a new e-mail.
  4. Go through the comments, try to find the lines they referred to in the diff, and fix them up.
  5. Make another diff if necessary, repeat.

David Trowbridge and I finally got tired of it. We spent too long preparing review requests and we lost too many of them in our e-mail. As our personal projects and our team grew in size, it became harder to keep track of all the open review request e-mails on the listservs. So we fixed that.

Review Board

We built a code review system called Review Board. Like most projects, it started out simple, but grew to be pretty powerful and useful quickly. It was designed to automate and simplify the process of creating review requests and actually reviewing code.

Management at VMware was excited about this from the beginning. We weren’t being asked to write it, and it was a personal project and all, but when they found out we were doing this, they fully supported us. It didn’t take long for the excitement to spread across many teams, and we had 40 people signed up and playing before we were even ready to announce our phase 1 beta.

One of the things we decided from the beginning is that this must be open source and it must work with other version control systems. For example, we use Perforce internally, but there’s no reason not to include Subversion or anything else.

So we worked and worked in our spare time. After weeks of trial runs and lots of dogfooding, we decided it was time to announce what we had so far.

Enough yapping, details already!

Details? Alright.

Review Board is an open source program licensed under the MIT license. It was designed using Python and Django. It’s compatible with Subversion and Perforce, and can be extended to support other version control systems.

Review Board has a lot of useful features…

Multiple Repositories and Projects

Review Board can generate and display diffs against multiple repositories on multiple servers, each with their own version control system. At VMware, we have a repository for each Perforce server we use, and will soon be adding a Subversion repository for our libview project.

This would be particularly useful for umbrella projects where some parts are available in one repository and others in other repositories.

Writing version control system backends is easy. They’re simple Python modules that can be referenced in the Review Board database entry for the particular backend. We currently ship Subversion and Perforce backends, as well as a subclass of the Perforce backend making use of special extensions we use at VMware.

Review Requests

Posting review requests is fairly easy. If you use Perforce, it’s especially easy. A post-review tool is provided that allows you to post a review request with nothing other than a change number as a parameter.

If you use Subversion, a little more work is required, though we’re working on a tool to automate this as well. You’ll need to generate a unified diff. Click “New Review Request,” select the repository, enter the base path (the path relative to the root of your Subversion repository where you generated the diff), and then select the diff. Click “Create Review Request.”

You’ll be taken to your review request page where you can fill in description and other information. Click “Publish” when you’re done.

Review Request

Powerful Diff Viewer

Diff Viewer
  • Inline commenting: Instead of jumping to your bug tracker or e-mail client and describing where you’re commenting on, just comment directly on the line! Click the line number or click and drag to select multiple line numbers and a comment dialog will pop up allowing you to type. When you finally publish your review, the lines in the diff you commented on will be shown inline with the rest of your review.
  • Inter-line diffs: Sometimes a small change is made to a line and it’s not readily apparent what the change was. In these cases, we highlight the regions between two lines that have changed.
  • Revisioned Diffs: Each revision of the diff is saved and can be accessed. In the future, we will make it possible to show differences between two revisions, to ease review of incremental patches.
  • Whitespace highlighting: Trailing whitespace is automatically highlighted. Trailing whitespace is a pet peeve of many developers and this helps to catch it early.
  • Collapsing/expanding of files: By default, only the changed chunks and some lines of context around them are displayed. This can be quickly changed to show the entire file, in case there’s something you want to look at or comment on elsewhere.
  • Keyboard shortcuts: Convenient shortcut keys allow quick navigation around the diff. For example, pressing “n” will jump to the next changed chunk, and pressing “p” will jump to the previous chunk. This will be further improved and documented soon.

Comment Dialog

Interactive Screenshots

  • Screenshots can be easily added to the review request page, and will show up as thumbnails.
  • Screenshots can be commented on by clicking and dragging an area on the image. A comment box will pop up, like in the diff viewer. While the clipped part of the screenshot does not yet appear on the review, it will soon.

Contextual Discussions

Review Discussions

  • Commented lines in the diff are displayed with their comments on the review page.
  • Commented areas of a screenshot will be displayed with their comments on the review page.
  • Discussion of reviews take place on the reviews themselves, making it possible to read the whole discussion of a change from top to bottom.

E-mail Support

All discussions and updates get sent automatically to the individual reviewers and listservs. This makes it easy for people to see any and all changes. This is configurable and can be disabled if it doesn’t fit in with your setup.

NIS Support

Review Board can use an NIS server as an authentication backend, making it easy to integrate into companies that use NIS. Everyone’s accounts will Just Work in Review Board without any registration required.

User Dashboard

Dashboard

All incoming and outgoing reviews can be seen on the Dashboard page. You can look at incoming reviews sent directly to you, sent to a group, or to either (all incoming reviews).

In the future, this will show more information on what’s going on with the review requests in your list. Recent discussions and updates will be shown, making it easier to keep track of things.

JSON API

Review Board has a JSON-based API for accessing nearly every aspect of the system. This makes it easy to build tools around Review Board. Our post-review tool uses this, as does much of the web UI.

Hopefully in time, developers will make use of this to better integrate with existing systems such as Eclipse, vim, emacs, or other IDEs.

Looking Forward

There’s a lot we have planned. Review Board is still just an early beta and a lot will happen.

  • Improved tools: We’ll soon be working on a single tool that understands how to post review requests to both Perforce and Subversion. It will also be able to integrate with multiple projects. For example, if three projects you’re contributing to all use Review Board, post-review will ask once for the Review Board servers and use them from then on when run in the project directories.
  • Interdiffs: We plan to include the ability to show changes between revisions of diffs, aiding in reviewing incremental changes to patches.
  • Statistics: Information will be available showing how many review requests, reviews, and comments have been made between specified time periods, complete with fancy graphs. We’re working on ideas for what can be displayed here.
  • Status Reports: This is perhaps more useful inside companies. At VMware, we’re supposed to submit weekly status reports discussing what we’ve done. Often this consists mostly of review requests made and bugs fixed. Review Board will be offering a page showing this information in several forms so that it can be easily copied and pasted into a weekly status report.
  • Integrated Help: To simplify usage for first-time users, we’d like to add help information to all pages explaining simply how to use the interface.
  • “Effective Lines” Display Many diffs are easier to review than they seem, as there could be hundreds of lines with nothing more than a function or variable name change. We would like to make this clear before even opening the diff by showing the number of effective lines changed, factoring out the simple redundant changes.

Wrapping Up, and Contributing

This was a bit long, but I hope it gave a good overview of what we’re putting together here. You can see it in action or visit the project page. If you decide to use it in your project, please let us know! Check the Wiki for install instructions.

Hopefully this will become useful to others as well. We’ll post periodic updates as this project progresses.

Scroll to Top