Wikibugs

wikibugs is an IRC bot that idles in the #wikimedia-dev development channel (and others) on the freenode IRC network.

After restart, the bot joins only #wikimedia-cloud by default. Other channels are joined when the first relevant message to them is supposed to be sent.

Functions
The bot polls the phabricator API, listens to the Gerrit events feed, and posts changes to tasks and patches into various IRC channels.


 * wikibugs.py: Runs as  and polls the API, and inserts all task events into a redis queue
 * grrrrit.py: Runs as  and listens to the Gerrit stream-events feed, and inserts all changes events into a redis queue
 * redis2irc.py: Runs as, reads from the redis-queue, and notifies various channels.
 * redis2stdout.py is useful when debugging if you don't want to have to connect to IRC all the time.

Source
The source for wikibugs can be found in Git:

https://gerrit.wikimedia.org/g/labs/tools/wikibugs2/

Including the channels list and gerrit-channels list.

Deploying changes
Everything is deployed via fabric. You need to run these commands from your own computer. Fab then logs in to toolforge and runs commands for you.

If your change just updates the channel list:
 * May take up to 60 seconds to notice the change.
 * Jenkins should do this automatically after the change is merged.
 * Jenkins should do this automatically after the change is merged.

If you need to restart the phabricator listener:
 * Note that it will lose its position and drop any events that occur while it is not running.
 * Note that it will lose its position and drop any events that occur while it is not running.

If you need to restart the gerrit listener:
 * Note that it will lose its position and drop any events that occur while it is not running.
 * Note that it will lose its position and drop any events that occur while it is not running.

If you have to restart the IRC bot (you really shouldn't)

Each action should cause a message to be !log'd in #wikimedia-cloud.

If jobs are not running, you can start both with

Muting wikibugs
There is currently no IRC-based method for this. Maintainers can kill the phabricator listener via:

The job can be restarted using  as described above. If you do not have access to fabric, run:

Making wikibugs ignore certain users
In the case of a vandal attacking Phabricator, you likely want to quietly cause the bot to drop their messages (so Freenode stops killing the bot for flooding) without giving them the recognition of a commit.

In, there is a function named   with an ignored tuple in it. Add the username to the tuple on labs,, wait for it to disappear from  , then on your machine. Then let it run for a while until the vandal's account has been disabled and all their messages have been popped from redis. Then reverse the change.

During this it will still be processing their phabricator edits behind the scenes so depending on volume it may be slow to post things to IRC.

Configuring channels
Update channels.yaml or gerrit-channels.yaml with the channel name and project name. Project names can be regular expressions and are case insensitive.

Note that before wikibugs can be added to a new channel, it must be whitelisted by freenode staff (454263 has some more details). wikibugs maintainers will take care of this step when necessary.

Help
Find any of the following friendly people on IRC and they should be able to help you out:
 * legoktm
 * valhallasw

The list of people who have access to the bot can be found here.