From 58c0b8131f2eb7c0206a2761989899346fec6187 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Mon, 24 Sep 2018 14:49:35 -0700 Subject: [PATCH] Minerva A/B tests are not subject to HTML caching time Config added inside SkinMinerva is subject to the rules of HTML caching and can take several days [1] Adding it via the onResourceLoaderGetConfigVars hook reduces the cache time to minutes [2], giving us more control over the experiment's enabled state. [1] T124954 [2] https://www.mediawiki.org/wiki/ResourceLoader Bug: T205355 Change-Id: I18cb40afe405e2f6a89a7ce5a924eb855aed5430 --- includes/MinervaHooks.php | 1 + includes/skins/SkinMinerva.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/MinervaHooks.php b/includes/MinervaHooks.php index 3443eea..1e60424 100644 --- a/includes/MinervaHooks.php +++ b/includes/MinervaHooks.php @@ -194,6 +194,7 @@ class MinervaHooks { ->makeConfig( 'minerva' ); $vars += [ + 'MinervaABSamplingRate' => $config->get( 'MinervaABSamplingRate' ), 'wgMinervaErrorLogSamplingRate' => $config->get( 'MinervaErrorLogSamplingRate' ), 'wgMinervaReadOnly' => wfReadOnly() ]; diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 4be0880..6a070a3 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -1268,7 +1268,6 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin { 'wgMinervaDownloadNamespaces' => $this->getConfig()->get( 'MinervaDownloadNamespaces' ), 'wgMinervaMenuData' => $this->getMenuData(), 'wgMFDescription' => $out->getProperty( 'wgMFDescription' ), - 'wgMinervaABSamplingRate' => $this->getConfig()->get( 'MinervaABSamplingRate' ) ]; if ( $this->isAuthenticatedUser() ) {