Page MenuHomePhabricator

Skip by user right instead of user group in Automoderator (AutoModeratorSkipUserGroups)
Closed, ResolvedPublic3 Estimated Story Points

Description

Great work on Extension:AutoModerator. I'm really happy to see the foundation invest in patrolling and review workflows.

I looked around a bit to see how it works, and how communities configure it. I noticed something small that might benefit you a lot in the long run to change slightly.

The AutoModeratorSkipUserGroups setting is currently based on user groups, rather than user rights. We usually map things in software or other automation to user rights. Groups vary across communities, change over time, come and go, change names, change scopes, etc. User rights on the other hand have stable identifiers native to the software (not user-defined).

By using user rights:

  • Equity and inclusion: Communities can't forget to add groups that are functionally similar in practice but separate for social reasons ("do what I mean"). For example, they might include "bot" and "sysop", but miss out on "steward", "gadget admin", "interface admin", "flood". Or they might add "reviewer" but forget about "image reviewer", "patroller", and "rollbacker".
  • Cross-wiki collaboration: Communities have to coordinate across wikis to account for global groups (e.g. a "global sysop" is not a local "sysop", we als also have "global interface admin", and "global bot" as distinct groups). MediaWiki core has a built-in abstraction for user rights that automatically works for the global group concept (via the CentralAuth extension). With groups, you'd likely need to develop custom support, integration, and testing with the CentralAuth extension.
  • Save time: Communities can focus on reviewing content instead of perfecting the "skip" list of user groups to encompass dozens of local and global groups, and for volunteers to lobby for this on each of 900 wikis.
  • An even better first experience: The current default is skip groups=['bot', 'sysop'] which is pretty good, and probably covers 90% of use cases on a given wiki. But, on no wiki would this be the ideal configuration, so everybody has to override and change at least a little. A default like skip rights=['bot', 'autopatrol', 'editprotected'] would likely be a workable default on a majority of wikis, regardless of local groups, global groups, and their own unique division of social roles.
  • Easy to understand: If you can do "X" (a right that you can see and experience), then you get "Y" (auto moderator).

The "autopatrol" right is very topically appropiate as it marks those people's edits as needing no review, such as most typical local "reviewer", "patroller", "autopatrolled", and "rollbacker" groups that many wikis have and the global rollbackers group. The "bot" right helps make sure "global bots", "flood", and any other bot-related group is covered. These two cover most administrator roles, but adding "editprotected" makes sure the other high trust and administrator roles are also covered, even if in communities that don't use patrolling (some wikis disable this), or opt-ed out of bot rights, such as global sysop, and global interface editors. There are other rights that you might want to use instead. Have a look at some of the above global groups to see what rights they contain, and compare them to MainConfigSchema#GroupPermissions in mediawiki/core.git. Perhaps other rights would fit better.

A few years ago we spent a good amount of effort converting AbuseFilter rules on many wikis to be based on user rights instead of user groups, because the group model often caused collateral damage on smaller user groups on large wikis, and smaller wikis in their entirety. It is then often awkward and difficult to find out whether or not you can complain about it, to whom, where, how, whether it was intended and you have to convince someone or it's a minor mistake. I'm raising this as something similar might happen with Automoderator. As a developer I knew there was no reason for AbuseFilter to exclude a certain user group, but most affecteds user in a social context, would be quite intimidated in trying to convince an admin to allow them to be included. In particular, global users (who appear "new" on each wiki) which often run into this issue and then go through a language barrier to try to change or improve local configuration.

We do have a few other things based on user groups, so it's not wrong per-se, but I thought it was worth raising in case it makes sense for your case. The transition should be fairly straight-forward, i.e. no breaking change.

Event Timeline

Thanks for taking the time to write this out @Krinkle! You make a convincing case and I appreciate you explaining the nuances between rights and groups that weren't familiar to me.

Communities can't forget to add groups that are functionally similar in practice but separate for social reasons ("do what I mean"). For example, they might include "bot" and "sysop", but miss out on "steward", "gadget admin", "interface admin", "flood".

Funnily enough we forgot to consider global groups - someone I was talking with at Wikimania this week said they'd been blocked by an anti-vandalism bot in the past for the same reason. This is definitely something we should address one way or another.

The reason that we went for groups was that we thought it was more intuitive to editors. We tend to see that users talk about sysops and patrollers, not individual rights like editprotected and reviewer, so it seemed clearer to talk about groups, but we didn't really research this in any detail. I can definitely see the benefits to switching to a user right based model.

One idea that had crossed my mind but that we didn't pursue was to have a kind of automoderator-exempt user right, which local wikis could then apply to different groups. That would have required a different process than the Community Configuration-centred one that we're trying to keep as simple and centralised as possible though, so we didn't take it any further. I'm curious if you have any thoughts about that approach - it might be clearer conceptually than tagging on some additional implications to existing user rights, even if it's clearly worse from a user experience point of view for someone setting up the software.

I think a dedicated user right could be interesting yeah. If you need fine-grained tuning, that might scale better than listing out either user rights or user groups. I like to think of user groups as the leaf nodes of access management, it's in the territory of communities to compose and assign these as they see fit. Inside software, we generally communicate based on user rights. This separation improves discovery and interoperability and reduces need for novel tooling and their cost/maintenance/bugs. For example, it would mean that Special:ListGroupRights remains a reliable place to find who can do what and Special:UserRight remains the central place to assign user groups (yeah, oddly named that one, isn't it!). Instead of having to know there's another place specific to one extension where behaviours are sideloaded into certain groups, without being defined as part of that group.

In interest of a good default experience (for third parties, local dev, CI, and new WMF wikis adopting this), I would suggest starting with autopatrol and bot. I agree on second thought that editprotected is acting as a proxy in my initial suggestion. I wonder if that's actually needed. Have you encountered wikis wanting to opt-out groups beyond autopatrolled/bot? In other words, groups that don't have and and couldn't be given autopatrolled (signalling their edits do not need review) and not bot-capable (i.e. an approved semi-automated system, should never be disrupted by another automated system). One thing to note there is that, given historically low adoption of native edit patrolling for legacy reasons, I expect some wikis will not yet have assigned autopatrol to relevant groups that are socially exempted from patrolling. If a wiki isn't yet using native edit patrolling, they might not have bothered granting the right. Granting that right would be harmless in that case, and also helps preparing the wiki for future progress in that space.

If yes, I think you're right that a new user right would be a better fit long-term. This would mean that from the extension side, user rights become non-configurable. This has the added benefit of making Special:ListGroupRights even more useful. Similarly as above, it means the data can be understood without additional knowledge of each local wiki's configuration. Varying the meaning of a user right across wikis, is similarly surprising to adding meaning to a user group outside its definition.

Scardenasmolinar set the point value for this task to 3.
Samwalton9-WMF renamed this task from Consider skipping by user right instead of user group (AutoModeratorSkipUserGroups) to Skip by user right instead of user group in Automoderator (AutoModeratorSkipUserGroups).Aug 20 2024, 3:31 PM
Scardenasmolinar changed the task status from Open to In Progress.Aug 20 2024, 6:40 PM
Scardenasmolinar claimed this task.
Scardenasmolinar moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

Change #1064846 had a related patch set uploaded (by Scardenasmolinar; author: Scardenasmolinar):

[mediawiki/extensions/AutoModerator@master] Pre-check for user rights instead of user groups

https://gerrit.wikimedia.org/r/1064846

make sure you have $wgGroupPermissions['sysop']['autopatrol'] = true; in local settings

Change #1064846 merged by jenkins-bot:

[mediawiki/extensions/AutoModerator@master] Pre-check for user rights instead of user groups

https://gerrit.wikimedia.org/r/1064846

@Dogu, for next week can you add the config AutoModeratorSkipUserRights: [ "bot", "autopatrol" ]instead of AutoModeratorSkipUserGroups? We will now use user rights instead of user groups to skip edits made by trusted accounts.

@Dogu, for next week can you add the config AutoModeratorSkipUserRights: [ "bot", "autopatrol" ]instead of AutoModeratorSkipUserGroups? We will now use user rights instead of user groups to skip edits made by trusted accounts.

Hey @Scardenasmolinar, please remind me once more when exactly it’s needed so I can do it on time.

@Dogu, for next week can you add the config AutoModeratorSkipUserRights: [ "bot", "autopatrol" ]instead of AutoModeratorSkipUserGroups? We will now use user rights instead of user groups to skip edits made by trusted accounts.

Hey @Scardenasmolinar, please remind me once more when exactly it’s needed so I can do it on time.

This change is incoming on next week's train, so if you could make the change on late Thursday/ early Friday next week, that would be great!

@Samwalton9-WMF, Could you please review and confirm if this JSON configuration is correct?

{
  "AutoModeratorEnableRevisionCheck": true,
  "AutoModeratorUndoSummary": "[[Özel:Katkılar/$2|$2]] ([[Kullanıcı mesaj:$2|mesaj]]) tarafından yapılan [[Özel:Fark/$1|$1]] numaralı revizyona sahip değişiklik geri alındı",
  "AutoModeratorUndoSummaryAnon": "[[Özel:Katkılar/$2|$2]] tarafından yapılan [[Özel:Fark/$1|$1]] numaralı revizyona sahip değişiklik geri alındı",
  "AutoModeratorFalsePositivePageTitle": "Vikipedi:AutoModerator/Hatalar",
  "AutoModeratorSkipUserRights": [
    "bot",
    "autopatrol"
  ],
  "AutoModeratorUseEditFlagMinor": true
}

@Dogu feel free to delete the following fields as they are now handled via i18n system messages

"AutoModeratorUndoSummary": "[[Özel:Katkılar/$2|$2]] ([[Kullanıcı mesaj:$2|mesaj]]) tarafından yapılan [[Özel:Fark/$1|$1]] numaralı revizyona sahip değişiklik geri alındı",
"AutoModeratorUndoSummaryAnon": "[[Özel:Katkılar/$2|$2]] tarafından yapılan [[Özel:Fark/$1|$1]] numaralı revizyona sahip değişiklik geri alındı",

otherwise, looks good to me!