getting ReviewBoard running

I made some notes on getting Review Board up and running. I thought they might be useful for someone else wishing to do the same… I implemented review board on a virtual machine, with the VM running Ubuntu Gutsy. I highly recommend getting the basic setup from the GettingStarted page on the reviewboard project wiki.

Review Board includes an automake setup solution, but I didn’t take advantage of it. Partly because I felt comfortable setting up a Django project without it, and partly because I didn’t clue in that it was there and I should use it until well after I’d begun fiddling with all this.

From those basics, here’s some additional tidbits

  1. get an instance of reviewboard running:
  2. mysql -u root -p
     (enter password)
    create database reviewboard;
    GRANT ALL on reviewboard.* TO reviewboard@localhost IDENTIFIED BY "sup3rsekret"
    
  3. set up settings_local.py to match:
  4. # Database backend.  Any supported django database engine should work.
    DATABASE_ENGINE = 'mysql'      # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
    DATABASE_NAME = 'reviewboard'  # Or path to database file if using sqlite3.
    DATABASE_USER = 'reviewboard'     # Not used with sqlite3.
    DATABASE_PASSWORD = 'sup3rsekret' # Not used with sqlite3.
    DATABASE_HOST = ''             # Set to empty string for localhost.
    DATABASE_PORT = ''             # Set to empty string for default.
    
  5. initialize the database:
  6. cd reviewboard
    ./manage.py syncdb
     (create an admin account when asked)
    
  7. hook this whole thing up to Apache:
  8. I configured my setup using the provided mod_python template – the Makefile setup system seems to include provisioning it, but I did this all by hand.

    Running as mod_python means that the account accessing perforce was “www-data” by default – a user that isn’t normally enabled in our Perforce repository. I worked around that issue by handing down additional perforce specific environment variables:

        SetEnv P4USER readonly-account
        SetEnv P4PORT p4.server.com:1666
        SetEnv P4CLIENT reviewboard
        SetEnv P4PASSWD xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
  9. set up the initial data bits to use the service in our environment:
    • use “python post-review -d” to find out what perforce is calling your repository.
    • Add that repository to the list of repositories in the Admin console of ReviewBoard
    • Add at least one “review group” in the Admin form as well
  10. Set up a .reviewboardrc for your tree
  11. Place this at the root of your tree. Post-review starts in the current directory and scans upwards to find an instance of this file to know what to do…

    # Default Review Board Server
    REVIEWBOARD_URL = 'http://10.0.0.25'
    
    # Per-repository Review Board servers
    # TREES = {
    #    '/path/to/local/repo/checkout': {
    #         'REVIEWBOARD_URL': 'http://whatever' 
    #    }
    # }
    

One other thing of note: post review is sensitive to the Diff Headers in trying to pull out the date. We were using an old version of diff and it had some real trouble with that. We updated to using diffutils 2.8.7 to resolve that.

Published by heckj

Developer, author, and life-long student. Writes online at https://rhonabwy.com/.

%d bloggers like this: