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

RDV: Sync calypso preference for a12s #41710

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

BogdanUngureanu
Copy link
Contributor

a12s are assigned in our client code the treatment variation - variation which is cached in an option. However, the variation was not also passed in the calypso preferences.

While this wasn't a major problem in the past, this is now causing problems because the Calypso preference is now used in other contexts.

Since the assignment variation is cached in a user option, short-circuiting the code, we also need a way to dynamically purge the cache for a12s so that the calypso preference is configured.

Proposed changes:

  • Sync the Calypso preference for a12s (since they are assigned treatment in our code)
  • Force a caching purge for a12s

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Apply the PR on your sandbox and an Atomic site
  • Add a die('purged') in wpcom_rdv_reset_cache_if_needed, on line 403, after delete_user_option
  • Add a die('cached') on line 460
  • Go to wp-admin and notice you get purged
  • Refresh the page twice and notice the cache text
  • This means that the cache has been purged and cached again
  • Notice that the calypso preference is in sync.

@BogdanUngureanu BogdanUngureanu self-assigned this Feb 11, 2025
@BogdanUngureanu BogdanUngureanu requested a review from a team February 11, 2025 10:21
@BogdanUngureanu BogdanUngureanu added [Type] Bug When a feature is broken and / or not performing as intended [Status] Needs Team Review labels Feb 11, 2025
Copy link
Contributor

github-actions bot commented Feb 11, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the fix/rdv-set-calypso-preferences-for-a12s branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack-mu-wpcom-plugin fix/rdv-set-calypso-preferences-for-a12s
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copy link
Contributor

github-actions bot commented Feb 11, 2025

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for none scheduled (scheduled code freeze on undefined).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Starter Plugin plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Automattic For agencies client plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

Copy link
Contributor

github-actions bot commented Feb 11, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php 0/419 (0.00%) 0.00% 9 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

okmttdhr
okmttdhr previously approved these changes Feb 12, 2025
Copy link
Member

@okmttdhr okmttdhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed the following:

  1. Prepared an inconsistent RDV assignment between Calypso (control) and Jetpack (treatment) by manually setting control via 22167-explat-experiment.
  2. Applied the patch on Atomic
  3. Navigated to wp-admin/options-general.php.
  4. Observed a consistent assignment (treatment) b/w Calypso and Jetpack
  5. Assigned control using the escape hatch.
  6. Verified the control behavior.
  7. Assigned treatment using the escape hatch.
  8. Verified the treatment behavior.
  9. Cleared the Calypso preference by executing the following in the Console:
    {"remove_duplicate_views_experiment_assignment_160125": null}
    Screenshot 2025-02-12 at 11 55 48
  10. Confirmed that the treatment behavior persists.

LGTM on changes!

@github-actions github-actions bot added [mu wpcom Feature] Verbum Comments Verbum, a better comment experience, app developed in the mu-wpcom plugin [Package] Forms [Package] Jitm [Package] Masterbar [Package] My Jetpack [Package] Plugin Deactivation [Package] Schema [Package] Sync [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh [Tests] Includes Tests Actions GitHub actions used to automate some of the work around releases and repository management RNA labels Feb 13, 2025
@okmttdhr okmttdhr force-pushed the fix/rdv-set-calypso-preferences-for-a12s branch from 63a7f3a to 453ab00 Compare February 13, 2025 02:29
@okmttdhr okmttdhr merged commit 73b7e72 into trunk Feb 13, 2025
61 checks passed
@okmttdhr okmttdhr deleted the fix/rdv-set-calypso-preferences-for-a12s branch February 13, 2025 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions GitHub actions used to automate some of the work around releases and repository management [Block] AI Assistant [Block] Contact Form Form block (also see Contact Form label) [Block] Subscriptions [Boost Feature] Minify [Extension] AI Assistant Plugin [Extension] SEO [Feature] Contact Form [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Feature] WPCOM API I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [JS Package] Critical Css Gen [JS Package] Image Guide [JS Package] React Data Sync Client [mu wpcom Feature] Verbum Comments Verbum, a better comment experience, app developed in the mu-wpcom plugin [mu wpcom Feature] Wpcom Admin Interface [Package] Forms [Package] Jetpack mu wpcom WordPress.com Features [Package] Jitm [Package] Masterbar [Package] My Jetpack [Package] Plugin Deactivation [Package] Schema [Package] Sync [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh RNA [Tests] Includes Tests [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants