-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add pos_ui_extension to migration for ui_extension #4162
Conversation
This comment has been minimized.
This comment has been minimized.
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.
Looks like this was used in the past & reads like it should do the right thing, so LGTM. Thank you!
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.
Hmm CI failing could be a red herring. Can you update the tests and try to re-run locally? We need a new test for pos_ui_extension
aea2008
to
c09a2fc
Compare
Coverage report
Show files with reduced coverage 🔻
Test suite run success1735 tests passing in 800 suites. Report generated by 🧪jest coverage report action from cb06f10 |
@vividviolet good call out, turns out the issue was fixed by rebasing with main. Did add a test case though |
f973cb6
to
aebbe10
Compare
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.
Looks good to me. We should only merge after the Shopify PR gets shipped. Can you put up a PR? I'll top hat end-to-end with the other PR
@vividviolet yup, already had one in draft, but marked it as ready for review https://github.com/Shopify/shopify/pull/518353 Also not sure if it helps, but my spin instance linked above has both these cli changes and the core one |
I don't think I can point to your spin unfortunately so I have to check out your branches on my own instance |
We have a release next week so it'll be ideal to have this merged today, let me know how the tophat goes @vividviolet 🙏 |
/snapit |
1 similar comment
/snapit |
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Test the snapshot by installing the package globally: pnpm i -g @shopify/cli@0.0.0-snapshot-20240705142219 |
I had no idea this was a thing, that's cool as hell |
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.
Tested end-to-end - everything looks good. Since you're making changes to the migrator, do you mind updating the message? It's a bit confusing because it doesn't say what we're migrating to:
Maybe it should be
Your "sandbox-170" configuration has been updated to a UI extension and needs to be migrated. Migrating gives you access to new features and won't impact the end user experience. All previous extension versions will reflect this change.
And then the prompt should be "Yes, confirm migration from "pos_ui_extension" to "ui_extension"?
Agree on Trish's proposal 👌 |
aebbe10
to
cb06f10
Compare
'@shopify/cli': minor | ||
--- | ||
|
||
Added extension type pos_ui_extension to the ui_extension migration process |
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.
cc @isaacroldan
@@ -41,13 +41,15 @@ export async function extensionMigrationPrompt( | |||
.map((name) => `"${name}"`) | |||
.join(', ') | |||
|
|||
const migrationEndType = toMigrate.map(({local}) => `"${local.type}"`).join(', ') |
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.
Followed the same structure as the other variables in the prompt, but oddly enough this always ends up being one value in the toMigrate, even if there are two extensions to be migrated. Then if you deploy again, it will go to the second extension that needs to be migrated.
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.
@isaacroldan any ideas?
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.
Do you mean you have 2 local ui_extensions and 2 remote pos_ui_extension but only 1 in the toMigrate
?
The code at getUIExtensionsToMigrate
is pretty simple, it just finds matching extensions locally and remotely, you can debug that method and see why it might not match a specific extension.
Also, specifically about this line of code, you are not filtering for duplicated types here, check how uniqueMigrationTypes
does it just above.
renderInfo({ | ||
headline: "Extension migrations can't be undone.", | ||
body: `Your ${migrationNames} configuration has been updated. Migrating gives you access to new features and won't impact the end user experience. All previous extension versions will reflect this change.`, | ||
}) | ||
|
||
const confirmMessage = includeRemoteType | ||
? `Yes, confirm migration from ${uniqueMigrationTypes}` | ||
? `Yes, confirm migration from ${uniqueMigrationTypes} to ${migrationEndType}` |
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.
WHY are these changes introduced?
We noticed that while testing a deploy for Stocky to the new ui extension spec, that the registrationUuid gets regenerated. This is problematic for smart grid tiles that are already existing, as they refer to these uuids in order to exist. If the registrationUuid no longer exists, then the tile will break
WHAT is this pull request doing?
Adds pos_ui_extension extension types to the migrator.
How to test your changes?
shopify app init
. You will also need an extension, but you can copy this folder and toss it into your new app. You can just copy this foldersandbox-170.zip
into your local spin instance. Make sure you run npm install to install the dependencies.
pnpm shopify app deploy --path {path to your app} --verbose
. This should deploy the extension in the old spec.specificationIdentifier: "pos_ui_extension"
to make sure that it's there. Take note of the registrationUuid.pnpm build
andpnpm shopify app build
.pnpm shopify app deploy --path {path to your app} --verbose
again. This time you should get a prompt to migrate your extension. Hit yes.specificationIdentifier: "ui_extension"
. You should see your extension there with the SAMEregistrationUuid
.Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist