Merge "Ignore the beta feature setting when enrolling in the A/B test"

This commit is contained in:
jenkins-bot 2022-01-12 01:59:04 +00:00 committed by Gerrit Code Review
commit 6b31c89159

View file

@ -99,19 +99,20 @@ class HookUtils {
}
}
// Being in the "test" group for this feature means it's enabled. This
// overrules the wiki's beta feature setting. (However, a user who's
// in the control group can still bypass this and enable the feature
// normally.)
$abtest = static::determineUserABTestBucket( $user, $feature );
if ( $abtest === 'test' ) {
return true;
}
// No feature-specific override found.
if ( $dtConfig->get( 'DiscussionToolsBeta' ) ) {
$betaenabled = $optionsLookup->getOption( $user, 'discussiontools-betaenable', -1 );
if ( $betaenabled !== -1 ) {
// betaenable doesn't have a default value, so we can check
// for it being unset like this. If the user has explicitly
// enabled or disabled it, we should immediately return that.
return (bool)$betaenabled;
}
// Otherwise, being in the "test" group for this feature means
// it's effectively beta-enabled.
return static::determineUserABTestBucket( $user, $feature ) === 'test';
$betaenabled = $optionsLookup->getOption( $user, 'discussiontools-betaenable', 0 );
return (bool)$betaenabled;
}
// Assume that if BetaFeature is turned off, or user has it enabled, that