Page MenuHomePhabricator

Create an API to access GrowthExperiments configuration
Open, Needs TriagePublic

Description

Background

The Growth team created community configuration in 2021. This enables communities to configure certain aspects of GrowthExperiments themselves, via Special:EditGrowthConfig. Community-managed configuration is stored in a JSON blob within NS_MEDIAWIKI (example).

It would be useful for non-GE code to be able to see GrowthExperiments configuration and to do certain things based on the current configuration. This can be useful for:

  • A configuration dashboard (T297661), which would summarize the state of GrowthExperiments at all wikis (and optionally, monitor history, etc.)
  • Third-party tools offering similar features as GE (Android's suggested edits), who want to respect community's decision to set a daily cap on number of edits or to completely disable the features
Problem

While it is technically possible to download the JSON blob that backs community configuration, doing that cannot be advised for a number of reasons:

  • MediaWiki:GrowthExperimentsConfig.json is treated as an internal page (that only happens to be world-readable); anything in the page can change at any time without prior notice, as Growth-Team engineers see fit; this has a great chance of breaking tools connecting to the file directly,
  • MediaWiki:GrowthExperimentsConfig.json doesn't need to have valid content; while Growth team has some logic to validate configuration, it is not 100% reliable (GrowthExperiments itself validates the config before using it, and fall-backs to safe values in case of a validation error, but this can't be expected of external clients),
  • MediaWiki:GrowthExperimentsConfig.json doesn't cover all configuration; it only has configuration that's meant to be configured by on-wiki admins,
  • MediaWiki:GrowthExperimentsConfig.json is not the only page with configuration (there's also MediaWiki:NewcomerTasks.json); the decision what is in which config page should be one internal to the Growth team, and external clients should not depend on it.
Solution

Let's introduce an API interface for accessing GrowthExperiments configuration. This API interface should make it possible to access configuration of all features, in a stable form. Ideally, we would keep config variable names internal (to be able to change them if we want to), and only publish generic configuration state, such as:

{
    "features": {
        "helppanel": {
            "enabled": true,
            "questionTarget": "helpdesk/mentor"
        },
        ...
    }
}

This should give Growth team the maximum amount of flexibility, as we would be able to change anything, so long we're able to maintain a stable API interface for third parties.