Growth/Community configuration

Community Configuration is a scaling project of the Growth team. Up until now, any time communities wanted to change how the features the Growth team maintains behave (for instance, move the help desk, change the links included in the, or enable ), they had to create a Phabricator task and ask us to make the change for them.

Since the Growth features require many configuration options to be filled, this doesn't scale when deploying to many wikis. It also means we don't need to provide a "one size fits all" feature – wikis can customize it according to their preferences and needs.

To make sure configuration can be only changed by trusted community members, we decided that only administrators can use this feature.

Current status

 * 2021-04-14: The configuration editor was made available on the beta wikis
 * Current: Testing the configuration editor, implementing minor changes

Included configuration variables
It doesn't make to let communities manage all configuration variable. For instance, we don't want to let communities change which database cluster is used by the features.

As part of T275086, we decided on a list of configuration variables that we want to manage on-wiki. We put the list of variables in a spreadsheet (Google Spreadsheets).

Implementation
The configuration is stored in a JSON page in the MediaWiki: namespace, with a custom form created over it. Because reading config from the database can be expensive, the configuration is cached for a day, and the cache is purged on any edit (including null edits).

The fields stored in the JSON blob have guaranteed data types. That means it is impossible to put a string where the software expects an array of integers. Higher-level validation is implemented as part of the configuration form (including page existence checks), it was decided it is unnecessary to run it on manual edits as well.

Configuration form
In order to let non-tech savvy community members to manage the configuration as well, we created a custom form over the JSON blob with the configuration itself. That way, community members don't need to know how to edit JSON in order to change the configuration, while keeping the configuration stored in a format that's easily understandable by machines.

Since the feature is built on top of a MediaWiki page, it also inherits some useful features that each MediaWiki page has: it is possible to revert configuration to its older version (as of April 2021, it is not possible to do it via the form, but only via a manual edit), leave edit summaries or see historical version of the configuration.