Obsolete:grrrit-wm
grrrit-wm is an IRC bot that listens to events from Gerrit and reports them on various IRC channels; it replaces gerrit-wm.
Which repo changes report to which channels can be configured in config.yaml
[1]; it defaults to #wikimedia-dev, see mw:MediaWiki on IRC.
It is built to run on Tool Labs, and is dependent on a Redis queue populated by the stream receiver script that is part of SuchABot.
Running it
This is designed to run on the Grid Engine available on Tool Labs as a continuous task. There is a convenience script kick.bash
to start the task on the Grid Engine.
Config changes
To add more repo -> channel mappings, edit config.yaml
. The repo names can be matched using regexen. The tool needs to be restarted on SGE for the changes to take effect - see the deploying and restarting sections for more.
Deploying
Get your changes into master (i.e. merge them) through Gerrit.
local$ ssh yourusername@tools-login.wmflabs.org yourusername@tools-login$ become lolrrit-wm local-lolrrit-wm@tools-login:~$ cd lolrrit-wm/ local-lolrrit-wm@tools-login:~$ git fetch --all local-lolrrit-wm@tools-login:~$ git reset --hard gerrit/master local-lolrrit-wm@tools-login:~$ git cherry-pick auth local-lolrrit-wm@tools-login:~$ git log # make sure your changes made it in and that the password commit is on top of it
Then the bot needs to be restarted. (see below)
Restarting the bot
local$ ssh yourusername@tools-login.wmflabs.org yourusername@tools-login:~$ become lolrrit-wm local-lolrrit-wm@tools-login:~$ qmod -rj lolrrit-wm Pushed rescheduling of job 8191014 on host tools-exec-13.eqiad.wmflabs # if you get an error instead, re-start the job using local-lolrrit-wm@tools-login:~$ ./lolrrit-wm/src/kick.bash Your job XXXXXX ("lolrrit-wm") has been submitted # if you get # local-lolrrit-wm has registered the job XXXXXX for deletion # instead, wait until `qstat` doesn't show lolrrit-wm anymore, then run kick.bash again
Redis died?
Run `gerrit-to-redis/src/clients_from_mysql.py` to re-create the clients list in redis.
Logs
There are somewhat comprehensive logs in the `~/logs` folder on toollabs.
Code
The code is hosted on Gerrit, under labs/tools/grrrit-wm
[2].
Debugging stuck stream
Template:Info
If the bot stops reporting events, and restarting it doesn't help, run ssh <yourname>@gerrit.wikimedia.org -p 29418 gerrit stream-events
and perform some activity on Gerrit like rebasing a patch. Did it appear in the stream? If so, the malfunction is probably located in the piece of middleware that streams Gerrit events into Redis. (This is the stream that feeds grrrit-wm.) Here's how to restart it:
ori@tools-login:~$ become gerrit-to-redis local-gerrit-to-redis@tools-login:~$ jstop gerrit-to-redis local-gerrit-to-redis has registered the job 1084879 for deletion local-gerrit-to-redis@tools-login:~$ jsub -once -continuous -N gerrit-to-redis ~/gerrit-to-redis/src/stream-receiver.bash Your job 1444002 ("gerrit-to-redis") has been submitted
Access
The project under Toollabs is called lolrrit-wm
. As of now the following people have access:
- YuviPanda
- ^demon
- AzaToth
- Ryan Lane
- ori-l
- MZMcBride
- RoanKattouw
- MarkTraceur
- legoktm
- aude
- PiRSquared17
- MatmaRex
- Krenair
- James_F
Any of these people can restart the service if need be.