Page MenuHomePhabricator

Check/move/document code in CommonSettings.php after require of CommonSettings-labs.php
Open, Needs TriagePublic

Description

There's a creep of code appearing after

if ( $wmgRealm === 'labs' ) {
	require __DIR__ . '/CommonSettings-labs.php';
}

in CommonSettings.php.

I suspect there's very few cases that this is actually desired (as it can result in overriding of config set in CommonSettings-labs.php).

Most of the code should probably be moved above the require. If there's any code that does need to stay there, we should try and document it...

Event Timeline

Change #1037118 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[operations/mediawiki-config@master] CommonSettings: correct AutoModerator load order

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

At a quick glance the only things that should be after it are the $wgGroupPermissions sanitization, merging $wgLogRestrictions and $wmgLogRestrictions, and the final require.

Change #1037118 merged by jenkins-bot:

[operations/mediawiki-config@master] CommonSettings: correct AutoModerator load order

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

At a quick glance the only things that should be after it are the $wgGroupPermissions sanitization, merging $wgLogRestrictions and $wmgLogRestrictions, and the final require.

Yeah, eyeballing it originally was thinking something similar.

We probably want to add another comment near the labs require like the last one...

# THIS MUST BE AFTER ALL EXTENSIONS ARE INCLUDED
#
# REALLY ... we're not kidding here ... NO EXTENSIONS AFTER

if ( !defined( 'MW_NO_EXTENSION_MESSAGES' ) ) {
	require __DIR__ . "/ExtensionMessages-$wmgVersionNumber.php";
}

Mentioned in SAL (#wikimedia-operations) [2024-05-29T20:10:12Z] <jsn@deploy1002> Started scap: Backport for [[gerrit:1037118|CommonSettings: correct AutoModerator load order (T366203)]]

Mentioned in SAL (#wikimedia-operations) [2024-05-29T20:12:49Z] <jsn@deploy1002> jsn: Backport for [[gerrit:1037118|CommonSettings: correct AutoModerator load order (T366203)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-05-29T20:21:35Z] <jsn@deploy1002> Finished scap: Backport for [[gerrit:1037118|CommonSettings: correct AutoModerator load order (T366203)]] (duration: 11m 22s)