Jump to content


From Wikitech
Toolforge tools
Website https://toolsadmin.wikimedia.org/tools/id/officewikibot
Description Bot for doing boring maintenance things on the Wikimedia Foundation staff wiki.
Keywords pywikibot
Author(s) BryanDavis
Maintainer(s) BryanDavis (View all)
Source code gitlab
License GNU General Public License 3.0 or later
Admin log Tools.officewikibot/SAL

Officewikibot runs Pywikibot scripts to automate maintenance tasks on the Wikimedia Foundation staff wiki.


The bot is deployed as a collection of Toolforge scheduled jobs each running a build service managed container. This container is a variant of the image used to run Pywikibot built-in scripts by other tools. The image has been tweaked to support bot password authentication because officewiki does not currently support the OAuth authentication method used by project wiki bots.

Updating the image

This should happen following each Pywikibot upstream release.

  1. Wait for the upstream Pywikibot image to be updated.
  2. Update our toolforge branch to match the upstream toolforge branch.
  3. Create a merge request to update our main branch with the upstream changes as a new merge commit.
  4. Land the merge request.
  5. Start a build of the new container image:
    $ toolforge build start https://gitlab.wikimedia.org/toolforge-repos/officewikibot-pywikibot

Scheduled jobs

Jobs descriptions are maintained in $HOME/jobs.yaml:

- name: fix-double-redirects
  command: pwb -family:officewiki redirect both -moves -always
  image: tool-officewikibot/tool-officewikibot:latest
  no-filelog: true
  emails: all
  schedule: '@weekly'


The scripts use twelve-factor app style config via environment variables. In Toolforge this configuration is managed with the toolforge envvars command.

$ toolforge envvars list
name                   value
PWB_BOTPASSWORD        <redacted>
PWB_USERNAME           Officewikibot

See also