New bucket for abtest data

Bug: T291308
Change-Id: I7aa47139e3fe552833798d6b8daacc1b30517915
This commit is contained in:
David Lynch 2022-02-02 15:10:06 -06:00
parent 259d826bdc
commit fda6c3c117
2 changed files with 14 additions and 8 deletions

View file

@ -145,8 +145,8 @@ class Hooks implements
'mw_version' => MW_VERSION,
] + $data;
if ( $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest' ) ) {
$data['bucket'] = $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest' );
if ( $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest2' ) ) {
$data['bucket'] = $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest2' );
}
if ( $user->isAnon() ) {
@ -193,7 +193,7 @@ class Hooks implements
'user_editcount' => $editCount ?: 0,
];
$bucket = $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest' );
$bucket = $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest2' );
if ( $bucket ) {
$data['bucket'] = $bucket;
}

View file

@ -83,8 +83,11 @@
data.user_class = 'IP';
}
if ( mw.user.options.get( 'discussiontools-abtest' ) ) {
data.bucket = mw.user.options.get( 'discussiontools-abtest' );
if ( mw.config.get( 'wgDiscussionToolsABTestBucket' ) ) {
data.bucket = mw.config.get( 'wgDiscussionToolsABTestBucket' );
if ( mw.config.get( 'wgDiscussionToolsAnonymousUserId' ) ) {
data.anonymous_user_id = mw.config.get( 'wgDiscussionToolsAnonymousUserId' );
}
}
// Schema's kind of a mess of special properties
@ -119,10 +122,13 @@
integration: 'page',
editor_interface: 'wikitext'
};
/* eslint-enable camelcase */
if ( mw.user.options.get( 'discussiontools-abtest' ) ) {
data.bucket = mw.user.options.get( 'discussiontools-abtest' );
if ( mw.config.get( 'wgDiscussionToolsABTestBucket' ) ) {
data.bucket = mw.config.get( 'wgDiscussionToolsABTestBucket' );
if ( mw.config.get( 'wgDiscussionToolsAnonymousUserId' ) ) {
data.anonymous_user_id = mw.config.get( 'wgDiscussionToolsAnonymousUserId' );
}
}
/* eslint-enable camelcase */
return data;
} );