Page MenuHomePhabricator

Prevent incorrect variable name prefix in InitialiseSettings.php
Closed, ResolvedPublic1 Estimated Story Points

Description

As far as I understand, wmf-config/InitialiseSettings.php should only contain settings with the following names:

  • prefix wg – direct settings for MediaWiki core / extensions/ skins
  • prefix wmg – used in some way in wmf-config/CommonSettings.php or somewhere else in the production config
  • groupOverrides and groupOverrides2 – very special settings

Any other array key is probably a mistake (e.g. UseLegacyMediaStyles instead of wgUseLegacyMediaStyles), and it would be nice if CI could notify the user about it, instead of the setting (probably) silently having no effect.

(I expect this also goes for e.g. wmf-config/core-Namespaces.php and all the other settings that were split out of the giant IS.php in T308932 – everything that goes into composer buildConfigCache.)

Event Timeline

(At the moment, there are no other incorrect variable names AFAICT:)

$ time jq -r 'keys | .[]' tests/data/config-cache/*.json | grep -v -e '^wg' -e '^wmg' -e '^groupOverrides2\?$'

real    0m3,221s
user    0m3,301s
sys     0m0,075s

Change 939694 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[operations/mediawiki-config@master] tests: Test setting names

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

Change 939694 merged by jenkins-bot:

[operations/mediawiki-config@master] tests: Test setting names

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

Mentioned in SAL (#wikimedia-operations) [2023-07-19T13:54:37Z] <Lucas_WMDE> pulled [[gerrit:939694|tests: Test setting names (T342249)]] to deploy1002 (no scap sync needed, tests-only change)

Done, I think. That was faster than expected :D