Jump to content

Corto

From Wikitech

Corto is an IRC bot providing incident response workflow automation tooling.

Description

Corto is a stateless IRC bot that aims to reduce the toil of a Phabricator-centric incident response workflow. Its features are:

  • Create new incidents (a Phabricator issue & corresponding Google collab doc, cross-linked to one another)
  • List active incidents
  • Log a simple comment to an open issue
  • (Re)assign an incident coordinator
  • Resolve an open incident

An open incident in the context of Corto is a Phabricator issue tagged #Wikimedia-Incident with a status of In Progress. When an incident is resolved through Corto, its status is updated to Open (suppressed from the list of on-going incidents, but open pending follow-up).

Access control

Incidents created by Corto are private by default; Both the Phabricator issue and the Google Doc are restricted to members of SRE. If there are no privacy concerns, then access can be added accordingly through the respective web interfaces.

Additionally, Corto does not currently restrict who can execute a command, so the bot resides only in #mediawiki_securityconnect.

Usage

The bot can be found in the #mediawiki_securityconnect channel, typically as user cortobot. Commands can be issued by prefixing the bot's username and a colon, in the popular convention used when addressing someone. For example:

<lmata> cortobot: help
Command Description
create <title> Open a new incident and note it on the handover doc.
list List open incidents.
log <phab ID> <text> Log a simple comment to an incident (experimental).
note -p <text> Add a note to the handover doc.
notes -p Tell me the handover notes from the prior shift
resolve <phab ID> Mark an open incident resolved.
set-coordinator <phab ID> <phab user> (Re)assign the incident coordinator.
version emit the version of corto that is running

Deployment

Source code: gitlab:sre/corto

Corto runs from the currently active alert host (e.g. alert1002). To deploy a new version, follow the steps in the README to create a release, and build a Debian package. Upload the package to the Debian APT repository, and upgrade the package on the alert host. The bot contains a (undocumented) version command that can be used to validate a deployment.

<urandom> cortobot: version
<cortobot> cortobot v1.0.9 (2025-02-19T19:26:41+00:00)

Future

See: gitlab:repos/sre/corto/-/blob/main/ROADMAP.markdown

See also