-
Notifications
You must be signed in to change notification settings - Fork 10.7k
dev: refactor installAndActivatePlugins to xstate #38577
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
dev: refactor installAndActivatePlugins to xstate #38577
Conversation
Test Results SummaryCommit SHA: 97a250b
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
a276f2b to
2d4f848
Compare
|
This looks great! I had no idea you could use a machine as an invoke source! 👍 |
37b9a0a to
2a31944
Compare
8186795 to
c5d192f
Compare
|
Hi @ilyasfoo, @adrianduffell, @woocommerce/ghidorah Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
moon0326
left a comment
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.
Thank you for working on the changes 👍 It's straightforward and easy to understand!!
Code LGTM and tested well 👍
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.
After 5 seconds, you should see a request to
wp-json/wc-admin/plugins/installwith async=true and redirected to Woo Home.
Wanted to confirm, I had wp-json/wc-admin/plugins/installed fired. Is that correct?
woocommerce_onboarding_profile option should have plugins_page_skipped set to true
This test failed for me. Not sure what went wrong, I had no errors after skipping. My option values after the onboarding:
{
"business_choice": "im_just_starting_my_business",
"selling_online_answer": null,
"selling_platforms": null,
"is_store_country_set": true,
"industry": [
null
],
"completed": true
}
@ilyasfoo I'm seeing this, so it seems to be working correctly. But granted I was using the production value of 30000 (30 secs) instead of 5000. For the profile item update I can reproduce that, it seems like the API is being called as it was before the refactor, but it doesn't seem to be being persisted correctly. I'm mindful of keeping this PR as much of a pure refactor as possible since Moon already has a PR in progress to make changes that are rebased on top of this one, so big changes here could result in a lot of work to untangle that one. I'll make a note in the issue to review the options regarding this. I did catch something else but it's also not within the scope of this PR, @moon0326 the free-extensions API seems to be returning different sets of plugins the first time I run it, and the second time I ran it. I'll make an issue to investigate it. Second time after installing all of the selected above:
|
ilyasfoo
left a comment
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.
@rjchow Gotcha. Makes sense to address that issue outside of this PR. 🚢
c5d192f to
97a250b
Compare




Submission Review Guidelines:
Changes proposed in this Pull Request:
This is a pure refactor of the core profiler's install plugins page, and no user-facing differences should occur.
The original PR's test instructions can be found here: #38405
Follow up issue to supplement test coverage:
235-gh-woocommerce/team-ghidorah
How to test the changes in this Pull Request:
Before each test case:
rm -rf woocommerce-payments woocommerce-services jetpack pinterest-for-woocommerce mailpoet tiktok-for-business google-listings-and-adsin the plugins directory. You might have to visit/wp-admin/plugins.phpto refresh the plugins cache.Installation completes in 30 seconds
Continuebutton.storeprofiler_store_extensions_installed_and_activatedtracksstoreprofiler_step_viewtrack.If you have fast internet, installation should finish in 30 seconds, and you should be redirected to WooCommerce Home.
Installation exceeds 30 seconds.
If you have fast internet, this is hard to test since it won't take 30 seconds to install the plugins. We can adjust the timer time in this case.
Continue{site}/wp-json/wc-admin/onboarding/plugins/install-and-activate-asyncand redirected to Woo Home.storeprofiler_store_extensions_installed_and_activatedtracksInstallation completed with errors
mailpoetdirectory.test.txtfile in themailpoetdirectory. This will make the installation fail.ContinuePlease try againmailpoetdirectory from your plugins directory.Please try againagain.User clicks on skip this page
Skip this stepwoocommerce_onboarding_profileoption should haveplugins_page_skippedset to true