Reviewboard Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID reviewboard Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
Dependencies
1.0.1
Feb 17, 2011
1.358
perforce (version:1.0.28)
Source Code
Issue Tracking
Maintainer(s)
Subversion
Open Issues
Ryan Shelley (id: rshelley)
Usage Installations 2013-Apr 38
2013-May 49
2013-Jun 38
2013-Jul 44
2013-Aug 36
2013-Sep 35
2013-Oct 34
2013-Nov 42
2013-Dec 36
2014-Jan 41
2014-Feb 38
2014-Mar 42

This plugin connects to Reviewboard to create and update Review Requests. Reviewboard is a tool for conducting code reviews and this plugin will allow you to link your SCM updates, when they are pulled for a Jenkins build, to Reviewboard. Note that currently, only the Perforce SCM is supported.

Installation Requirements

Features

  • Automatically or manually create and update review request by regular expression found in change description (such as JIRA ID) per Jenkins build.
  • Configure review groups and users per Jenkins build.
  • Enable command overrides to force users to enter commands into the change description to initiate or update a review request.
  • Configurable option to fail a build if Reviewboard create/update fails.
  • Configure whether to automatically publish a review request upon creation and update.
  • Configurable age of review requests before considering stale and creating a new review request instead of updating the stale one.

Known Issues

  • If a check-in contains a deleted file, Reviewboard may throw an error as it cannot find the deleted file in the SCM any longer.
  • Reviewboard 1.5 is soon to be released and it is already known that the Web API is changing between beta 2 and the final release, therefore, Reviewboard Plugin v1.0 will not work with Reviewboard 1.5 when it is finally released. It is only known to work on 1.5 beta 2.

Changelog

Version 1.0.1 (Feb 17, 2011)

  • Fix exception at first startup.

Version 1.0 (May 4, 2010)

  • Initial Reviewboard Plugin deployment.

Perforce and post-review configuration

  • The Jenkins server needs a "P4USER" environment variable of the user who can execute "p4 describe" commands (like an account with read-only access).
  • The post-review executable (from RBTools) needs to be in the PATH environment variable.

Usage

When you install this plugin, your Jenkins configuration page gets additional "Review Board Publisher" option.

  • Reviewboard URL: This the full HTTP URL to Reviewboard, such as http://www.your.site.com/reviews/
  • Username: This is the user in Reviewboard that will be used to execute actions. This user needs the following Reviewboard permissions:
    • reviews | default reviewer | Can add default reviewer
    • reviews | review request | Can change status
    • reviews | review request | Can edit review request
    • reviews | review request | Can submit as another user
    • reviews | review request | Can change review request
    • reviews | review request draft | Can change review request draft
  • Password: This is the password for the Reviewboard user.
  • Command Path: This is the command path to the "post-review" script. This should be simply "post-review" because the script should be in your PATH environment (if it's not, put it there).

In addition, each project should add a "Post-build Actions"> "Review Board Publisher" configuration:

  • External Key Expression: This is a regular expression that will be used to match a pattern in the change description that associates the change with an external system, such as JIRA. When the plugin matches this pattern it will take further action on this change entry. Example: JENKINS-[0-9]+ this would match "JENKINS-123" which may be a bug ID in JIRA. The value matched will also become the bug ID the Reviewboard review request will be associated with.
  • Default Review Groups: This should be a comma-separated list of review groups from Reviewboard that review requests created from this build will automatically be assigned to. It will query Reviewboard to ensure the groups you enter exist.
  • Default Reviewers: This should be a comma-separated list of Reviewboard users that review requests created from this build will be automatically assigned to. It will query Reviewboard to ensure the users you enter exist.
  • Set Change Owner as Default Reviewer: This will automatically set the user who submit the SCM change entry as the default review request user. This requires your SCM user names match your Reviewboard user names.
  • Publish Reviews: Enable this option to automatically publish newly created or updated review requests to their assigned review users and groups.
  • Days Before Stale Review: This is the number of days a review request created through the plugin can remain un-updated before the plugin will create a new one for the same external ID. -1 = never. Note that Reviewboard Review Request IDs are stored in the build information for the specific build number. If you delete a build from a project, and a review request was created in that build, the next update to that external ID will force a new review request to be created.
  • Skip Unflagged Changes: When enabled, any change description that does not contain "RB_NEW" somewhere within the description will not automatically create a new review request in Reviewboard. Example: "JENKINS-1234 RB_NEW Massive refactoring of code" would force the creation of a new review request. "JENKINS-1234 Massive refactoring of code" would not. Updates to external IDs that match a review request created with RB_NEW will automatically be updated in Reviewboard without any special commands unless "Require RB_UPDATE" is enabled.
  • Require RB_UPDATE: Requires that "RB_UPDATE" be included in the change description to update an existing review request otherwise it will be ignored. If a review request doesn't exist to be updated, one will be created. This is only functional when "Skip Unflagged Changes" is enabled.
  • Fail Build on Reviewboard Error: This will fail the entire build if an error occurred creating or updating a review request.

Command Override Flags

These are command flags that can be added to a SCM change description that this plugin will detect and act upon depending upon how the build is configured to handle these flags.

  • RB_NEW - Forces a new review request to be created. This can be used to creates a new request if an existing one would otherwise be updated, or it can be made required to force a change description to include this to create a review by enabling "Skip Unflagged Changes".
  • RB_UPDATE - Only required if "Require RB_UPDATE" is enabled. This instructs the plugin to ensure the change description contains this flag before attempting to update a review request. This is flag is only functional when "RB_NEW" is enabled. If this flag is found, but no review requests is, a new one will be created.
  • RB_SKIP - This flag can be used to force the plugin to skip the creation or update of a review request when it normally would. This flag is only truly useful when "Skip Unflagged Changes" isn't enabled.

post-review Installation

post-review is the companion command-line tool to post review requests to our (test) ReviewBoard server. Below are the installation steps for Windows and Mac machines

Mac OS X / Linux

  1. Install the RBTools package
    $ easy_install -U RBTools

Windows

  1. Install Python
    1. Download and install Python 2.6.5 (MSI Installer) for Windows
  2. Install SetupTools
    1. Download the Windows Installer at:
      http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11.win32-py2.6.exe#md5=1509752c3c2e64b5d0f9589aafe053dc
    2. Install into Python "Scripts" directory (should do this automatically)
    3. Add the "Scripts" directory to your Path environment variable (so you can execute easy_install and post-review from anywhere)
  3. Install RBTools (to nightly build)
    1. Run the command
      easy_install -f http://downloads.reviewboard.org/nightlies/ -U RBTools
  4. Install DiffUtils for Windows (SETUP link for Complete Package, except sources)
    1. http://gnuwin32.sourceforge.net/packages/diffutils.htm
    2. Add the following path to the system's PATH environment variable: C:\Program Files\GnuWin32\bin

Updating RBTools

RBTools is the package of tools that post-review is a part of. When this tool set is updated to a new stable build, it is usually advantageous to update your version as well. To do this, simply run the following command in at your command-line:

easy_install -U RBTools

After running the command, you should see output similar to:

Searching for RBTools
Reading http://downloads.reviewboard.org/nightlies/
Reading http://pypi.python.org/simple/RBTools/
Reading http://www.review-board.org/
Reading http://downloads.review-board.org/releases/RBTools/0.2/
Reading http://downloads.review-board.org/releases/
Best match: RBTools 0.2
Downloading http://downloads.reviewboard.org/releases/RBTools/0.2/RBTools-0.2-py2.6.egg
Processing RBTools-0.2-py2.6.egg
Moving RBTools-0.2-py2.6.egg to /Library/Python/2.6/site-packages
Removing RBTools 0.2rc2.dev-20100322 from easy-install.pth file
Adding RBTools 0.2 to easy-install.pth file
Installing post-review script to /usr/local/bin

Labels

Edit
plugin-notifier plugin-notifier Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment