Page MenuHomePhabricator

xLab: Add User identifier type field
Closed, ResolvedPublic2 Estimated Story Points

Assigned To
Authored By
Sarai-WMF
Apr 29 2025, 12:08 PM
Referenced Files
F61276899: Jun-02-2025 20-40-32.gif
Jun 2 2025, 6:41 PM
F61241867: Screenshot_2025-04-29_at_14.01.07.png
Jun 2 2025, 12:21 PM
F60349299: Screenshot 2025-05-21 at 16.23.14.png
May 21 2025, 2:24 PM
F60349265: Screenshot 2025-05-21 at 16.21.42.png
May 21 2025, 2:24 PM
F60349249: Screenshot 2025-05-21 at 16.20.52.png
May 21 2025, 2:24 PM
F60349190: Screenshot 2025-05-21 at 16.18.28.png
May 21 2025, 2:24 PM
F59551755: Screenshot 2025-04-29 at 18.19.00.png
Apr 29 2025, 4:19 PM
F59547160: Screenshot 2025-04-29 at 14.02.39.png
Apr 29 2025, 12:08 PM

Description

Problem

In its current state, xLab doesn’t allow experiment owners to sample test subjects based on their login status. Users are thus not able to configure experiments that collect metrics from anonymous users.

Suggested solution

To enable experiment owners to benefit from the new anonymous testing capabilities, we’ll provide them with the ability to select the enrollment authority that will define their sample from xLab’s UI.

In order to align xLab with Growthbook’s terminology, and support experiment owner’s transition to the latter third party experimentation tool, we’ll base our design off of the “Identifier types” field available in that external platform:

Screenshot 2025-05-21 at 16.18.28.png (331×1 px, 63 KB)

Quick overview of requirements:

PlacementDefault state & ValidationThe field is not modifiable after activation
Screenshot 2025-05-21 at 16.20.52.png (715×1 px, 110 KB)
Screenshot 2025-04-29 at 14.06.23.png (352×902 px, 32 KB)
Screenshot 2025-05-21 at 16.21.42.png (412×1 px, 77 KB)
Screenshot_2025-04-29_at_14.01.07.png (1×3 px, 521 KB)
Screenshot 2025-05-21 at 16.23.14.png (421×1 px, 64 KB)
The “User identifier type” field is the first field included in the “Traffic and variations” section (fka “Sampling”). It replaces the “Sample unit” field in the experiment form and read-only view:No option in this field is selected by default. If users try to submit without having made a selection, validation should be triggeredUsers won't be able to edit their selected user identifier type once their experiment has been activated: (1) We'll mention this in the activation confirmation dialog. New message: "Activating the A/B test {A/B test name} will enable data collection on {start date}, provided instrumentation code has been deployed to production. After activation, the experiment's name, traffic, and variations configuration will no longer be editable". – (2) The User identifier type options will display a disabled state when users try to edit an active experiment.

Please find detailed specs in this Figma file.

Acceptance criteria
  • The new ‘User identifier type’ field replaces the current 'Sample unit' field on xLab's experiment form
  • xLab users can employ the required and non-modifiable ‘User identifier type’ field to define the composition of their experiment traffic

Event Timeline

Sarai-WMF updated the task description. (Show Details)

ℹ️ The UI updates described in this task would enable experiment owners to select the enrollment authority for their experiments using xLab's form. This ticket is technically ready for development now that T391957: xLab API: generate enrollment and bucketing for Varnish authority is complete. Nevertheless, some design changes might be required to ensure consistency and compatibility with the backend implementation, so the specs will be reviewed before we pull this into a sprint.

Milimetric set the point value for this task to 2.May 27 2025, 3:27 PM

Change #1152759 had a related patch set uploaded (by Santiago Faci; author: Santiago Faci):

[operations/deployment-charts@master] xLab: Deploying xLab v0.6.4 to staging

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

Change #1152759 merged by jenkins-bot:

[operations/deployment-charts@master] xLab: Deploying xLab v0.6.4 to staging

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

hi @Sarai-WMF we deployed the latest changes to the staging environment - we still have to do some minor cleanup, especially around validation - but if you want to take a look and let us know if current state passes your design review eagle eyes:

https://mpic-next.wikimedia.org/create-instrument
https://mpic-next.wikimedia.org/create-experiment

Thank you, @cjming! 'eagle eyes' lol 😀

I believe that, besides validation. The only thing that's pending is making sure that the radio buttons that represent the User identifier type options display a disabled state when users try to edit an active experiment. Looks like at the moment, the configuration can be edited:

Jun-02-2025 20-40-32.gif (872×1 px, 3 MB)

hi @Sarai-WMF - hopefully quick Q - Santi had noticed some inconsistency in the User Identifier Type field (here's his comment on the original MR)

In the form field itself, the labels are mw_user_id and edge_unique (note underscores) while the value we save is mw-user and edge-unique (note dashes) respectively -- were you trying to match what the value is and should we update accordingly? i copied mocks directly but maybe it should match the actual value we pass in for experiment events?

hi @Sarai-WMF - hopefully quick Q - Santi had noticed some inconsistency in the User Identifier Type field (here's his comment on the original MR)

In the form field itself, the labels are mw_user_id and edge_unique (note underscores) while the value we save is mw-user and edge-unique (note dashes) respectively -- were you trying to match what the value is and should we update accordingly? i copied mocks directly but maybe it should match the actual value we pass in for experiment events?

Thanks for the question! Sounds like we should update the labels of the UI options to match the values saved in the code (i.e., mw-user and edge-unique). I used the values that had been included in a design suggestion, assuming that they were correct. My apologies for not validating that they matched the actual experiment events values

hi @Sarai-WMF thanks! I'm going to go ahead and move this ticket to done since outstanding issues from this ticket and T392911: xLab: Update ‘Project and sample size’ module are captured in T396045: xLab: follow up tasks for traffic and variations section.

Once https://gitlab.wikimedia.org/repos/data-engineering/mpic/-/merge_requests/188 is reviewed/merged, I'll let you know on T396045 when it's ready for review again on staging.