While working on T384181: Remove the Argentina/Chile/Mexico campaign-related code, I discovered we use GrowthExperimentsServices::getWikiConfig to request variables that cannot be in community configuration, because they are not present in any of the schemas we registered. For example:
$growthServices = GrowthExperimentsServices::wrap( $services ); return new CampaignConfig( $growthServices->getGrowthWikiConfig()->get( 'GECampaigns' ) ?? [], $growthServices->getGrowthWikiConfig()->get( 'GECampaignTopics' ) ?? [], $services->getUserOptionsLookup() );
with the CommunityConfiguration extension will always load GECampaigns and GECampaignTopics from the server configuration, and never from community configuration. This is because neither variable is registered in any community configuration schema, so MediaWikiConfigReader from CommunityConfiguration would never know what provider to contact:
urbanecm@wmf3345 GrowthExperiments % git grep GECampaigns
ServiceWiring.php: $growthServices->getGrowthWikiConfig()->get( 'GECampaigns' ) ?? [],
extension.json: "GECampaigns": {
includes/Config/GrowthExperimentsMultiConfig.php: 'GECampaigns',
includes/Config/GrowthExperimentsMultiConfig.php: 'GECampaigns' => 'array_merge',
includes/Config/Validation/GrowthConfigValidation.php: 'GECampaigns' => [
includes/NewcomerTasks/CampaignConfig.php: * Wrapper for the GECampaigns PHP / community configuration variable, used to retrieve
includes/NewcomerTasks/CampaignConfig.php: * @return string|null The campaign name, which is the array key used in $wgGECampaigns.
tests/phpunit/unit/Config/GrowthExperimentsMultiConfigTest.php: 'wiki only' => [ 'GECampaigns', null, [ 'foo' => 1 ], [ 'foo' => 1 ] ],
tests/phpunit/unit/Config/GrowthExperimentsMultiConfigTest.php: 'global only' => [ 'GECampaigns', [ 'foo' => 1 ], null, [ 'foo' => 1 ] ],
tests/phpunit/unit/Config/GrowthExperimentsMultiConfigTest.php: 'aray_merge' => [ 'GECampaigns', [ 'foo' => 1, 'bar' => 2 ], [ 'foo' => 2, 'baz' => 3 ],
urbanecm@wmf3345 GrowthExperiments % git grep GECampaignTopics
ServiceWiring.php: $growthServices->getGrowthWikiConfig()->get( 'GECampaignTopics' ) ?? [],
extension.json: "description": "A map of campaign ID to campaign configuration. Campaign configuration currently includes these fields:\n* pattern: a regexp matched against the \"campaign\" request parameter during signup to determine whether the user should be included in some campaign\n* signupPageTemplate: a template name to use for the \"benefits\" block of Special:CreateAccount\n* signupPageTemplateParameters: a map of parameters to pass to the template\n* topics: an array of topic IDs (which are defined in GECampaignTopics) to include on the top of the topic selector as custom topics\n\nExamples can be found at https://www.mediawiki.org/wiki/Extension:GrowthExperiments/Technical_documentation/Special:EditGrowthConfig.",
extension.json: "GECampaignTopics": {
includes/Config/GrowthExperimentsMultiConfig.php: 'GECampaignTopics',
includes/Config/Validation/GrowthConfigValidation.php: 'GECampaignTopics' => [
urbanecm@wmf3345 GrowthExperiments %Using growthWikiConfig is significantly less efficient, so we should aim not doing that whenever possible.
In addition to this, MediaWikiConfigReader should probably complain if it is used to request a variable that is not registered.