Reviewer bot for WMF's Gerrit
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore new pywikibot checkout dir Aug 1, 2016
LICENSE Add explicit license Feb 13, 2013 README formatting Oct 18, 2016 Make regexps more resilient Apr 28, 2018
api_result New reviewer list format: one page with templates Dec 28, 2012 Add user agent to REST agent Jun 29, 2014 Use local id_rsa Dec 27, 2012
l10n-test Ignore L10n-bot commits Dec 29, 2012 Add more detailed logging on failure Apr 28, 2018
pywikibot Rework pywikibot dir (pywikibot/ needs to be importable) Jul 31, 2016
requirements use requests[security] Aug 1, 2016
run_bot Fix git checkout, make sure to checkout 2.0 branch Jul 31, 2016
run_pop3_bot new pywikibot checkout dir Aug 1, 2016
stream-bug-example + better debug output Jan 2, 2013
stream-events-example Added more testing & docs Dec 28, 2012 Add DEBUG logging to help testing Aug 23, 2014

Gerrit reviewer bot for WMF's Gerrit.

This bot reads reviewers from and adds them to changes in Gerrit.

Changes are read from SSH ('') or POP3 ('').


virtualenv --system-site-packages reviewer-bot && cd reviewer-bot
source bin/activate
git clone src
cd src
pip install -r requirements
git clone pywikibot
cd pywikibot && git checkout 2.0

Then, to test:

$ python Ic1250e94c2cbbd3cdc7f1f593be0e204bf735877
Processing changeset  Ic1250e94c2cbbd3cdc7f1f593be0e204bf735877 Moved to TWN, test whether the deployment really works... by Merlijn van Deen
Suggested reviewers:  ['siebrand', 'Sumanah']

The main algorithm for determining reviewers is the ReviewerFactory in contains basic functionality for accessing the Gerrit REST API. reads Gerrit mails from a POP3 mailbox, retrieves the corresponding changes using the REST API, determines reviewers using the ReviewerFactory and finally adds reviewers via SSH.

Changes in the ReviewerFactory can best be tested using, as above. If more information is required from Gerrit, try to do this using options to the /changes/ REST API.


First, copy reviewer-bot's id_rsa and to the working directory. Then:

source bin/activate
python is a simple file containing

username = ''
password = 'whateveryourpasswordis'

(the gmail pop server is hard-coded at the moment)

This will start a single run. Wrap it in a loop with a sleep or use cron to use it constantly.