Page MenuHomePhabricator

Reading List Experiment - update code to point to both english and ar/fr/zh/id/vi experiments
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

Because we are configuring two separate experiments for English Wiki and the Arabic/French/Chinese/Indonesian/Vietnamese within Test Kitchen (fka xLabs), we should make sure that the code point to both experiments.


Acceptance criteria

  • All code that points to an experiment within Test Kitchen/xLabs points to en OR ar/fr/zh/id/vi experiment

Requirement

Scope: Desktop web (Vector 2022).

  • Update experiment configuration for Reading Lists to support both experiment IDs:
    • we-3-3-4-reading-list-test1 (for Arabic, French, Chinese, Indonesian, Vietnamese wikis)
    • we-3-3-4-reading-list-test1-en (for English Wikipedia)
  • All references to the experiment in Test Kitchen/xLabs must recognize either experiment ID to enable the Reading List feature.
  • Users bucketed into either experiment must be able to activate and use Reading Lists.
  • QA should confirm that enabling either experiment ID activates the same Reading List behavior.

BDD

Feature: Support multiple experiment IDs for Reading List feature

  Scenario: User enrolled in English experiment
    Given I am enrolled in the `we-3-3-4-reading-list-test1-en` experiment
    When I visit an article using Vector 2022
    Then the Reading List feature (bookmark icon and Special:ReadingLists) is enabled

  Scenario: User enrolled in AR/FR/ZH/ID/VI experiment
    Given I am enrolled in the `we-3-3-4-reading-list-test1` experiment
    When I visit an article using Vector 2022
    Then the Reading List feature (bookmark icon and Special:ReadingLists) is enabled

Test Steps

Test Case 1: Verify Reading List activation for English experiment

  1. Log in and use the browser console to run: mw.xLab.overrideExperimentGroup('we-3-3-4-reading-list-test1-en', 'treatment')
  2. Refresh the page.
  3. AC1: The Reading List bookmark icon appears.
  4. AC2: Special:ReadingLists is accessible.

Test Case 2: Verify Reading List activation for AR/FR/ZH/ID/VI experiment

  1. Log in and use the browser console to run: mw.xLab.overrideExperimentGroup('we-3-3-4-reading-list-test1', 'treatment')
  2. Refresh the page.
  3. AC3: The Reading List bookmark icon appears.
  4. AC4: Special:ReadingLists is accessible.

Test Case 3: Verify feature remains off for non-enrolled users

  1. Log in as a user not in either experiment group.
  2. Refresh the page.
  3. AC5: The Reading List bookmark icon does not appear.
  4. AC6: Special:ReadingLists is not accessible from the UI.

Rollback plan

Describe the rollback plan in production for this task if something goes wrong.

This task was created by Version 1.0.0 of the Reader Experience team task template using phabulous.

Event Timeline

I would propose the names be we-3-3-4-reading-list-test1 and we-3-3-4-reading-list-test1-en, but let's give a (short) period of time for eng to bikeshed on names

Note: We refer to the experiment name in WikimediaEvents and in ReadingLists::HookHandler so would need to update in both places.

Suggest we add a configuration for the experiment name in mediawiki-config. This way we can more easily vary the experiment name by wiki (enwiki + the others), and have the experiment name defined in one place, to be used by the WikimediaEvents and ReadingLists extensions.

This would require a backport for the config (and later cleanup) but I think this would be the less hacky approach.

Change #1201782 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/extensions/ReadingLists@master] Check for enwiki experiment name for ReadingLists A/B test

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

Change #1201783 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/extensions/WikimediaEvents@master] Add experiment name for enwiki in readingListAB.js

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

After looking at the possibility of adding a config, it would have to defined in both extensions and in mediawiki-config (with a backport). Perhaps adding a shared config is a bit too much complexity and we can just add a check for 'enwiki' wikiId / wgDBname and then vary the experiment name based on that.

Change #1201783 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Add experiment name for enwiki in readingListAB.js

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

Change #1201782 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] Check for enwiki experiment name for ReadingLists A/B test

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

I think this can't really be QA'd so moved this to sign off

It can be QAed!! We should now be able to turn on the reading list feature using either we-3-3-4-reading-list-test1 or we-3-3-4-reading-list-test1-en where previously we could not

(sorry for lurking and sorry to Edward for giving you more work 😭)

From meeting: since we didn't add ourselves to the preference on beta, this will need to be tested on testwiki any time starting tomorrow

Test Result - Prod

Status: ❌ FAIL
Environment: testwiki
OS: macOS Tahoe 26.x
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Verify Reading List activation for English experiment

  1. Log in and use the browser console to run: mw.xLab.overrideExperimentGroup('we-3-3-4-reading-list-test1-en', 'treatment')
  2. Refresh the page.
  3. AC1: The Reading List bookmark icon appears.

screenshot 17.mov.gif (1×1 px, 621 KB)

  1. AC2: Special:ReadingLists is accessible.

screenshot 17.png (1×1 px, 144 KB)

Test Case 2: Verify Reading List activation for AR/FR/ZH/ID/VI experiment

  1. Log in and use the browser console to run: mw.xLab.overrideExperimentGroup('we-3-3-4-reading-list-test1', 'treatment')
  2. Refresh the page.
  3. AC3: The Reading List bookmark icon appears.

screenshot 18.mov.gif (1×1 px, 528 KB)

  1. AC4: Special:ReadingLists is accessible.

screenshot 16.png (1×1 px, 161 KB)

Test Case 3: Verify feature remains off for non-enrolled users

  1. Log in as a user not in either experiment group.
  2. Refresh the page.
  3. AC5: The Reading List bookmark icon does not appear.
  4. AC6: Special:ReadingLists is not accessible from the UI.

screenshot 18.png (1×1 px, 281 KB)

Edtadros updated the task description. (Show Details)

Discussed in DMs and slack - I mistakenly thought this could be tested as such, but it will only work on english wikipedia (and potentially beta, but we don't have the hidden preference set)

On English (post train rollout tomorrow), only we-3-3-4-reading-list-test1-en should work and we-3-3-4-reading-list-test1 should cease to work
On all non-English wikis, only we-3-3-4-reading-list-test1 should work and we-3-3-4-reading-list-test1-en should not work

I will QA this since Edward is out and it's past Thursday now

SToyofuku-WMF added a subscriber: Jdrewniak.

Sadly, turns out I can't QA on english wikipedia either since I don't have the preference set 🙃 to feel like I did something I reviewed the code and it looks good to me

@HFan-WMF @Jdrewniak I think we have one of two options - sign this ticket off and then confirm the code path is working correctly on Wednesday when we see english users in the english experiment, or keep this ticket open and in QA until we run the script, then add ourselves to the preference on enwiki and QA then. I have no real preference, so wanted to hear from a product perspective

I don't think there's any harm in waiting until Wed to sign off (the sprint board has to remain unarchived for two more days after the sprint wraps, haha), so let's hold off and sign off next Wed then!

Thanks for digging into this, Steph!

SToyofuku-WMF claimed this task.

@aude graciously added me to the preference on enwiki, and I was able to confirm that this is working as intended - I was able to see the experiment using we-3-3-4-reading-list-test1-en, and unable to see it using we-3-3-4-reading-list-test1. Signing this off