r83672 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83671‎ | r83672 | r83673 >
Date:21:33, 10 March 2011
Author:catrope
Status:ok
Tags:
Comment:
1.17wmf1: MFT r83667
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/Vector/Vector.hooks.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/Vector/Vector.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/Vector/Vector.php
@@ -39,6 +39,10 @@
4040 // Percentage of users who's use of section edit links will be tracked - half of which will see the
4141 // new section edit links - default 5%
4242 $wgVectorSectionEditLinksLotteryOdds = 5;
 43+// Version number of the current experiment - Buckets from previous experiments will be overwritten
 44+// with new values when this is incremented, so as to allow accurate re-distribution. When changing
 45+// the lottery odds, this needs to change too, or you will have inaccurate data.
 46+$wgVectorSectionEditLinksExperiment = 0;
4347
4448 /* Setup */
4549
Property changes on: branches/wmf/1.17wmf1/extensions/Vector/Vector.php
___________________________________________________________________
Modified: svn:mergeinfo
4650 Merged /trunk/extensions/Vector/Vector.php:r83667
Index: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js
@@ -4,7 +4,16 @@
55 ( function( $, mw ) {
66
77 if ( mw.config.get( 'wgVectorSectionEditLinksBucketTest', false ) ) {
8 - var bucket = $.cookie( 'ext.vector.sectionEditLinks-bucket' );
 8+ // If the version in the client's cookie doesn't match wgVectorSectionEditLinksExperiment, then
 9+ // we need to disregard the bucket they may already be in to ensure accurate redistribution
 10+ var currentExperiment = $.cookie( 'ext.vector.sectionEditLinks-experiment' );
 11+ var experiment = Number( mw.config.get( 'wgVectorSectionEditLinksExperiment', 0 ) );
 12+ var bucket = null;
 13+ if ( currentExperiment === null || Number( currentExperiment ) != experiment ) {
 14+ $.cookie( 'ext.vector.sectionEditLinks-experiment', experiment );
 15+ } else {
 16+ bucket = $.cookie( 'ext.vector.sectionEditLinks-bucket' );
 17+ }
918 if ( bucket === null ) {
1019 // Percentage chance of being tracked
1120 var odds = Math.min( 100, Math.max( 0,
@@ -15,8 +24,8 @@
1625 $.cookie( 'ext.vector.sectionEditLinks-bucket', bucket, { 'path': '/', 'expires': 30 } );
1726 // If we are going to track this person from now on, let's also track which bucket we put
1827 // them into and when
19 - if ( bucket > 0 && 'trackActionWithInfo' in $ ) {
20 - $.trackActionWithInfo( 'ext.vector.sectionEditLinks-bucket', bucket );
 28+ if ( bucket > 0 && 'trackAction' in $ ) {
 29+ $.trackAction( 'ext.vector.sectionEditLinks-bucket:' + bucket + '@' + experiment );
2130 }
2231 }
2332 }
@@ -27,11 +36,12 @@
2837 var editUrl = $( this ).attr( 'href' );
2938 editUrl += ( editUrl.indexOf( '?' ) >= 0 ? '&' : '?' ) + $.param( {
3039 'clicktrackingsession': session,
31 - 'clicktrackingevent': 'ext.vector.sectionEditLinks-bucket' + bucket + '-save'
 40+ 'clicktrackingevent':
 41+ 'ext.vector.sectionEditLinks-bucket:' + bucket + '@' + experiment + '-save'
3242 } );
3343 $(this).attr( 'href', mediaWiki.config.get( 'wgScriptPath' ) + '/api.php?' + $.param( {
3444 'action': 'clicktracking',
35 - 'eventid': 'ext.vector.sectionEditLinks-bucket' + bucket + '-click',
 45+ 'eventid': 'ext.vector.sectionEditLinks-bucket:' + bucket + '@' + experiment + '-click',
3646 'token': session,
3747 'redirectto': editUrl
3848 } ) );
Property changes on: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js
___________________________________________________________________
Modified: svn:mergeinfo
3949 Merged /trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js:r83667
Index: branches/wmf/1.17wmf1/extensions/Vector/Vector.hooks.php
@@ -57,6 +57,7 @@
5858 'configurations' => array(
5959 'wgVectorSectionEditLinksBucketTest',
6060 'wgVectorSectionEditLinksLotteryOdds',
 61+ 'wgVectorSectionEditLinksExperiment',
6162 ),
6263 'requirements' => array(
6364 'vector-noexperiments' => false,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83667Added experiment variable, which allows bucket testing to be reset, and users...tparscal20:49, 10 March 2011

Status & tagging log