Page MenuHomePhabricator

editattemptstep and web_ui_scroll schema returns null
Closed, ResolvedPublic2 Estimated Story Points

Description

Per conversation with analyst:

For the editattemptstep and mediawiki_web_ui_scroll schema , there are fields of is_bot, skin, wiki in schema. But they are all NULL.

Success Criteria:
Figure out what is causing skin field to return NULL in database, even though the fields are firing with correct values in debug mode and beta.

Query to use:
SELECT *
FROM editattemptstep
WHERE year=2023 and month=5 and day=1
AND wiki='enwiki'
limit 5

Screenshot 2023-06-26 at 8.44.43 AM.png (962×1 px, 307 KB)

QA

Event Timeline

LGoto triaged this task as Low priority.May 25 2023, 5:14 PM
LGoto moved this task from Incoming to Current Fiscal Year on the Web-Team-Backlog board.

This is being actively discussed in https://wikimedia.slack.com/archives/CSV483812/p1687563141209929 with @DLynch & @Ottomata and we've identified the root cause. Now figuring out next steps.

@KSarabia-WMF: could you please summarize the learnings from that thread in here?

A quick summary, focused only on EditAttemptStep:

  1. The patch that added these new fields to EditAttemptStep did so by adding the web/common schema fragment to it.
  2. Because EditAttemptStep is a legacy schema (eventcapsule) the fragment-fields got added to the top-level of the schema properties, rather than to the event key's properties. (See: the materialized 1.4.1 schema.)
  3. The legacy schema logging code doesn't expose a way to log data _outside_ the event key, the web/common fragment includes a bunch of other nested fragments that really do need to be at the top-level, _and_ the web/common fragment is included in two non-legacy schemas that won't contain an event key.
  4. Therefore we need to either:
    1. Remove the actually-common properties from web/common and put them into a shared fragment (web/common_core?) that can be ref'd into web/common _and_ into the event.properties (via switching it to allOf) of EditAttemptStep
    2. Remove the ref of analytics/common from web/common and put it directly into the two non-legacy schema it's used in, so that web/common can be ref'd directly into the event.properties of EditAttemptStep (via converting to allOf again).

I think that the latter option is probably cleaner, since it removes usage of nested fragments that are (as we see here) harder to reason about.

None of this applies to web_ui_scroll, so more investigation may be needed to work out why fields are null there.

Change 934032 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[schemas/event/secondary@master] Fix editattemptstep ref

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

ovasileva set the point value for this task to 3.Jul 11 2023, 4:51 PM

Change 938280 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[schemas/event/secondary@master] Update web_ab_test_enrollment schema

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

Change 938284 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[schemas/event/secondary@master] Update web ui scroll

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

ovasileva raised the priority of this task from Low to Medium.Jul 17 2023, 5:39 PM

Change 934032 merged by jenkins-bot:

[schemas/event/secondary@master] Fix editattemptstep ref

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

Change 938280 merged by jenkins-bot:

[schemas/event/secondary@master] Update web_ab_test_enrollment schema

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

Change 939389 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/extensions/WikimediaEvents@master] Updates web enrollment ab test js

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

Change 939389 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Updates web enrollment ab test js

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

I believe remaining work is

  1. Equivalent of https://gerrit.wikimedia.org/r/939389 for the WebScroll schema
  2. Equivalent of https://gerrit.wikimedia.org/r/939389 for the editattemptstep schemas.

Change 939762 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/extensions/WikimediaEvents@master] Web ui scroll version update

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

Change 938284 merged by jenkins-bot:

[schemas/event/secondary@master] Update web ui scroll

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

Change 939762 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Web ui scroll version update

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

Change 940239 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/extensions/WikimediaEvents@master] Editattemptstep event logging

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

Change 940239 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Editattemptstep event logging

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

The reference in WikiEditor will also need to be updated.

...and possibly updated to actually log this data if you want it from there, since it looks like it never got updated to log the web_common fields.

@DLynch Gotcha. Will do. Thanks again for looking out.

Change 940255 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/extensions/WikiEditor@master] Update reference in WikiEditor

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

Edtadros subscribed.

Test Result - Beta

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

Test Artifact(s):

QA Steps

✅ AC1: Using https://stream-beta.wmflabs.org/v2/ui/#/?streams=mediawiki.web_ab_test_enrollment we manually verified that A/B test enrollment is working.
This was manually verified by the engineers

✅ AC2: Using https://stream-beta.wmflabs.org/v2/ui/#/?streams=mediawiki.web_ui_scroll verify that events are coming in and have the schema version 2.0.0. To trigger an event scroll down the page and up again.

wiki: wikifunctionswiki
skin: vector-2022
is_bot: false
$schema: /analytics/mediawiki/web_ui_scroll/2.0.0
web_session_id: 81573b86cab2bca41d4a
page_id: 2247
is_anon: false
action: scroll-to-top
access_method: desktop
dt: '2023-07-20T22:33:55.896Z'
meta:
  stream: mediawiki.web_ui_scroll
  domain: wikifunctions.beta.wmflabs.org
  id: 04c2a578-f504-4207-8ace-1407a11c9f55
  dt: '2023-07-20T22:34:29.710Z'
  request_id: 9728e9b0-274d-11ee-9931-897bd4c4e7d2
  topic: eqiad.mediawiki.web_ui_scroll
  partition: 0
  offset: 18694
http:
  request_headers:
    user-agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'

✅ AC3: Using https://stream-beta.wmflabs.org/v2/ui/#/?streams=eventlogging_EditAttemptStep verify that events are coming in and have the schema version 2.0.0. To trigger an event edit a page on beta cluster.

Logged In

event:
  page_id: 89497
  page_title: Hooded_skunk
  page_ns: 0
  revision_id: 595222
  user_id: 16155
  user_is_temp: false
  user_editcount: 88
  mw_version: 1.41.0-alpha
  page_token: 42575a9c5c02e37fb03e
  session_token: d448f95d6f4d5bd446d5
  version: 1
  wiki: enwiki
  skin: vector-2022
  is_bot: false
  editing_session_id: 0aca34a7376d56fe056a
  editor_interface: visualeditor
  integration: page
  platform: desktop
  action: init
  init_type: page
  init_mechanism: click
  is_oversample: false
schema: EditAttemptStep
webHost: en.wikipedia.beta.wmflabs.org
wiki: enwiki
$schema: /analytics/legacy/editattemptstep/2.0.0
client_dt: '2023-07-21T00:50:01.026Z'
meta:
  stream: eventlogging_EditAttemptStep
  domain: en.wikipedia.beta.wmflabs.org
  id: e61c5d1c-23bf-463a-897f-f4d573d60070
  dt: '2023-07-21T00:50:31.277Z'
  request_id: 97d4bf70-2760-11ee-9931-897bd4c4e7d2
  topic: eventlogging_EditAttemptStep
  partition: 0
  offset: 447307
dt: '2023-07-21T00:50:31.277Z'
http:
  request_headers:
    user-agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'
  client_ip: 47.157.254.85

Anon

event:
  page_id: 89497
  page_title: Hooded_skunk
  page_ns: 0
  revision_id: 595222
  user_id: 0
  user_is_temp: false
  user_class: IP
  user_editcount: 0
  mw_version: 1.41.0-alpha
  page_token: 7417ce194fc7f9d87956
  session_token: d448f95d6f4d5bd446d5
  version: 1
  wiki: enwiki
  skin: vector-2022
  is_bot: false
  editing_session_id: 68e8afb5f26b6f588c10
  editor_interface: visualeditor
  integration: page
  platform: desktop
  action: init
  init_type: page
  init_mechanism: click
  is_oversample: false
schema: EditAttemptStep
webHost: en.wikipedia.beta.wmflabs.org
wiki: enwiki
$schema: /analytics/legacy/editattemptstep/2.0.0
client_dt: '2023-07-21T00:51:38.732Z'
meta:
  stream: eventlogging_EditAttemptStep
  domain: en.wikipedia.beta.wmflabs.org
  id: 3417bbad-26b1-4f44-a414-76b922b2e350
  dt: '2023-07-21T00:51:49.759Z'
  request_id: c69c9bc0-2760-11ee-9931-897bd4c4e7d2
  topic: eventlogging_EditAttemptStep
  partition: 0
  offset: 447316
dt: '2023-07-21T00:51:49.759Z'
http:
  request_headers:
    user-agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'
  client_ip: 47.157.254.85

Change 940255 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Update reference in WikiEditor

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

Change 942677 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/WikiEditor@master] Make EventLogging code more robust

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

@jwang

Please sign off on this when you have a moment by querying the following and confirming is_bot and is_anon is no longer NULL

select * from mediawiki_web_ui_scroll
where year = 2023
and month = 7 and day = 27
and wiki = 'enwiki' order by hour desc limit 5

select * from mediawiki_web_ab_test_enrollment
where year = 2023
and month = 7 and day = 27
and wiki = 'enwiki' order by hour desc limit 5

*FYI - For anyone wondering, the AB test is off and I confirmed it again today by creating a new account and seeing the enrollment event is no longer firing, but there are some heavy caching some places that's causing some enrollment events to still fire.


select * from editattemptstep
where year = 2023
and month = 7 and day = 27
and wiki = 'enwiki' order by hour desc limit 5

*FYI - This is still returning null in the database. You and I talked about this and the edit schemas seem to have a lot of null values in the db no matter what we do, but we can still check is_bot and is_anon in the event object.

  • Have verified editattemptstep schema that skin and is_bot are captured in event field. But is_anon is NULL.

image.png (410×916 px, 31 KB)

query

SELECT event.skin, event.is_bot
FROM editattemptstep
WHERE year=2023 and month=7 and day=28
AND wiki='enwiki'
LIMIT 5
  • Have verified mediawiki_web_ui_scroll schema that is_bot and skin are captured with value.

image.png (372×1 px, 54 KB)

query

SELECT is_bot, skin,wiki, is_anon
FROM mediawiki_web_ui_scroll 
WHERE year=2023 and month=7 and day=28
AND wiki='enwiki'
LIMIT 5

For reference, is_anon was added in the recently-ref'd web_common fragment, and in EditAttemptStep is redundant with the user_class field (which can be null or IP). As such, although adding is_anon would fill things out, it's not actually required for anything.

Change 942677 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Make EventLogging code more robust

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