Page MenuHomePhabricator

Block schema: Add a bot field
Open, Needs TriagePublic

Description

In the recentchanges table, we have a field for rc_bot, which per the manual does:

Records whether the change was made by a 'bot account'. If the value
for this field is 1, then the change was made by a 'bot' (i.e. a user
with the 'bot' permission); it is 0 otherwise. It is possible for bots
to avoid setting this flag on their change by including the parameter
"bot=0" in the form submission. Also, users with the 'rollback' and
'markbotedits' permissions may retroactively mark their rollbacks and
the edits being rolled back as bot edits by including the parameter
"bot=1" in the rollback link.

This task proposes to add a similar bot column to the new blocks table as it's being refactored in T346293.

Bots which add blocks to the system should set the bot flag. That makes it easy to segment blocks created by humans and by automated processes.

AIUI, at least currently some blocks are added to the system by non-bot user group users, but using automated scripts. In this proposal, we'd ask that those users set the bot flag in their API requests and set the field in the bot column.

Event Timeline

Another potential use case is admins who are blocked with bot option can unblock self, which will solves T232908: Admins blocked by User:Abuse filter cannot unblockself.

Another potential use case is admins who are blocked with bot option can unblock self, which will solves T232908: Admins blocked by User:Abuse filter cannot unblockself.

IIUC, this use case is different from what I've proposed. You'd want a bot flag added to the block_actor table, so it's obvious that the target of the block is intended to be a bot? Whereas I am proposing that when users create blocks in the system, we identify those blocks as being created by bot users if they are in fact bots (e.g. BlockBot-es, ST47ProxyBot).