Review Board can integrate with Jenkins to do test builds of code changes and report the results back on a review request. This plugin provides the necessary APIs to facilitate this integration.
Once this plugin is installed, you'll need to configure your Review Board server inside Jenkins:
-
On your Jenkins server, navigate to
Manage Jenkins
, then selectConfigure System
. -
Scroll down until you reach the
Review Board
configuration section. -
Click
Add Review Board Server
to create a new Review Board server configuration. -
Enter your Review Board server URL into the
Review Board URL
field. This must match the server URL set in the Review BoardGeneral Settings
page. -
If you have previously created a credential for your Review Board API token, select it here and skip to the job configuration.
-
If you have not yet created a credential for the Review Board API token, click
Add
and selectJenkins
. -
In the prompt, set
Kind
toSecret text
. -
Set
Scope
toGlobal
. -
Fill in
Secret
with theReview Board API Token
found in the Jenkins CI integration configuration page in the Review Board administration UI. -
Give your secret a unique identifier in the
ID
field and clickAdd
. -
Click
Save
to save your server configuration.
For each job you wish to use on Jenkins, you must add four new build parameters that will be used to give Jenkins information on the incoming review request. To add these, perform the following steps:
-
Navigate to your job's page and click
Configure
. -
Ensure the
This project is parameterized
checkbox is checked. -
For each of the following parameter names, repeat these two steps:
REVIEWBOARD_REVIEW_ID
REVIEWBOARD_DIFF_REVISION
REVIEWBOARD_STATUS_UPDATE_ID
REVIEWBOARD_SERVER
- Click
Add parameter
and selectString parameter
- Input the parameter name into the
Name
field and leave all other fields blank.
-
Scroll down to the
Build
section. Here we can add theApply patch from Review Board
step by clickingAdd build step
and choosing it from the dropdown menu.Note: This step uses RBTools to apply the patch from Review Board. It will attempt to install the package using pip, but if it lacks permission you will need to manually install it. Additionally, the order of your build steps matter, so this step should likely be the first build step so all later build steps see the correct source code.
-
Scroll down to the
Post-build actions
section. Here we can add thePublish build status to Review Board
step by clickingAdd post-build action
and choosing it from the dropdown menu. -
Click
Save
to save these changes.