Tuesday, January 25, 2011

Code Reviews

As an engineer coming from Google where every line of code is reviewed by another engineer before it is submitted, I had assumed that there would be a publicly available open source tool to help us facilitate code reviews in a similar fashion outside of the Googleplex. As it turns out, there are very few available and almost all are for doing code reviews post-commit. This includes the code review tool built into Google Code Hosting. Google Code recommends that you submit to a branch and then request a code review of the branch before merging into trunk. While that method certainly works, it's cumbersome and the overhead is too high. What inevitably ends up happening is nobody ends up requesting code reviews and the whole process gets dropped.

In my experience, the only way to make sure code reviews actually happen is to enforce it in your tools. But that's a post for another day. We don't enforce code reviews here at Adku because we don't feel that code reviews should be mandatory just yet for a three person startup, but you can bet that once we get bigger, we will.

Anyway, after hours of searching and experimenting with various tools, we settled on Rietveld which was developed by Guido van Rossum, author of Python and Mondrian. The problem with Rietveld, however, is that it doesn't work out of the box! It is meant to be run on appengine, but only supports Django 1.1 so you have to change your appengine setup to use Django 1.1 and this is not a trivial process. Moreover, if you run Rietveld on appengine, most of your changes will be available publicly with no way to restrict access to your internal team without diving in and modifying Rietveld source code.

In the end, after a bit of troubleshooting, we successfully got Rietveld up and running and even set it up internally to restrict access.

Now that it's up, it is beautiful, works great, and is exactly what we were looking for. Typical use looks something like this
  1. make some local edits
    $ vi my_source_code.py
  2. send the changes to carlos for code review
    $ python rietveld/upload.py --send_mail -r carlos
  3. carlos gets an email that looks like this
    Date: Thu, Nov 4, 2010 at 11:19 AM
    Subject: better demo (issue24)
    To: carlos@adku.com

    Reviewers: carlos,

    Please review this at http://rietveld:8000/24/

    Affected files:
  4. carlos clicks on the link and sees the unsubmitted changes in a web ui with change highlighting, syntax highlighting, and an inline commenting ui
  5. carlos enters a few comments inline with the changes and hits send
  6. i make the changes suggested and re-send the code
  7. he reviews again and hits approve
  8. i submit the pending change in my local client


  1. Reviewboard is also a nice one.

  2. What post-commit tools did you find? Most of the ones I've looked at are pre-commit based.

    1. What post-commit tools did you find? Most of the ones I've looked at are pre-commit based. sami

  3. Here we present to introduce to all visitors in this great blog. and thank you for allowing me .

    cara menggugurkan kandungan
    obat aborsi
    tanda tanda kehamilan

  4. Exactly when numerous had just been persuaded that these machines were the best innovations in the field of check getting the money for, the possibility of online check changing was presented. aaa1autotitleloans.com/chicago

  5. Bluehost is an outstanding name and they're one of the organizations you're certain to meet when searching for a web facilitating supplier. A portion of their business ad spot looks pipe dream however in the event that lone the majority of it's wordpress website backups certifiable, that is OK on the grounds that the general bundle appears to be so great.

  6. thanks you the article really helped me. I hope the articles that are made are useful for all of us.

    Cara Mengobati Penyakit Thalasemia
    Cara Mengobati Penyakit Aritmia

  7. Thanks for sharing such a great blog... I am impressed with you taking time to post a nice info.
    Mobile App Development Company | Mobile App Development Company in Mumbai

  8. The author of this post is admirable, it brings a lot of emotion to everyone reading it, let's share it more widely. I enjoyed it, thanks for posting it, I hope this post of yours will be more appreciated by it really excellent.
    Jogo para menino, cá koi mini, friv at school 2019, friv Games for kids online

  9. Save your time with do my homework help in all possible subjects! Original, high quality assignments from top quality writers.

  10. Students find History Research Paper Services as being of great assistance since they are able to complete their history research paper writing services and history essay writing services on time.

  11. Finding the best online history research paper writing services and History Research Paper Services is not easy unless one is keen to establish a professional history assignment writing service provider & history coursework help online.

  12. Just admiring your work and wondering how you managed this blog so well. It’s so remarkable that I can't afford to not go through this valuable information whenever I surf the internet! If you're looking for the best Things to do in the world, this list has something for everybody! From adventure to culture, food to history .

  13. Psychology coursework writing services are not hard to come across for those in need of Psychology Research Paper Services and psychology assignment writing services.

  14. Broadcast emails like sales, events, announcements, newsletters, and blog posts can be easily sent to your list once you have this type of system in place.best t5 fat burners reviews

  15. That’s a nice article, thank you for a great article. It helped me a lot. Keep it up Must Visit panda klantendienst