Page MenuHomePhabricator

Run MigrateActorsAF on all wikis
Closed, ResolvedPublic

Description

Since all wikis now write to the new fields (T334295), run extensions/AbuseFilter/maintenance/MigrateActorsAF.php on all wikis from all.dblist.

Event Timeline

Ladsgroup subscribed.

Are all the needed patches deployed? I want to start with beta cluster and then test wikis and so on.

Yes, the database fields have been added, and all wikis write to them.

I'm getting this in labs:

ladsgroup@deployment-deploy03:~$ foreachwikiindblist all-labs extensions/AbuseFilter/maintenance/MigrateActorsAF.php
-----------------------------------------------------------------
aawiki
-----------------------------------------------------------------
Fatal error: Cannot declare class MediaWiki\Extension\AbuseFilter\Maintenance\MigrateActorsAF, because the name is already in use in /srv/mediawiki-staging/php-master/extensions/AbuseFilter/maintenance/MigrateActorsAF.php on line 30
....
-----------------------------------------------------------------
zhwikivoyage
-----------------------------------------------------------------
Fatal error: Cannot declare class MediaWiki\Extension\AbuseFilter\Maintenance\MigrateActorsAF, because the name is already in use in /srv/mediawiki-staging/php-master/extensions/AbuseFilter/maintenance/MigrateActorsAF.php on line 30

Something is wrong:

ladsgroup@deployment-deploy03:~$ mwscript extensions/AbuseFilter/maintenance/MigrateActorsAF.php --wiki=aawiki
Fatal error: Cannot declare class MediaWiki\Extension\AbuseFilter\Maintenance\MigrateActorsAF, because the name is already in use in /srv/mediawiki-staging/php-master/extensions/AbuseFilter/maintenance/MigrateActorsAF.php on line 30

Oops. Maybe the declaration boilerplate is not in sync? Taking PurgeOldLogIPData as the example:

namespace MediaWiki\Extension\AbuseFilter\Maintenance;

// @codeCoverageIgnoreStart
$IP = getenv( 'MW_INSTALL_PATH' );
if ( $IP === false ) {
	$IP = __DIR__ . '/../../..';
}
require_once "$IP/maintenance/Maintenance.php"; // <-- this was missing
// @codeCoverageIgnoreEnd

class MigrateActorsAF { }

$maintClass = MigrateActorsAF::class;  // <-- this was wrong
require_once RUN_MAINTENANCE_IF_MAIN;

Change 917900 had a related patch set uploaded (by Matěj Suchánek; author: Matěj Suchánek):

[mediawiki/extensions/AbuseFilter@master] Fix MigrateActorsAF

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

This shouldn't be needed with run.php but I might be missing something

Change 917900 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Fix MigrateActorsAF

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

Ran it and it worked now, Got a lot of

User name "X" is usable, cannot create an anonymous actor for it. Run maintenance/cleanupUsersWithNoId.php to fix this situation.

I haven't checked if it correctly sets the fields though (will check it later)

Mentioned in SAL (#wikimedia-operations) [2023-05-31T20:55:56Z] <Amir1> foreachwikiindblist group0 extensions/AbuseFilter/maintenance/MigrateActorsAF.php (T336224)

Mentioned in SAL (#wikimedia-operations) [2023-05-31T20:57:25Z] <Amir1> foreachwikiindblist group1 extensions/AbuseFilter/maintenance/MigrateActorsAF.php (T336224)

@matej_suchanek I ran it on group0 and group1, do you want to do a double check of the correctness of the data before I move on to group2 and calling this done?

I couldn't find anything that would seem incorrect. I also made a change to a filter on Wikidata, and it was correctly attributed to me.

Mentioned in SAL (#wikimedia-operations) [2023-06-01T09:53:39Z] <Amir1> ladsgroup@mwmaint1002:~$ foreachwikiindblist group2 extensions/AbuseFilter/maintenance/MigrateActorsAF.php (T336224)

Ladsgroup added a project: DBA.
Ladsgroup moved this task from Triage to Done on the DBA board.