Phabricator/Bots

From MediaWiki.org
Jump to: navigation, search

Other languages:
English • ‎español • ‎日本語 • ‎polski • ‎中文

Phabricator bots are users in Phabricator for whom actions are automated or are a consequence of the actions of multiple users. See the upstream documentation for more information.

Phabricator bots are similar to MediaWiki bots, and much of the general Wikimedia bot policy is relevant to them.

Check the list of bots registered in phabricator.wikimedia.org.

Separating bot accounts from personal accounts[edit]

A personal user account is not appropriate for repetitive patterns of activity, as in the human case they would almost universally be considered spam, or at best be locked into someone's personal account. Activity that originates from a specific account that appears to be spam may require the account to be disabled or deleted. In these instances, if the offending account is also the personal account of a user, they will not be able to appeal or explain the situation.

Acquiring a bot[edit]

Unlike regular Phabricator accounts, which are tied to a Wikimedia SUL or LDAP account, bot accounts are created natively in Phabricator. In order to request a bot account, please create a task under the Bot-Requests project with the following details:

  • Name
  • Purpose
  • An email address (which can be invalid but must be unique)
  • Responsible user or organization

Phabricator admins: Steps to perform[edit]

Steps for Phabricator admins to create such an account:

  • Create bot user
  • For transparency, add human owner to bot account description
  • Go to "Edit Settings", go to "Conduit API Tokens", click "Generate API token". Copy that token.
  • Create paste containing that token and set "View policy" to human owner and yourself
  • Paste link in the creation request task and ask human owner to close the task once it works as expected

Bot account holders: Steps to perform[edit]

These are the steps to configure arc to use your bot account.

  • Acquire account certificate for your bot
  • Create an arc configuration file matching the following, replacing "<your bot account id>" and "<your bot certificate>" with the appropriate values.
 {
   "config" : {
     "default" : "https:\/\/phabricator.wikimedia.org\/"
   },
   "hosts"  : {
     "https:\/\/phabricator.wikimedia.org\/api\/" : {
       "user" : "'''''<your bot account id>'''''",
       "cert" : "'''''<your bot certificate>'''''"
     }
   }
 }
  • Save this file somewhere. The default location arc looks is ".arcrc" in your home directory (~/.arcrc on Linux and Mac), but if you already have an arcrc file on the machine you're testing with, you may prefer to save it elsewhere. For purposes of this example, we'll use "bot.arcrc" in the current working directory.
  • Run the following command as a test:
 $ arc tasks --unassigned --limit 1 --arcrc-file bot.arcrc

This should return a short summary of a single task out of Maniphest.