Review Bot is a tool for automating tasks on code uploaded to a Review Board instance, and posting the results as a code review. Review Bot was built to automate the execution of static analysis tools, for a list of tools Review Bot supports, please see the Supported Tools wiki page.
-
Extensible: Writing plugins is simple using a convenient API to retrieve code files and craft a review. If more power is needed, tools can access the full Review Board API.
-
Scalable: Review Bot is built using Celery and can scale out to service very large Review Board instances.
-
Integrated Configuration: Tools are configured through the Review Board admin panel, including settings uniquely defined for each task.
Review Bot requires installation of a Review Board extension, a message broker, and at least one Review Bot worker.
RabbitMQ is the recommended message broker. Although Review Bot is tested with RabbitMQ, any of the Celery [supported brokers](http://docs.celeryproject.org/en/latest/getting- started/brokers/) should work.
Please see the broker specific documentation for installation instructions.
Review Bot requires a version 2.0 or 1.7 Review Board installation.
- For Review Board 2.0.x, use the branch release-0.2.x.
- For Review Board 1.7.x, use the branch release-0.1.x.
To install Review Bot's Review Board extension, clone this repository and install with the following commands:
git clone -b <branch> git://github.com/reviewboard/ReviewBot.git
cd ReviewBot/extension
python setup.py install
After installation the 'Review-Bot-Extension' should be enabled and configured in Review Board's admin panel. Please see the Celery documentation for help configuring the 'Broker URL'.
The Review Bot worker requires the master development branch of rbtools
To install the Review Bot worker to a server, clone this repository and install with the following commands:
git clone git://github.com/smacleod/ReviewBot.git
cd ReviewBot/bot
python setup.py install
The worker can be started using the reviewbot
command:
reviewbot worker -b <broker_url>
reviewbot
starts an instance of the celery
command using Review
Bot's 'app'. For more information please see documentation
on Celery Application's
and Workers.
To use the JSHint plugin, you must have JSHint installed as a Node program. To
install it in the current working directory, run the following command (add the
-g
flag to install it globally):
npm install jshint
To use the cppcheck plugin - you must ensure that cppcheck is available on the worker machine.
To install on Ubuntu run:
sudo apt-get install cppcheck
For other distributions or Windows, please see http://sourceforge.net/projects/cppcheck/
Workers are able to find installed tools using
Entry Points.
New tool classes should add a reviewbot.tools
entry point. The entry
point for the pep8 tool is part of the review bot installation, here
is an example showing its definition:
'reviewbot.tools': [
'cppcheck = reviewbot.tools.cppcheck:CPPCheckTool',
'cpplint = reviewbot.tools.cpplint:CPPLintTool',
'pep8 = reviewbot.tools.pep8:PEP8Tool',
],
After a tool has been installed on a worker, it must be registered with the Review Bot extension, and configured in the admin panel. Registering tools is accomplished in the following manner:
- Go to the extension list in the admin panel.
- Click the 'DATABASE' button for the 'Review-Bot-Extension'.
- Click the 'Review bot tools' link.
- Click 'REFRESH INSTALLED TOOLS' in the upper right of the page.
This will trigger tool registration for all of the currently running workers, and refresh the page. You will now see the list of installed tools and may configure them using this admin panel.