One step away from doing everything in global variables is loading the config schema, and thus default values, via SettingsBuilder rather than including DefaultSettings.php in global scope.
This should be done carefully in WMF production, to avoid breakage and performance degradation. The following steps are needed:
- Load the config schema via SettingsLoader if the MW_USE_CONFIG_SCHEMA environment variable is set. Otherwise, load DefaultSettings.php as before.
- Collect timing information about loading deaults in Setup.php.
- Make a dashboard for timing information about loading deaults in Setup.php. https://grafana.wikimedia.org/d/ge9ndts7z/config-loading-performance
- Make MWMultiVersion set MW_USE_CONFIG_SCHEMA if the file /var/run/php/use-config-schema exists on the current host. https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/772937
-
create a use-config-schema file in the container that runs the beta sites and watch for errors. - create a use-config-schema file one a debug host and watch for errors.
- create a use-config-schema file one a single host serving web requests, watch for errors, and observe timing metrics.
- create a use-config-schema file hosts serving API requests and running jobs. Watch for errors, and observe timing metrics.
- if all is good, set the variable unconditionally in MWMultiVersion. Watch for errors, and observe timing metrics.
- if all is still good after a few days, remove the conditional from Setup.php https://gerrit.wikimedia.org/r/c/mediawiki/core/+/775896
- Finally, after the above has been deployed everywhere for at least a week (!), remove the relevant code from MWMultiVersion.