Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A/B Test logic for Article Search Bar #5181

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

A/B Test logic for Article Search Bar #5181

wants to merge 10 commits into from

Conversation

tonisevener
Copy link
Collaborator

@tonisevener tonisevener commented Jan 31, 2025

Phabricator: https://phabricator.wikimedia.org/T383829

(Also a little bit of https://phabricator.wikimedia.org/T384952)

Notes

This PR sets up the search experiment for the Article view. It assigns a 50/50 experiment for users in the correct projects upon app launch and sends a related action:launch action_data:{group assignment} event to the ios_search schema. It references this value in the existing needsSearchBar logic on ArticleViewController. Then for all other ios_search events, we send the action_data: {group_assignment} value.

While I was in here I cleaned up a few things:

  1. Refactored the SearchViewController source logic. It was inferred from the navigation stack, which was buggy. Now you must pass it in from the outside.
  2. Have ArticleViewController and SingleWebPageViewController set up their own magnifying glass nav bar button. Before it was shared logic which made it difficult to pass in a distinct source value when setting up the SearchViewController.
  3. Cleaned up some logging so that event payloads might be easier to read. My main aim was to make the dictionary print out as alphabetical, so we look in the same area for action, action_data, source, etc.

Test Steps

  1. Set WMFLogging.h ddlogLevel = DDLogLevelAll
  2. Uninstall app, run from this PR branch.
  3. In onboarding, select a valid project (like French Wikipedia).
  4. After you see explore feed, find in console "ios_search". You should see a group assignment send in the action_data key.
  5. Tap to an article. If group assignment in step 4 was a, you should see magnifying glass button in nav bar. If group assignment in step 4 was b, you should see article search bar.
  6. Search from article. You should see more ios_search events in the console. Be sure source of these events are "article" and that action_data group name is still send with each event.
  7. Go to Explore feed and search for an article. You should see more ios_search events in the console. Be sure source of these events are "top_of_feed" and that action_data group name is still send with each event.
  8. Go to Search tab and search for an article. You should see more ios_search events in the console. Be sure source of these events are "search_tab" and that action_data group name is still send with each event.
  9. Stop running in Xcode. Launch again. Repeat article search actions. Ensure action_data group name in ios_search has NOT changed groups.
  10. Uninstall app, repeat steps 2 - 5 until you are randomly assigned the other group, then repeat steps 6 - 9.
  11. (Optional) Run on device, repeat steps 2 - 5 until you are assigned group B. Ensure article shows search bar. Then terminate app, change device date to after March 31, 2025, then relaucnh app. Ensure article shows magnifying glass nav bar button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant