Merge "Remove VectorLanguage A/B test code (WgVectorLanguageInHeaderTreatmentABTest)"

This commit is contained in:
jenkins-bot 2022-09-26 23:01:34 +00:00 committed by Gerrit Code Review
commit ecba35aeca
4 changed files with 5 additions and 26 deletions

View File

@ -98,17 +98,6 @@ final class Constants {
*/ */
public const REQUIREMENT_LANGUAGE_IN_HEADER = 'LanguageInHeader'; public const REQUIREMENT_LANGUAGE_IN_HEADER = 'LanguageInHeader';
/**
* Defines whether or not the Language in header A/B test is running. See
* https://phabricator.wikimedia.org/T280825 for additional detail about the test.
*
* Note well that if the associated config value is falsy, then we fall back to choosing the
* language treatment based on the `VectorLanguageInHeader` config variable.
*
* @var string
*/
public const CONFIG_LANGUAGE_IN_HEADER_TREATMENT_AB_TEST = 'VectorLanguageInHeaderTreatmentABTest';
/** /**
* @var string * @var string
*/ */

View File

@ -53,8 +53,7 @@ return [
$services->getCentralIdLookupFactory()->getNonLocalLookup(), $services->getCentralIdLookupFactory()->getNonLocalLookup(),
Constants::CONFIG_KEY_LANGUAGE_IN_HEADER, Constants::CONFIG_KEY_LANGUAGE_IN_HEADER,
Constants::REQUIREMENT_LANGUAGE_IN_HEADER, Constants::REQUIREMENT_LANGUAGE_IN_HEADER,
null, null
Constants::CONFIG_LANGUAGE_IN_HEADER_TREATMENT_AB_TEST
) )
); );
@ -63,13 +62,9 @@ return [
// Temporary T286932 - remove after languages A/B test is finished. // Temporary T286932 - remove after languages A/B test is finished.
$requirementName = 'T286932'; $requirementName = 'T286932';
// MultiConfig checks each config in turn, allowing us to override the main config for specific keys. In this // MultiConfig checks each config in turn, allowing us to override the main config for specific keys.
// case, override the "VectorLanguageInHeaderABTest" configuration value so that the following requirement
// always buckets the user as if the language treatment A/B test were running.
$config = new MultiConfig( [ $config = new MultiConfig( [
new HashConfig( [ new HashConfig( [] ),
Constants::CONFIG_LANGUAGE_IN_HEADER_TREATMENT_AB_TEST => true,
] ),
$services->getMainConfig(), $services->getMainConfig(),
] ); ] );
@ -81,8 +76,7 @@ return [
$services->getCentralIdLookupFactory()->getNonLocalLookup(), $services->getCentralIdLookupFactory()->getNonLocalLookup(),
Constants::CONFIG_KEY_LANGUAGE_IN_HEADER, Constants::CONFIG_KEY_LANGUAGE_IN_HEADER,
$requirementName, $requirementName,
/* $overrideName = */ '', /* $overrideName = */ ''
Constants::CONFIG_LANGUAGE_IN_HEADER_TREATMENT_AB_TEST
) )
); );

View File

@ -541,10 +541,6 @@
}, },
"description": "@var When `VectorLanguageAlertInSidebar` is enabled, the language switch alert box is shown in the sidebar." "description": "@var When `VectorLanguageAlertInSidebar` is enabled, the language switch alert box is shown in the sidebar."
}, },
"VectorLanguageInHeaderTreatmentABTest": {
"value": false,
"description": "@var boolean Enables or disables the language in header treatment A/B test. See https://phabricator.wikimedia.org/T280825 and associated tasks for additional detail."
},
"VectorStickyHeader": { "VectorStickyHeader": {
"value": { "value": {
"logged_in": true, "logged_in": true,

View File

@ -322,7 +322,7 @@ class OverridableConfigRequirementTest extends \MediaWikiUnitTestCase {
) { ) {
$config = new HashConfig( [ $config = new HashConfig( [
Constants::CONFIG_KEY_LANGUAGE_IN_HEADER => $configValue, Constants::CONFIG_KEY_LANGUAGE_IN_HEADER => $configValue,
Constants::CONFIG_LANGUAGE_IN_HEADER_TREATMENT_AB_TEST => $abValue, $testName => $abValue,
] ); ] );
$user = $this->createMock( User::class ); $user = $this->createMock( User::class );