Page MenuHomePhabricator

Migrate UniversalLanguageSelector instrument to WikimediaEvents extension
Closed, ResolvedPublic3 Estimated Story Points

Description

Ronseal.

Readers Web are increasing the scope of the UniversalLanguageSwitcher instrument as part of T275766: Log sessionID, isAnon, editBucketCount, and selectedLanguage properties in the UniversalLanguageSelector instrument and T275762: Instrument clicks to links in the Languages list in the sidebar. In order to keep the UniversalLanguageSwitcher extension focussed, we (@nshahquinn-wmf, @Nikerabbit, and Readers Web) agreed that the instrument should be moved to the WikimediaEvents extension.

AC

  • The UniversalLanguageSwitcher instrument is moved to the WikimediaEvents extension
  • The UniversalLanguageSwitcher is loaded when the skin isn't minerva

QA Steps

  1. Navigate to https://en.wikipedia.beta.wmflabs.org
  2. Log in
  3. Navigate to https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page
  4. Click on the cog icon next to "Languages" in the sidebar
  5. Observe that a settings-open UniversalLanguageSwitcher event was logged
  6. Change your display language
  7. Observe that a language-change UniversalLanguageSwitcher event was logged

QA Notes

You'll need to run mw.trackSubscribe( 'event.UniversalLanguageSelector', ( _, event ) => console.log( JSON.stringify( event, null, 2 ) ) ); in order to inspect UniversalLanguageSelector events that are going to be logged prior to the browser navigating to a new page.

Developer Notes

the ULS code that needs to be ported is here:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UniversalLanguageSelector/+/663008

QA Results - Beta

ACStatusDetails
1T275894#6904931
2T275894#6904931

QA Results - Prod

ACStatusDetails
1T275894#6912469
2T275894#6912469

Event Timeline

Jdlrobson set the point value for this task to 3.Mar 2 2021, 6:28 PM

medium risk (we considered small given the code is very cleanly separated but felt the involvement of two extensions that we don't often frequent bumped this up)

Change 668428 had a related patch set uploaded (by Phuedx; owner: Phuedx):
[mediawiki/extensions/UniversalLanguageSelector@master] Remove UniversalLanguageSelector instrument

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

Change 668429 had a related patch set uploaded (by Phuedx; owner: Phuedx):
[mediawiki/extensions/WikimediaEvents@master] Add UniversalLanguageSelector instrument

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

Change 668429 merged by jenkins-bot:
[mediawiki/extensions/WikimediaEvents@master] Add UniversalLanguageSelector instrument

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

Change 668428 merged by jenkins-bot:
[mediawiki/extensions/UniversalLanguageSelector@master] Remove UniversalLanguageSelector instrument

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

Edtadros added a subscriber: Edtadros.

@Jdlrobson this needs QA steps, please.

It actually needs a little more work! I'll add QA steps immediately after I've submitted a follow-up patch.

Change 669907 had a related patch set uploaded (by Phuedx; owner: Phuedx):
[mediawiki/extensions/WikimediaEvents@master] universalLanguageSelector: Add missing extension attribute

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

Change 669907 merged by jenkins-bot:
[mediawiki/extensions/WikimediaEvents@master] universalLanguageSelector: Add missing extension attribute

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

phuedx updated the task description. (Show Details)

Change 670224 had a related patch set uploaded (by Phuedx; owner: Phuedx):
[operations/mediawiki-config@master] ULS: Remove unused ULSEventLogging variable

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

Nice catch, @Nikerabbit. The above can be merged and deployed once this week's train has finished (likely next Monday).

Test Result - Beta

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

Test Artifact(s):

QA Steps
  1. Navigate to https://en.wikipedia.beta.wmflabs.org
  2. Log in
  3. Navigate to https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page
  4. Click on the cog icon next to "In other languages" in the sidebar
  5. ✅ AC1:Observe that a settings-open UniversalLanguageSwitcher event was logged
    Screen Shot 2021-03-11 at 6.42.39 AM.png (112×240 px, 11 KB)
  6. Change your display language
  7. ✅ AC2: Observe that a language-change UniversalLanguageSwitcher event was logged
    Screen Shot 2021-03-11 at 6.45.36 AM.png (116×268 px, 10 KB)

QA Notes
You'll need to run mw.trackSubscribe( 'event.UniversalLanguageSelector', ( _, event ) => console.log( JSON.stringify( event, null, 2 ) ) ); in order to inspect UniversalLanguageSelector events that are going to be logged prior to the browser navigating to a new page.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps
  1. Navigate to https://en.wikipedia.beta.wmflabs.org
  2. Log in
  3. Navigate to https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page
  4. Click on the cog icon next to "In other languages" in the sidebar
  5. ✅ AC1:Observe that a settings-open UniversalLanguageSwitcher event was logged
    Screen Shot 2021-03-14 at 8.33.33 PM.png (113×235 px, 11 KB)
  6. Change your display language
  7. ✅ AC2: Observe that a language-change UniversalLanguageSwitcher event was logged
    Screen Shot 2021-03-14 at 8.35.07 PM.png (115×288 px, 11 KB)

QA Notes
You'll need to run mw.trackSubscribe( 'event.UniversalLanguageSelector', ( _, event ) => console.log( JSON.stringify( event, null, 2 ) ) ); in order to inspect UniversalLanguageSelector events that are going to be logged prior to the browser navigating to a new page.