Page MenuHomePhabricator

It should be possible to opt into new page issues treatment via query string parameter
Closed, ResolvedPublic2 Estimated Story Points

Description

Rather than do T204613, it has been proposed instead that we make it possible for a user to turn on page issues via a special URI parameter.

This should be a trivial change to pageIssues.js to check a query string parameter and turn on the new treatment if necessary:

		newTreatmentEnabled = abTest.isB() || mw.util.getParamValue( 'minerva-issues' ) === 'b';

EventLogging should not be turned on via this debug mode so it should also

e.g.

function isLoggingRequired( pageIssues ) {
		// No logging necessary when the A/B test is disabled (control group).
		return abTest.isEnabled() && pageIssues.length && !mw.util.getParamValue( 'minerva-issues' );
	}

Acceptance criteria

  • New treatment can be opted in via a query string parameter
  • Users using the debug flag are excluded from the AB test event logging
  • The treatment would persist for the entire page session
  • New treatment does not persist across pages or user sessions (ie. it only applies if the query string features the parameter)

QA steps

  1. Ask a developer to enable the A/B test

Find a page with the old treatment
by appending ?minerva-issues=b at the end of any URL (query string), it should be possible to see the new treatment 100% of the time (open new tabs to attempt to rebucket yourself)
e.g. https://reading-web-staging.wmflabs.org/w/index.php?title=Pharmacovigilance&mobileaction=toggle_view_mobile&minerva-issues=b
No events should be logged relating to PageIssues schema.

  1. Verify if no query string parameter things events are fired and 50% of the time you get the old treament

Remove the query string parameter from the URI. 50% of the time you should see the old treatment and events to PageIssues and ReadingDepth should be present.

  1. Ask a developer to disable the A/B test on Staging.

by appending ?minerva-issues=b at the end of any URL (query string), it should be possible to see the new treatment
No events should be logged relating to PageIssues schema.

Event Timeline

This would be great. Just to double-check (apologies if that's a naive question): Would that query parameter survive across several issue clicks and modal clicks? e.g. https://en.m.wikipedia.org/wiki/Pharmacovigilance?pageissues=new2018 --> https://en.m.wikipedia.org/wiki/Pharmacovigilance?pageissues=new2018#/issues/all

To add a clarification from kickoff, for the record: This will not switch on the instrumentation, so we would still need to resort to other means for checking events are being sent correctly on a particular wiki.

To check if user is assigned to some AB testing group we always call

mw.experiments.getBucket({
  name: 'experimentNAME',
  enabled: true,
  buckets: {
     control: ....
     A: ....
}

Maybe instead of coding this stuff in the PageIssues logic we can modify the mw.experiments.getBucket() function, and put something like:

getBucket(options) { 
    var overrideBucket = mw.util.getParamValue( 'forceExperiment-' + options.name);
    if (  overrideBucket && options.buckets.hasOwnProperty(overrideBucket) ) {
        return overrideBucket;
    }
    [... rest of the getBucketCode() ...]

I think it's worth doing that in the experiments code, as this scenario (we want to bucket ourselves in group A) happens quite often.

Change 461478 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Users can request new treatment via query string

https://gerrit.wikimedia.org/r/461478

Change 461478 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Users can request new treatment via query string

https://gerrit.wikimedia.org/r/461478

Change 462598 had a related patch set uploaded (by Pmiazga; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@wmf/1.32.0-wmf.22] Users can request new treatment via query string

https://gerrit.wikimedia.org/r/462598

Change 462598 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@wmf/1.32.0-wmf.22] Users can request new treatment via query string

https://gerrit.wikimedia.org/r/462598

Mentioned in SAL (#wikimedia-operations) [2018-09-25T11:47:27Z] <pmiazga@deploy1001> Started scap: php-1.32.0-wmf.22/skins/MinervaNeue/resources/skins.minerva.scripts/pageIssues.js SWAT: [[gerrit:462598|It should be possible to opt into new page issues treatment via query string parameter (T204746)]]

Mentioned in SAL (#wikimedia-operations) [2018-09-25T12:05:06Z] <pmiazga@deploy1001> Finished scap: php-1.32.0-wmf.22/skins/MinervaNeue/resources/skins.minerva.scripts/pageIssues.js SWAT: [[gerrit:462598|It should be possible to opt into new page issues treatment via query string parameter (T204746)]] (duration: 17m 39s)

Did some cross-browser testing, looks good to me. All steps are passing. Moving it to Signoff.

ovasileva updated the task description. (Show Details)

all done