Tool:ReleaseTaggerBot

From Wikitech
(Redirected from ReleaseTaggerBot)

ReleaseTaggerBot, originally known as forrestbot, is a bot which adds release milestone tags to Phabricator tasks based on when gerrit commits linked to them are merged.

The bot runs on Toolforge using an hourly job through the jobs framework, as defined in k8s-jobs.yaml. Output and errors are logged to log files which are available through https://forrestbot.toolforge.org/. In addition, an error email is sent to all maintainers in case the job terminates with an error condition.

In terms of data flow:

  • Gerrit events are sent to the mediawiki-commits mailing list
  • The mailing list forwards the email to ReleaseTaggerBot's email inbox
  • Every hour, the bot pulls emails from the inbox over POP3
    • For every email, the bot checks which tags (slugs) need to be added
    • After all mails have been processed, the bot adds the required slugs to each task
    • If everything is succesful, the emails are cleared from the inbox

Development

The code for the bot is in Wikimedia Gerrit at labs/tools/forrestbot.git (recent changes).

Deployment

To deploy a new change, get the code merged into master and then:

Automatic method

Doesn't exist yet

Manual method

$ ssh yourusername@login.toolforge.org
$ become forrestbot
$ cd forrestbot/
$ git fetch --all
$ git reset --hard origin/master
$ git log # make sure your changes made it in

Then wait for the next hour for the cron script to execute.

Log any changes you make in the SAL, you can use:

  • dologmsg 'your message' directly in the terminal; or
  • !log tools.forrestbot Your message in #wikimedia-cloud connect


If you need to run the bot out-of-sequence, open up a k8s shell using:

toolforge webservice python3.9 shell

then in the terminal, run:

/data/project/forrestbot/venv-tf-python39/bin/python /data/project/forrestbot/forrestbot/forrestbot.py

Logs

SAL

Operations

Access

Automated list of maintainers.