Page MenuHomePhabricator

Remove old user groups from Wikimedia wikis (afttest, afttest-hide, etc.)
Open, Needs TriagePublic

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.
Restricted Application added subscribers: Matanya, Aklapper. · View Herald TranscriptJul 11 2015, 12:24 AM

Also the 'monitor' group.

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.

Meno25 added a subscriber: Meno25.Jul 13 2015, 1:07 PM

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.

Restricted Application added subscribers: JEumerus, StudiesWorld. · View Herald TranscriptJan 31 2016, 10:07 PM

Those need to be removed via SQL.

Restricted Application added a subscriber: alanajjar. · View Herald TranscriptFeb 20 2018, 5:54 PM

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