Page MenuHomePhabricator

Remove old user groups from Wikimedia wikis (afttest, afttest-hide, etc.)
Closed, ResolvedPublic

Description

https://en.wikipedia.org/w/index.php?title=Special%3AListUsers&username=Philippe+%28WMF%29&group=&limit=1

Philippe (WMF) (talk | contribs)‏‎ (edit filter manager, afttest, afttest-hide) (Created on 19 January 2010 at 12:00)

afttest and afttest-hide should probably be removed from users. They're relics from the ArticleFeedback extension, I believe.

I'm not sure if we have a maintenance script for cleaning up orphaned user groups. I also don't know if this problem exists for other user groups on the English Wikipedia or if this problem exists for other Wikimedia wikis.

Event Timeline

MZMcBride raised the priority of this task from to Needs Triage.
MZMcBride updated the task description. (Show Details)
MZMcBride added subscribers: MZMcBride, Krenair, Legoktm.

04:11, 20 August 2014 Xaosflux (Talk | contribs) changed group membership for User:Aft5monitor from monitor and rollbacker to monitor (old test user)
18:16, 3 October 2012 User account Aft5monitor (Talk | contribs) was created

I can't find any on-wiki log of that right addition...

Should these groups be emptied of any user on wiki before we remove them at config level?

I don't think they exist at the config level.

terbium:/home/krenair/T105570.php:

<?php
require_once $IP . '/maintenance/Maintenance.php';
class T105570 extends Maintenance {
	public function execute() {
		$config = $this->getConfig();
		$configuredGroups = array_unique( array_merge(
			array_keys( $config->get( 'GroupPermissions' ) ),
			array_keys( $config->get( 'RevokePermissions' ) ),
			array_keys( $config->get( 'AddGroups' ) ),
			array_keys( $config->get( 'RemoveGroups' ) ),
			array_keys( $config->get( 'GroupsAddToSelf' ) ),
			array_keys( $config->get( 'GroupsRemoveFromSelf' ) )
		) );
		$usedGroups = wfGetDB( DB_SLAVE )->selectFieldValues(
			'user_groups',
			'ug_group',
			'',
			__METHOD__,
			array( 'DISTINCT' )
		);
		var_dump( array_diff( $usedGroups, $configuredGroups ) );
	}
}

$maintClass = 'T105570';
require_once RUN_MAINTENANCE_IF_MAIN;

Run with foreachwiki ../../../home/krenair/T105570.php | tee T105570.out
Output with private wikis manually excluded:

krenair@terbium:~$ cat T105570.out | grep string
aawiki:    string(16) "communityapplica"
aawiki:    string(8) "inactive"
enwiki:    string(7) "afttest"
enwiki:    string(12) "afttest-hide"
enwiki:    string(7) "epadmin"
enwiki:    string(7) "monitor"
enwikinews:    string(8) "reviewer"
frwiki:    string(7) "afttest"
frwiki:    string(12) "afttest-hide"
hiwiki:    string(16) "Ex_Administrator"
test2wiki:    string(7) "epadmin"
test2wiki:    string(9) "epcampamb"
test2wiki:    string(11) "eponlineamb"
test2wiki:    string(7) "epstaff"
testwiki:    string(11) "abusefilter"
testwiki:    string(7) "afttest"
testwiki:    string(12) "afttest-hide"
testwiki:    string(12) "contestadmin"
testwiki:    string(10) "contestant"
testwiki:    string(12) "contestjudge"
testwiki:    string(16) "contestparticipa"
testwiki:    string(6) "editor"
testwiki:    string(5) "flood"
MZMcBride renamed this task from Remove old user groups from English Wikipedia users (afttest, afttest-hide, etc.) to Remove old user groups from Wikimedia wikis (afttest, afttest-hide, etc.).Jul 18 2015, 3:59 PM
MZMcBride set Security to None.

Neat! Thanks for whipping up that script.

Those need to be removed via SQL.

Those need to be removed via SQL.

emptyUserGroup.php should do the trick?

Those need to be removed via SQL.

emptyUserGroup.php should do the trick?

Now that the script exists (it didn't when I wrote my original comment), sure; and would be much easier. Thanks.

Those need to be removed via SQL.

emptyUserGroup.php should do the trick?

Now that the script exists (it didn't when I wrote my original comment), sure; and would be much easier. Thanks.

Should a separate task be filed to do the run?

Should a separate task be filed to do the run?

I'm not sure. We should probably get an updated list of unexisting user groups that needs to be removed first?

Should a separate task be filed to do the run?

I'm not sure. We should probably get an updated list of unexisting user groups that needs to be removed first?

epadmin needs to be removed (https://en.wikipedia.org/wiki/Special:ListUsers?group=epadmin)
Not sure about any others

Mentioned in SAL (#wikimedia-operations) [2020-11-13T21:28:28Z] <Urbanecm> [urbanecm@mwmaint1002 ~]$ mwscript emptyUserGroup.php --wiki=enwiki epadmin # T105570

Mentioned in SAL (#wikimedia-operations) [2020-11-13T21:33:22Z] <Urbanecm> [urbanecm@mwmaint1002 ~]$ mwscript emptyUserGroup.php --wiki=aawiki communityapplica # T105570

DannyS712 assigned this task to Urbanecm.

Mentioned in SAL (#wikimedia-operations) [2020-11-13T21:38:48Z] <Urbanecm> [urbanecm@mwmaint1002 ~]$ mwscript emptyUserGroup.php --wiki=test2wiki upwizcampeditors # T105570

Mentioned in SAL (#wikimedia-operations) [2020-11-13T21:39:29Z] <Urbanecm> [urbanecm@mwmaint1002 ~]$ mwscript emptyUserGroup.php --wiki=testwiki flood # T105570

Woops, I guess there were others

Mentioned in SAL (#wikimedia-operations) [2020-11-13T21:40:17Z] <Urbanecm> [urbanecm@mwmaint1002 ~]$ mwscript emptyUserGroup.php --wiki=bnwiki editor # T105570

Mentioned in SAL (#wikimedia-operations) [2020-11-13T21:42:09Z] <Urbanecm> [urbanecm@mwmaint1002 ~]$ mwscript emptyUserGroup.php --wiki=enwikinews reviewer # T105570

Mentioned in SAL (#wikimedia-operations) [2020-11-13T22:04:36Z] <Urbanecm> [urbanecm@mwmaint1002 ~]$ mwscript emptyUserGroup.php --wiki=testwiki editor # T105570

Mentioned in SAL (#wikimedia-operations) [2020-11-13T22:06:01Z] <Urbanecm> [urbanecm@mwmaint1002 ~]$ mwscript emptyUserGroup.php --wiki=myvwiki autopatrolled # T105570