Table of Contents |
---|
Kafka JIRA and Reviewboard script
1. Setup
- Follow instructions here to setup the jira-python package
- Follow instructions here to setup the reviewboard python tools
- Install the argparse module
Code Block On Linux -> sudo yum install python-argparse On Mac -> sudo easy_install argparse
2. Usage
Code Block |
---|
nnarkhed-mn:kafka-git-idea nnarkhed$ python kafka-patch-review.py --help
usage: kafka-patch-review.py [-h] -b BRANCH -j JIRA [-s SUMMARY]
[-d DESCRIPTION] [-r REVIEWBOARD] [-t TESTING]
[-v VERSION] [-db]
Kafka 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
-v VERSION, --version VERSION
Version of the patch
-db, --debug Enable debug mode
|
3. Upload patch
- Specify the branch against which the patch should be created (-b)
- Specify the corresponding JIRA (-j)
- Specify an optional summary (-s) and description (-d) for the reviewboard
Example:
Code Block |
---|
python kafka-patch-review.py -b origin/trunk -j KAFKA-42
|
4. Update patch
- Specify the branch against which the patch should be created (-b)
- Specify the corresponding JIRA (--jira)
- Specify the rb to be updated (-r)
- Specify an optional summary (-s) and description (-d) for the reviewboard, if you want to update it
- Specify an optional version of the patch. This will be appended to the jira to create a file named JIRA-<version>.patch. The purpose is to be able to upload multiple patches to the JIRA. This has no bearing on the reviewboard update.
Example:
Code Block |
---|
python kafka-patch-review.py -b origin/trunk -j KAFKA-42 -r 14081
|
JIRA command line tool
1. Download the JIRA command line package
Install the jira-python package
Code Block |
---|
sudo easy_install jira-python
|
2. Configure JIRA username and password
Include a jira.ini file in your $HOME directory that contains your Apache JIRA username and password
Code Block |
---|
nnarkhed-mn:~ nnarkhed$ cat ~/jira.ini
user=nehanarkhede
password=***********
|
Reviewboard
This Here is a quick tutorial on using Review Board with Kafka.
1. Install the post-review tool
If you are on RHEL, Fedora or CentOS, follow these steps
Code Block |
---|
sudo yum install python-setuptools
sudo easy_install -U RBTools
|
If you are on Mac, follow these steps
Code Block |
---|
sudo easy_install -U setuptools
sudo easy_install -U RBTools
|
For other platforms, follow Follow the instructions here to setup the post-review tool.
2. Configure Stuff
Then you need to configure a few things to make it work:
...
Code Block |
---|
jkreps$ cat ~/.reviewboardrc REPOSITORY = 'git://git.apache.org/kafka.git' TARGET_GROUPS = 'kafka' GUESS_FIELDS = True |
...
FAQ
When I run the script, it throws the following error and exits
Code Block |
---|
jkreps$nnarkhed$python postkafka-patch-review.py --tracking-branch=origin/trunk ==> HTTP Authentication Required Enter authorization information for "Web API" at reviews.apache.org Username: jkreps Password: Review request #13834 posted. https://reviews.apache.org/r/13834/ |
You can also fill in some of the fields as part of your command by doing
Code Block |
---|
jkreps$ post-review --tracking-branch=origin/trunk --summary="My simple change" --description="A simple change that I made"
|
Or if you are lazy and there is only one commit you can have review board guess the summary and description from the commit message:
Code Block |
---|
jkreps$ post-review --tracking-branch=origin/trunk -g
|
You can update an existing review board by using the -r option to specify which review board to update:
b trunk -j KAFKA-42
There don't seem to be any diffs
|
There are 2 reasons that can cause this -
- The code is not checked into your local branch
- The -b branch is not pointing to the remote branch. In the example above, "trunk" is specified as the branch, which is the local branch. The correct value for the -b (--branch) option is the remote branch. "git branch -r" gives the list of the remote branch names.
When I run the script, it throws the following error and exits
Code Block |
---|
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.
...