Page MenuHomePhabricator

Automatically fetch instrument configs in local dev environment
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

$wgTestKitchenEnableExperimentConfigsFetching controls whether experiment configs should be fetched during the request. It's set to false by default since it would introduce a significant performance penalty in production. We recommend that you set it to true in your local dev environment so that you can see your changes in Test Kitchen take affect when you refresh the page. Magic.

However, the config variable doesn't have the same effect for instrument configs. Currently, if you make a change to an instrument in Test Kitchen, you have to run something like the following before refreshing the page:

docker compose exec mediawiki maintenance/run.php ./extensions/TestKitchen/maintenance/UpdateConfigs.php

Not magic.

AC

  • Rename $wgTestKitchenEnableExperimentConfigsFetching to EnableConfigsFetching?
  • Honour the config variable when fetching instrument configs, e.g.
includes/ResourceLoader/Hooks.php
private static function getStreamConfigsForInstruments( Config $config ): array {
  $configsFetcher = Services::getConfigsFetcher();

  if ( $config->get( 'TestKitchenEnableConfigsFetching' ) ) {
    $configsFetcher = $configsFetcher->updateInstrumentConfigs();
  }

  $instrumentConfigs = $configsFetcher->getInstrumentConfigs();

  // ...
}

Event Timeline

Change #1235768 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/TestKitchen@master] PHP:

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

Change #1235768 merged by jenkins-bot:

[mediawiki/extensions/TestKitchen@master] PHP: Extend experiment config fetching to instruments

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

This is for local development only and so doesn't need to be deployed – it will be but it doesn't need to be. Being bold