Page MenuHomePhabricator

Unit tests of FanBoxes extension failing on updater related to SocialProfile/SystemGifts
Closed, ResolvedPublic

Description

https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-docker/42757/console

12:59:50 Running /workspace/src/extensions/SocialProfile/SystemGifts/maintenance/migrateOldSystemGiftsUserColumnsToActor.php...
12:59:50 Cannot spawn child: MigrateOldSystemGiftsUserColumnsToActor
12:59:50 [734cb860cd953366c66e5a50] [no req]   Error from line 747 of /workspace/src/maintenance/Maintenance.php: Class 'MigrateOldSystemGiftsUserColumnsToActor' not found
12:59:50 Backtrace:
12:59:50 #0 /workspace/src/includes/installer/DatabaseUpdater.php(1035): Maintenance->runChild(string)
12:59:50 #1 /workspace/src/includes/installer/DatabaseUpdater.php(490): DatabaseUpdater->runMaintenance(string, string)
12:59:50 #2 /workspace/src/includes/installer/DatabaseUpdater.php(458): DatabaseUpdater->runUpdates(array, boolean)
12:59:50 #3 /workspace/src/includes/installer/DatabaseInstaller.php(315): DatabaseUpdater->doUpdates(array)
12:59:50 #4 /workspace/src/includes/installer/Installer.php(1612): DatabaseInstaller->createExtensionTables(MysqlInstaller)
12:59:50 #5 /workspace/src/includes/installer/CliInstaller.php(198): Installer->performInstallation(array, array)
12:59:50 #6 /workspace/src/maintenance/install.php(140): CliInstaller->execute()
12:59:50 #7 /workspace/src/maintenance/doMaintenance.php(99): CommandLineInstaller->execute()
12:59:50 #8 /workspace/src/maintenance/install.php(201): require_once(string)
12:59:50 #9 {main}

The class is in the autoloader of SystemGifts, but I am not sure if the extension is loaded, because the extension.json is in a subfolder of the SocialProfiles extensions

The given script path is not used to determine the location of the class, it is just for output.
Maybe it should be passed from DatabaseUpdater::runMaintenance to Maintenance::runChild to allow loading classes when the class is not found in the autoloader

Event Timeline

ashley added a subscriber: ashley.Jan 29 2020, 7:28 AM

The class is in the autoloader of SystemGifts, but I am not sure if the extension is loaded, because the extension.json is in a subfolder of the SocialProfiles extensions

I've no clue what CI is doing differently than a regular MW install, because the author patch and related stuff work just well on a non-CI instance, hence why I merged those patches. SocialProfile's main loader file, due to its weird structure and whatnot, is still SocialProfile.php (instead of an extension.json file; see T152865); that file in turn loads the subfolders' extension.json files via a wfLoadExtensions() call (see lines 105-112 of SocialProfile.php).

So yeah, I'm totally confused and lost here and any and all help in figuring out this mess & fixing it would be greatly appreciated!

Change 570299 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/SocialProfile@master] Trying to get CI working again

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

So it seems like the fundametnal issue is: install.php --with-extensions loads SocialProfile.php. However, due to the fact this happens after mediawiki is setup, it doesn't do any of the wfLoadExtension() calls in that file (Presumably because this happens after Setup.php; See Installer::includeExtensions).

Change 574881 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/SocialProfile@master] Add a bunch of "does the old field even exist?" checks to the actor migration scripts

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

Change 574881 merged by Jack Phoenix:
[mediawiki/extensions/SocialProfile@master] Add a bunch of "does the old field even exist?" checks to the actor migration scripts

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

Change 570299 merged by jenkins-bot:
[mediawiki/extensions/SocialProfile@master] Trying to get CI/installer working again

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

Jdforrester-WMF closed this task as Resolved.Feb 25 2020, 10:47 PM
Jdforrester-WMF assigned this task to ashley.