-
Notifications
You must be signed in to change notification settings - Fork 805
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
Duplicate views: Add util to fetch experiment assignment #40471
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! |
projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php
Outdated
Show resolved
Hide resolved
projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php
Outdated
Show resolved
Hide resolved
projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php
Outdated
Show resolved
Hide resolved
projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php
Outdated
Show resolved
Hide resolved
|
||
if ( isset( $data['variations'] ) && isset( $data['variations'][ $experiment_name ] ) ) { | ||
$variation = $data['variations'][ $experiment_name ]; | ||
update_user_option( get_current_user_id(), $option_name, $variation, true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint will return null
for the default experience, but it will also return null if the experiment is in staging. This means we will be caching the null experience for any existing users that have triggered this code, so it will skip the actual assignment, meaning we will only be testing users that haven't triggered this code before we started the experiment. Since this code has been in place for a while that might roughly mean existing users in general, and so we are only testing new or newly active users.
By caching here it also means the ExPlat experiment controls to disable an experiment won't work correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we identified this issue recently (p1736776189483689-slack-C04DZ8M0GHW, Automattic/wp-calypso#98341) and prepared a quick fix to bust the cached assignment 😄 (#41093)
Proposed changes:
Adds a new util so we can fetch the current user assignment of the Duplicate Views experiment.
Note that the experiment has not been created, so in the meantime we're using a placeholder (a temporary experiment I created that will be removed once the actual experiment has been created).
22124-explat-experiment
Other information:
Jetpack product discussion
N/A
Does this pull request change what data or activity we track or use?
No
Testing instructions:
wpcom_is_duplicate_views_experiment_enabled()