-
Notifications
You must be signed in to change notification settings - Fork 143
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 support for MOTO in credit card payments extension schema #5043
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this is not optional, it will break any existing extension that doesn't have it. Is this an accepted outcome? should it have a default value?
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.
My understanding is that the CLI will be used when partners want to update/create extensions. At this point we want them to supply a value. Default value will be used in core when existing extensions are loaded in Core (https://github.com/Shopify/shopify/pull/559538). Are there other scenarios where CLI is used to manage/load extensions that I am missing?
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.
When I say existing extensions, i mean at the moment of updating them via CLI, it will fail until they provide this value.
Simple case:
Is this the expected behaviour? If it is, then OK; just wanted to confirm!
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.
Thanks. I think it's worth it to provide default values similar to what is done in core
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.
Ok, we had some team discussion and decided it might be better to fail deploys on releasing this to force the new param instead of offering a default. I added some better error messaging in cf2bc94, and the unit tests I wrote for it work, but I'm having trouble tophatting this.
When I run
pnpm shopify app dev
for my extension in spin, I getinstead of the error message I defined for either the wrong type or the value being missing altogether.
@isaacroldan is this the right kind of validation to introduce here? Is there a better way to define this? I'm not sure I have enough cli context to understand why this isn't working.
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.
Ok I think this has something to do with how we're defining/loading the schema for this?
cli/packages/app/src/cli/models/extensions/specifications/payments_app_extension_schemas/credit_card_payments_app_extension_schema.ts
Lines 19 to 28 in cf2bc94
I added some debug code to the loader here
output of `pnpm shopify app dev --path=../cli-apps/test`
I'm not too familiar with Zod, but is what's happening here that it's not managing to resolve it to a credit card payment extension? Which is why the error is there and the specific schema tests pass, but then when we try to do it all together it fails?