Page MenuHomePhabricator

Write a maintenance script to generate a list of defaults to use during Emergency Shutdown
Closed, ResolvedPublic

Description

CommunityConfiguration needs to be able to shut itself down if required (Emergency Shutdown mode). This is done by short-circuiting CommunityConfiguration logic, returning default values from all providers, rather than querying the configuration store and checking what the real value is. Unfortunately, there is no single default value to return, as it depends on the type and semantics of each configuration option. Fortunately, providers have a schema associated, which specifies default values for each of the values, which can be used during Emergency Shutdown.

During Emergency Shutdown, the schema itself cannot be safely accessed (it is only accessible well after a significant portion of of CommunityConfiguration already runs). For this reason, there will be a defaults file generated for each provider, which will include values to return during Emergency Shutdown. This defaults file will meet the following requirements:

  • formatted as a PHP file, containing an array,
  • stored within the client extension's repository (location defined as an attribute in extension.json, defaulting to CommunityConfigurationFallbacks, relative to extension's root directory), stored in CommunityConfigurationFallbacks relative to the extension's root directory; making this configurable was scoped out to T376985,
  • named after the respective provider, in order to guarantee a predictable name that is computable when Emergency Shutdown is in effect,
  • managed via a maintenance script provided by CommunityConfiguration; this maintenance script would query the schemas and update all necessary default files

Creation of the maintenance script is the scope of this task. For more details about the requirements above, please see T367516#10116543.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1077061 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] WIP: Generate emergency defaults via a maintenance script

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

Change #1077061 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Generate emergency defaults via a maintenance script

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

Urbanecm_WMF updated the task description. (Show Details)
Urbanecm_WMF moved this task from Doing to QA on the Growth-Team (Current Sprint) board.

Script exists and was merged; making the destination configurable is now T376985. Moving to QA.

Change #1079489 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] Add phpcs:ignoreFile to emergency defaults files

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

Change #1079489 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Add phpcs:ignoreFile to emergency defaults files

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

Etonkovidova subscribed.

Checked locally

  • e,g, $ php CommunityConfiguration/maintenance/UpdateEmergencyDefaults.php --wiki=enwiki GrowthExperiments HelpPanel outputs

Updated emergency defaults for HelpPanel.

  • CommunityConfigurationFallbacks/ exists for extensions/GrowthExperiments with php files
CommunityUpdates.php      
GrowthHomepage.php        
GrowthSuggestedEdits.php  
HelpPanel.php             
Mentorship.php