After restart, the bot joins only connect by default. Other channels are joined when the first relevant message to them is supposed to be sent.
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
libera-phaband polls the API, and inserts all task events into a redis queue
- grrrrit.py: Runs as
libera-grrrritand listens to the Gerrit stream-events feed, and inserts all changes events into a redis queue
- redis2irc.py: Runs as
libera-irc, 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.
The source for wikibugs can be found in Git:
Update channels.yaml or gerrit-channels.yaml with the channel name and project name. Project names can be regular expressions and are case insensitive. For the most part, this is self-serve and up to the people who operate and participate in each individual channel. Many people have +2 on the repository, if you are trusted, please ask and we can add you.
Note that before wikibugs can be added to a new channel, it must be autovoiced in that channel to avoid issues with the ozone anti-spam bot (T283983). Please do not merge changes which add wikibugs to a new channel until a wikibugs maintainer has checked this step.
IRC channel operators can do:
/msg chanserv flags <#channel> wikibugs +Vv to set the correct flags.
You need to ssh into tools-login.wmflabs.org and run the following commands:
become wikibugs # sudo -i become wikibugs if you're in sudoers but not a member of tools.wikibugs cd ~/libera
Since Gerrit change 455347 deployment is performed using a 'manage.py' script in the tool directory.
The manage.py script provides the following commands:
python3 manage.py deploy [job name] [job name]
- This will pull changes, and will restart the jobs provided (see above for job names)
- If no job names are provided, all jobs will be restarted
python3 manage.py pull
- pulls changes into the working directory
python3 manage.py start_job [job name]
- Starts (i.e., jsub) the provided job
python3 manage.py start_jobs
- This will start all jobs.
There is currently no IRC-based method for this. Maintainers can kill the phabricator listener via:
user@tools-bastion-03:~$ become wikibugs tools.wikibugs@tools-bastion-03:~$ qstat job-ID prior name user state submit/start at queue slots ja-task-ID ----------------------------------------------------------------------------------------------------------------- 4602105 0.39032 wb2-phab tools.wikibu r 03/24/2016 04:29:15 email@example.com 1 5736318 0.32072 lighttpd-w tools.wikibu r 04/28/2016 04:15:16 webgrid-lighttpd@tools-webgrid 1 6049120 0.30351 wb2-irc tools.wikibu r 05/06/2016 19:56:31 firstname.lastname@example.org 1 tools.wikibugs@tools-bastion-03:~$ qdel 4602105
- ssh tools-login.wmflabs.org ; sudo -i become wikibugs
- stop all jobs found in
qstat's output with
qstatuntil all jobs have been successfully deleted and its output is empty
cd liberaand run
python3 manage.py start_jobs.
Check wikibugs server log
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 Libera Chat stops killing the bot for flooding) without giving them the recognition of a commit.
redis2irc.py, there is a function named
handle_useful_info with an ignored tuple in it. Add the username to the tuple on labs,
qdel libera-irc, wait for it to disappear from
qstat, restart the job as normal (see Restarting wikibugs above). 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.
Find any of the following friendly people on IRC and they should be able to help you out:
The first wikibugs, started in August 2004, was a Perl script that parsed Bugzilla's email messages, wrote them to a log file, and relied on ircecho to post them. In April 2014, the bot was rewritten in Python ("pywikibugs"), still parsing email messages, but using a Redis queue to post on IRC. Later in November 2014, the bot was rewritten again ("wikibugs2"), this time handling bugs from Phabricator rather than Bugzilla, but reused many of the ideas from pywikibugs such as a Redis queue and asyncio. In 2021, the bot moved left Freenode and moved to Libera Chat.