Page MenuHomePhabricator

Implement sticky header A/B test bucketing
Closed, ResolvedPublic3 Estimated Story Points

Description

In T298280, we defined the wikis that will participate in the A/B test of the sticky header with editing functionality included.

This task involves the work with ensuring people at the wikis listed in T298280 are being assigned to A/B test buckets in the ways necessary to complete the analysis T294506 describes.

Acceptance criteria

  • The enabled bucket should show an edit button identical to the existing configuration $wgVectorStickyHeaderEdit
  • The logic for the existing experiment vector.sticky_header should remain untouched. This will allow us to test the robustness of our A/B architecture and to run a test on IDWIKI
  • Add support for a new experiment name vector.sticky_header_edit with 2 buckets - stickyHeaderEditButton and stickyHeaderNoEditButton
  • The new experiment only applies to logged in users.
  • With the default sticky header configuration (e.g. no A/B test) the sticky header should not display on talk pages or special pages. It should display in other places.

QA

  • Make sure when the table of contents experiment is enabled the sticky header experiment is not enabled.
  • Make sure when the sticky header experiment is enabled the table of contents experiment is not enabled.
  • With the experiment enabled, make sure that some accounts see the edit button and some do not.

Developer notes

This should be a JS only change if done correctly.

  • Check the current active experiment
  • When it has the name vector.sticky_header_edit check the buckets.
  • If bucket is stickyHeaderEditButton add the edit icon to the sticky header
  • If bucket is stickyHeaderEditNoButton or unsampled then do not add the edit icon

Note

For a/b test setup, we will have two different sets of controls:

  • Wikis that do not have a sticky header:
    • Control: no sticky header
    • Test: sticky header with edit button
  • Wikis that already have a sticky header:
    • Control: sticky header without edit button
    • Test: sticky header with edit button

QA Results - Beta

ACStatusDetails
1T299959#8038942

QA Results - Prod

ACStatusDetails
1T299959#8069539

Event Timeline

ovasileva triaged this task as Medium priority.Jan 25 2022, 10:06 AM
ovasileva moved this task from Incoming to Current Fiscal Year on the Web-Team-Backlog board.
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson subscribed.

@nray what do you think about using replaceState to rewrite URLs created via link hijack? If those are shared anywhere a non cached version of page would be served

Is the idea to use replaceState when the page loads to replace /wiki/Tree?tableofcontents=1 with /wiki/Tree ? I suppose that's doable, but didn't the SRE team approve the current strategy as is?

@nray I don't think I asked :-) @BBlack we're putting together an A/B test for anons and currently we'd be serving anons with URLs like https://en.m.wikipedia.org/wiki/Himalayas?tableofcontents=1 for a short period of time (duration of A/B test - about 2 weeks). While this is the case, there's a possibility these links get distributed around the web and those links outlive the A/B test. Is that a problem? We can rewrite the URL in JavaScript to minimize this if so.

@Jdlrobson I think expired or invalid query parameters usually can potentially break things with a bad URI but it is up to the server that receives it. Perhaps a rewrite condition can be created somewhere but that is outside of my domain.

Change 779995 had a related patch set uploaded (by Jdrewniak; author: Jdrewniak):

[mediawiki/skins/Vector@master] Sticky header edit button A/B test bucketing

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

Jdrewniak subscribed.

Just to note the approach taken here. The patch above depends on enabling the edit button for everybody by default, then hiding it for all users who are not in the treatment bucket.

So for the wiki we'll be running this AB test on, we'll have to add the following config to enable the sticky header edit button for all logged in users:

$wgVectorStickyHeaderEdit = [
    "logged_in" => true,
    "logged_out" => false
];

and the AB test buckets will look like this:

$wgVectorWebABTestEnrollment = [
    'name' => 'vector.sticky_header_edit',
    'enabled' => true,
    'buckets' => [
        'unsampled' => [
            'samplingRate' => 0
        ],
        'stickyHeaderNoEditButtonTreatment' => [
            'samplingRate' => 0
        ],
        'stickyHeaderEditButtonTreatment' => [
            'samplingRate' => 1
        ]
    ]
];

(sampling rate will differ) and then the sticky header edit button will be disabled via javascript for users in the unsampled and stickyHeaderNoEditButtonTreatment buckets.

Jdlrobson moved this task from Code Review to QA on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.

@Jdrewniak can you set Edward up to QA this one, either on patchdemo or beta cluster? Thanks in advance!

Change 779995 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Sticky header edit button A/B test bucketing

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

This appears to have caused T309370 so moving to needs more more.

Change 800697 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Revert "Sticky header edit button A/B test bucketing"

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

Change 800697 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Revert "Sticky header edit button A/B test bucketing"

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

Change 801458 had a related patch set uploaded (by Jdrewniak; author: Jdrewniak):

[mediawiki/skins/Vector@master] Sticky header edit button A/B test bucketing (updated)

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

Jdlrobson claimed this task.
Jdlrobson removed Jdlrobson as the assignee of this task.
Jdlrobson claimed this task.

Change 801823 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Adds tests for stickyHeader A/B test logic

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

Change 801458 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Sticky header edit button A/B test bucketing (updated)

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

Change 801823 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Adds tests for stickyHeader A/B test logic

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

ovasileva raised the priority of this task from Medium to High.Jun 27 2022, 12:06 PM

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: Per discussion in standup, since the TOC experiment is completed the criteria for passing this is validating test bucketing for the edit icon in the sticky header.

I wasn't able to get a 50% bucketing rate, but with only 10 users tested the sample size is small. I was able to validate that two buckets exist, but the rate is not verifiable with a small sample size.

Screen Shot 2022-06-29 at 8.13.00 PM.png (1×1 px, 469 KB)

Screen Shot 2022-06-28 at 6.44.35 PM.png (1×1 px, 466 KB)

Edtadros subscribed.

Test Result - Prod (pilot wiki)

Status: ✅ PASS
Environment: frwiki
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: Per discussion in standup, since the TOC experiment is completed the criteria for passing this is validating test bucketing for the edit icon in the sticky header.

Screen Shot 2022-07-11 at 6.55.39 AM.png (867×1 px, 258 KB)

Screen Shot 2022-07-11 at 6.53.58 AM.png (870×1 px, 239 KB)