This review tool is to automate the steps that are involved in the context of a patch submission. (Credits to the Kafka Patch Review Tool)
These steps involve:
As you'll notice this requires (automated) integration between JIRA and Review Board. The (python based) script, acts as a wrapper around the scripts/tools that are shipped by JIRA and Review Board for such integrations. Since the patch-review.py is merely a wrapper around those tools, you'll have to install those tools locally to be able to use the patch-review.py script. This document helps you in setting up those tools as well as helping you understand the usage of the patch-review.py itself.
The following sections will help you install and setup the necessary tools which this wrapper script uses for patch submission.
sudo easy_install jira |
During the patch submission process, the patch-review.py prompts you for your JIRA user name and password that you use for https://issues.apache.org/jira JIRA instance. The tool uses that information to update the JIRA with the new patch. However, if you do not like being prompted each time you submit the patch, you can configure your JIRA user name and password be setup in a file named jira.ini under your home directory. The content of such a file would look like:
$ cat ~/jira.ini user=(user_name) password=(password) |
This is a quick tutorial on using Review Board with BookKeeper.
If you are on RHEL, Fedora or CentOS, follow these steps
sudo yum install python-setuptools sudo easy_install -U RBTools |
If you are on a Debian based system (like LinuxMint) follow these steps
sudo apt-get install python-setuptools sudo easy_install -U RBTools |
If you are on Mac, follow these steps
sudo easy_install -U setuptools sudo easy_install -U RBTools |
For other platforms, follow the instructions here to setup the post-review tool.
Then you need to configure a few things to make it work:
First set the review board url to use. You can do this from in git:
git config reviewboard.url https://reviews.apache.org |
If you checked out using the git wip http url that confusingly won't work with review board. So you need to configure an override to use the non-http url. You can do this by adding a config file like this:
|
On Linux -> sudo yum install python-argparse
On Mac -> sudo easy_install argparse
|
$ python dev/patch-review.py --help
usage: patch-review.py [-h] -b BRANCH -j JIRA [-s SUMMARY] [-d DESCRIPTION]
[-r REVIEWBOARD] [-t TESTING] [-db]
BookKeeper patch review tool
optional arguments:
-h, --help show this help message and exit
-b BRANCH, --branch BRANCH
Tracking branch to create diff against
-j JIRA, --jira JIRA JIRA corresponding to the reviewboard
-s SUMMARY, --summary SUMMARY
Summary for the reviewboard
-d DESCRIPTION, --description DESCRIPTION
Description for reviewboard
-r REVIEWBOARD, --rb REVIEWBOARD
Review board that needs to be updated
-t TESTING, --testing-done TESTING
Text for the Testing Done section of the reviewboard
-db, --debug Enable debug mode
|
Example:
python dev/patch-review.py -b origin/master -j BOOKKEEPER-877 |
Example:
python dev/patch-review.py -b origin/master -j BOOKKEEPER-877 -r 39932 |
$ python dev/patch-review.py -b master -j BOOKKEEPER-877 There don't seem to be any diffs |
There are 2 reasons that can cause this -
Error uploading diff Your review request still exists, but the diff is not attached. |
One of the most common root causes of this error are that the git remote branches are not up-to-date. Since the script already does that, it is probably due to some other problem. You can run the script with the --debug option that will make post-review run in the debug mode and list the root cause of the issue.