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

Create the SITE_MIGRATION_FALLBACK_CREDENTIALS step #96898

Merged
merged 6 commits into from
Dec 3, 2024

Conversation

andregardi
Copy link
Contributor

@andregardi andregardi commented Nov 29, 2024

Proposed Changes

image

As part of application passwords integration on migrations, we are introducing the new the SITE_MIGRATION_FALLBACK_CREDENTIALS step.
It is shares some behavior with the current credential steps, but does not prompt the user for url and does no offer the back file as alternative method.

We present this step to the user when:

  • The automated-migration/application-password feature flag is enabled.
  • The migrated site does not have application password available.

We are making a request to /automated-migration/application-passwords/authorization-url, that will be used to check if the site has application passwords available.

  • If it is disabled, we are directing the user to the SITE_MIGRATION_FALLBACK_CREDENTIALS step.
  • If it is available, we are directing the user to the SITE_MIGRATION_APPLICATION_PASSWORDS_APPROVAL step, and adding the authorizationUrl as a parameter to be used on next step.

Testing Instructions

The automated-migration/application-password feature flag is already on localhost environment.

Testing the authorization-url endpoint call and logic.

We are using the Disable Application Passwords plugin to test the scenario in which applications password is not available.

Start a Do it for me migration until you reach the /site-migration-credentials step.

Click on Continue button.

  • If the plugin is disabled, you should be directed to the SITE_MIGRATION_APPLICATION_PASSWORDS_APPROVAL step. This is still a placeholder step, don't expect any functionality to be implemented. Check that the ``authorizationUrl` parameter is added to the url.
  • If the plugin is enabled, you should be directed to the SITE_MIGRATION_FALLBACK_CREDENTIALS step.

Testing SITE_MIGRATION_FALLBACK_CREDENTIALS step

Try to input a wrong username and password.
Click on Continue button.
You should get the following error.
image

The button label should change to Continue anyway.
Clicking on it should create a migration ticket on Zendesk.

Close the Zendesk ticket and hit the back button.
This time use the right username and password.
It should also create a Zendesk ticket. This time with the quickforget link to the credentials.

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 UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • 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)?

@andregardi andregardi requested a review from a team as a code owner November 29, 2024 01:03
@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 Nov 29, 2024
@matticbot
Copy link
Contributor

matticbot commented Nov 29, 2024

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

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

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug agardi/app-passwords-secure-credentials on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Nov 29, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~99 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
entry-subscriptions         +357 B  (+0.0%)      +99 B  (+0.0%)
entry-stepper               +357 B  (+0.0%)      +99 B  (+0.0%)
entry-main                  +357 B  (+0.0%)      +99 B  (+0.0%)
entry-login                 +357 B  (+0.0%)      +99 B  (+0.0%)
entry-domains-landing       +357 B  (+0.1%)      +99 B  (+0.0%)
entry-browsehappy           +357 B  (+0.2%)      +99 B  (+0.2%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~647 bytes added 📈 [gzipped])

name                        parsed_size           gzip_size
site-migration-flow             +1228 B  (+1.4%)      +97 B  (+0.6%)
hosted-site-migration-flow      +1228 B  (+1.4%)      +97 B  (+0.6%)
with-theme-assembler-flow        +673 B  (+0.9%)      +42 B  (+0.4%)
update-options-flow              +673 B  (+1.2%)      +43 B  (+0.7%)
update-design-flow               +673 B  (+0.1%)      +43 B  (+0.0%)
trial-wooexpress-flow            +673 B  (+1.1%)      +42 B  (+0.6%)
tailored-ecommerce-flow          +673 B  (+1.1%)      +43 B  (+0.6%)
site-setup-wg                    +673 B  (+0.6%)      +42 B  (+0.2%)
site-setup-flow                  +673 B  (+0.6%)      +42 B  (+0.2%)
readymade-template-flow          +673 B  (+0.5%)      +46 B  (+0.1%)
migration-signup                 +673 B  (+1.1%)      +39 B  (+0.5%)
migration-flow                   +673 B  (+0.8%)      +42 B  (+0.3%)
import-flow                      +673 B  (+1.0%)      +40 B  (+0.4%)
free-post-setup-flow             +673 B  (+1.2%)      +41 B  (+0.7%)
entrepreneur-flow                +673 B  (+0.5%)      +42 B  (+0.1%)
assembler-first-flow             +673 B  (+0.8%)      +44 B  (+0.3%)
ai-assembler-flow                +673 B  (+0.8%)      +43 B  (+0.3%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@andregardi andregardi requested a review from a team November 29, 2024 01:29
@andregardi andregardi self-assigned this Dec 2, 2024
@andres-blanco
Copy link
Contributor

Hi @andregardi, Will you update the name of the step as part of this PR?

@andregardi andregardi force-pushed the agardi/app-passwords-secure-credentials branch from e4a500e to a8dbd0f Compare December 2, 2024 19:14
@andregardi andregardi changed the title Create the SITE_MIGRATION_SECURE_CREDENTIALS step Create the SITE_MIGRATION_FALLBACK_CREDENTIALS step Dec 2, 2024
@sixhours
Copy link
Contributor

sixhours commented Dec 3, 2024

This is working for me!

Editing because I'm getting some inconsistent results the more I test. I think it might be due to caching, because it takes a little while between the time I activate/deactivate the Disable Application Passwords plugin on my test site for the API to recognize the change. I disabled Edge Cache on my test site and that did not seem to help, so I'm thinking maybe something in our local application storage in Stepper?

Probably not a huge issue for users who won't be going back and forth through the flow multiple times and changing their site's application password status, but something to consider.

Copy link
Contributor

@valterlorran valterlorran left a comment

Choose a reason for hiding this comment

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

Overall is looking good for me, I just a left a few nit comments.

@andregardi andregardi merged commit de815d1 into trunk Dec 3, 2024
13 checks passed
@andregardi andregardi deleted the agardi/app-passwords-secure-credentials branch December 3, 2024 19:34
@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 Dec 3, 2024
@a8ci18n
Copy link

a8ci18n commented Dec 3, 2024

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17044681

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Thank you @andregardi for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Dec 8, 2024

Translation for this Pull Request has now been finished.

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.

6 participants