Page MenuHomePhabricator

Audit and empty non-existent user groups on the beta cluster
Closed, ResolvedPublic

Description

dannys712@deployment-deploy01:~$ foreachwiki sql.php --query="SELECT GROUP_CONCAT(DISTINCT ug_group) AS 'groups' FROM user_groups WHERE ug_group NOT IN ('bot', 'sysop', 'interface-admin', 'bureaucrat', 'steward', 'accountcreator', 'import', 'transwiki', 'ipblock-exempt', 'oversight', 'confirmed', 'flow-bot', 'abusefilter', 'checkuser')" --json

finds all user groups in use that are not common to all wikis. Via the api (eg https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&meta=siteinfo&siprop=usergroups) we can check for if a group is defined

Groups with members in the database that don't exist:
enwiki - autoreview (separate from the existing autoreviewer group)
enwiki - suppress (see T112147 and T151688)
fawiki - uploader
fawiki - autopatrol (separate from the existing autopatrolled group)
testwiki - autoreview
testwiki - editor
testwiki - suppress

Additionally, while autoconfirmed is a valid group, it is an implicit one, so there should be no records for it in the database

dannys712@deployment-deploy01:~$ mwscript sql.php --wiki=zhwiki --query="SELECT COUNT(*) FROM user_groups WHERE ug_group = 'autoconfirmed'" --json
[
    {
        "COUNT(*)": "3"
    }
]

since the emptyUserGroup script is based on entries in the database, it should be fine to use that for autoconfirmed too
zhwiki - autoconfirmed

Event Timeline

Restricted Application added a project: User-DannyS712. · View Herald TranscriptFri, Oct 16, 6:53 PM
Restricted Application added subscribers: Huji, Cosine02, Aklapper. · View Herald Transcript

Mentioned in SAL (#wikimedia-releng) [2020-10-16T18:59:42Z] <DannyS712> dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=enwiki autoreview | T265755

Mentioned in SAL (#wikimedia-releng) [2020-10-16T19:00:29Z] <DannyS712> dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=enwiki suppress | T265755

Mentioned in SAL (#wikimedia-releng) [2020-10-16T19:01:28Z] <DannyS712> dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=fawiki uploader | T265755

DannyS712 updated the task description. (Show Details)Fri, Oct 16, 7:02 PM

Mentioned in SAL (#wikimedia-releng) [2020-10-16T19:02:35Z] <DannyS712> dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=fawiki autopatrol | T265755

Mentioned in SAL (#wikimedia-releng) [2020-10-16T19:03:16Z] <DannyS712> dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=testwiki autoreview | T265755

Mentioned in SAL (#wikimedia-releng) [2020-10-16T19:03:44Z] <DannyS712> dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=testwiki editor | T265755

Mentioned in SAL (#wikimedia-releng) [2020-10-16T19:04:07Z] <DannyS712> dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=testwiki suppress | T265755

Mentioned in SAL (#wikimedia-releng) [2020-10-16T19:04:52Z] <DannyS712> dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=zhwiki autoconfirmed | T265755

DannyS712 closed this task as Resolved.Fri, Oct 16, 7:07 PM
dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=enwiki autoreview
Removing users from autoreview...
  ...done! Removed 17 users in total.
dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=enwiki suppress
Removing users from suppress...
  ...done! Removed 5 users in total.
dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=fawiki uploader
Removing users from uploader...
  ...done! Removed 6 users in total.
dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=fawiki autopatrol
Removing users from autopatrol...
  ...done! Removed 1 users in total.
dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=testwiki autoreview
Removing users from autoreview...
  ...done! Removed 2 users in total.
dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=testwiki editor
Removing users from editor...
  ...done! Removed 1 users in total.
dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=testwiki suppress
Removing users from suppress...
  ...done! Removed 1 users in total.
dannys712@deployment-deploy01:~$ mwscript maintenance/emptyUserGroup.php --wiki=zhwiki autoconfirmed
Removing users from autoconfirmed...
  ...done! Removed 3 users in total.