jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

WPCOMSH: Post transfer action to conditionally enable HPOS on WooCommerce sites

Open markbiek opened this issue 3 weeks ago • 1 comments

Related to 1468

Proposed changes:

Along with D153524-code, this adds a more general fix for the issue where some WooCommerce sites did not have HPOS enabled after the Atomic transfer.

This adds a new post-transfer action which checks to see if HPOS needs to be enabled for the site and enables it.

Other information:

  • [NA] Have you written new tests for your changes, if applicable?
  • [x] Have you checked the E2E test CI results, and verified that your changes do not break them?
  • [x] 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:

Note that we can't do a complete end-to-end test until this PR and the corresponding WPCOM diff (D153524) have been deployed. Once these both ship, the functionality will be gated to Serenity users and we can do a full test and remove the gate.

Setup

  1. Go to https://wordpress.com/setup/free and create a new site.
  2. Continue through the site flow. It doesn't matter if you launch the site or not.
  3. Locate the site id and add the site as an Atomic dev blog (transfer to Atomic dev server pool).
  4. Go to the site dashboard and upgrade to an Entrepreneur plan.
  5. Go to the Hosting Config (https://wordpress.com/hosting-config/yourtestsite.wpcomstaging.com) and ensure that ssh is enabled.
  6. SSH into your site and check to see if HPOS is enabled (wp wc hpos status). If it's enabled, disable it by running wp wc hpos disable.

Testing

  1. Apply D153524-code to your sandbox and sandbox the public-api.
  2. Check out this branch (1468-update/hpos-wpcomsh-wpcli) to the Jetpack project on your local machine.
  3. From within the Jetpack project run jetpack rsync wpcomsh [email protected]:htdocs/wp-content/mu-plugins (replace yourtestsite with the actual name of your test site) to copy the wpcomsh changes to your WoA site.
  4. SSH into your site and run wp shell.
  5. In the wp shell, run do_action( 'wpcomsh_woa_post_transfer', array(), array( 'woocommerce_hpos' => true ) );.
  6. Verify that the command runs without errors.
  7. Use CTRL-D to exit the wp shell (this ensures PHP shutdown runs and we send the appropriate messages to logstash.
  8. Run wp wc hops status and verify that HPOS is now enabled.
  9. Go to logstash (d15a40a7e6287357551d44cc5a806099-logstash) and verify that you see a success message for your blog id.

markbiek avatar Jun 28 '24 18:06 markbiek