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

Disable Migrate Guru install when the white labeled plugin is used #94677

Merged

Conversation

m1r0
Copy link
Member

@m1r0 m1r0 commented Sep 18, 2024

Resolves #94576

Proposed Changes

  • Create a new hook that won't install the Migrate Guru plugin and won't try to fetch the migration key from it.
  • Update the provisioning component to not show the following steps: Installing the required plugins and Getting the migration key.

Testing Instructions

Screenshot 2024-09-17 at 12 24 05 PM Screenshot 2024-09-17 at 12 24 58 PM
  • Go to your AT site and make sure the Migrate Guru plugin is installed as before.
  • Delete the Migrate Guru plugin from the AT site.
  • Now add &flags=migration-flow/enable-white-labeled-plugin to the URL and reload.
  • You should see the updated instructions referencing Migrate to WordPress.com:
Screenshot 2024-09-17 at 12 23 15 PM Screenshot 2024-09-17 at 12 25 18 PM
  • Go to your AT site and make sure the Migrate Guru is not installed.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented Sep 18, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • command-palette-wp-admin
  • help-center
  • notifications
  • odyssey-stats
  • whats-new
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/disable-migrate-guru-install-when-using-the-move-plugin on your sandbox.

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@m1r0 m1r0 force-pushed the update/disable-migrate-guru-install-when-using-the-move-plugin branch from f81fa80 to 569474b Compare September 18, 2024 16:28
@m1r0 m1r0 marked this pull request as ready for review September 18, 2024 16:36
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 18, 2024
@m1r0 m1r0 self-assigned this Sep 18, 2024
Comment on lines +102 to +104
} = config.isEnabled( 'migration-flow/enable-white-labeled-plugin' )
? usePrepareSiteForMigrationWithMigrateToWPCOM( siteId ) // eslint-disable-line react-hooks/rules-of-hooks -- Temporary workaround until we completely replace the migrate guru hook.
: usePrepareSiteForMigrationWithMigrateGuru( siteId ); // eslint-disable-line react-hooks/rules-of-hooks
Copy link
Member Author

Choose a reason for hiding this comment

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

This is somewhat hacky but I don't think it can break the hook call order because the condition is a constant. Let me know if there's a better solution.

Note that this is expected to be cleaned up once the Migrate Guru hook is no longer used.

Copy link
Contributor

@gabrielcaires gabrielcaires Sep 19, 2024

Choose a reason for hiding this comment

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

I would suggest creating a ticket as soon as possible because it may affect the code with the feature off.
I already had an issue caused by it that was very hard to detect. I can help with possible solutions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, thanks for pointing that out, Gabriel. I'm also sorry for any trouble it may have caused.

We're planning to clean this up in the following week or two. Should we prioritize fixing it before that? Is it causing any bugs right now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've created a card for it: #94750.

@markbiek
Copy link
Contributor

@m1r0 A couple of things.

  1. I think that unit test failure is real.
  2. Related to item 1, we're still going to need a migration key, we'll just be calling a different endpoint for it. That overlaps with White-labeled migration plugin: Update front end to fetch key from new endpoint #94503 (which is dependent on White-labeled plugin: Add wpcom-migration key endpoint jetpack#39377).

So we may need a little coordination between you and @sixhours.

@sixhours
Copy link
Contributor

Related to item 1, we're still going to need a migration key, we'll just be calling a different endpoint for it. That overlaps with #94503

That's correct! The front-end change for the migration key is ready for review in #94503

So this PR only needs to disable the Migrate Guru installation piece (and the software part of the progress indicator).

@markbiek
Copy link
Contributor

markbiek commented Sep 18, 2024

Related to item 1, we're still going to need a migration key, we'll just be calling a different endpoint for it. That overlaps with #94503

That's correct! The front-end change for the migration key is ready for review in #94503

So this PR only needs to disable the Migrate Guru installation piece (and the software part of the progress indicator).

Got it! That makes sense.

The unit test will still need to be fixed temporarily though. Or maybe it's enough to just rebase once that other PR is merged?

@markbiek markbiek force-pushed the update/disable-migrate-guru-install-when-using-the-move-plugin branch from 687dc5c to ab800d5 Compare September 18, 2024 18:08
@markbiek
Copy link
Contributor

Just noting that I rebased and the test still fails. I probably won't have time to try and fix today so I'll leave it to you @m1r0 for tomorrow.

@m1r0 m1r0 force-pushed the update/disable-migrate-guru-install-when-using-the-move-plugin branch from ab800d5 to ee655db Compare September 19, 2024 11:02
@m1r0
Copy link
Member Author

m1r0 commented Sep 19, 2024

I think that unit test failure is real.

Thanks for catching that Mark!

That's correct! The front-end change for the migration key is ready for review in #94503
So this PR only needs to disable the Migrate Guru installation piece (and the software part of the progress indicator).

I've added the migration key logic back. It now works as before.

Copy link
Contributor

@markbiek markbiek left a comment

Choose a reason for hiding this comment

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

LGTM!

@m1r0 m1r0 merged commit 7eb2bfd into trunk Sep 19, 2024
11 checks passed
@m1r0 m1r0 deleted the update/disable-migrate-guru-install-when-using-the-move-plugin branch September 19, 2024 14:35
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

White-labeled migration plugin: Do not install Migrate Guru on the site if the flag is enabled
5 participants