-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fix webhook link logic #3892
Fix webhook link logic #3892
Conversation
We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** and there are no updates in the .changeset. |
Coverage report
Show files with reduced coverage 🔻
Test suite run success1667 tests passing in 774 suites. Report generated by 🧪jest coverage report action from 16d806c |
0aaf611
to
5200a64
Compare
packages/app/src/cli/models/extensions/specifications/transform/app_config_webhook.ts
Outdated
Show resolved
Hide resolved
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.
LGTM! thanks for getting this resolved @gracejychang!
@@ -2828,7 +2806,7 @@ describe('WebhooksSchema', () => { | |||
code: zod.ZodIssueCode.custom, | |||
message: 'You can’t have duplicate subscriptions with the exact same `topic`, `uri` and `filter`', | |||
fatal: true, | |||
path: ['webhooks', 'subscriptions', 1, 'topics', 0, 'products/create'], | |||
path: ['webhooks', 'subscriptions', 0, 'topics', 1, 'products/create'], |
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.
Just curious: what do these numbers mean and why did they change with this PR? I'm guessing it has something to do with the sorting?
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.
ohh, I think this might have something to do with condensing the webhooks, instead of sorting? cause the subscriptions look like this after the transform on the schema:
subscriptions: [
{
topics: ['products/update', 'products/update'],
uri: 'https://example.com',
filter: 'title:shoes',
},
],
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.
This isn't a great DX... the number used to tell you what index of [[webhooks.subscriptions]]
(ie. the order top to bottom) you should be looking at. Now it will forever be webhooks.subscriptions.0.topics...
. I think we should come back to this or at least chat with UX on the best path forward.
packages/app/src/cli/models/extensions/specifications/transform/app_config_webhook.ts
Show resolved
Hide resolved
only weirdness I saw when testing is that the the subscriptions showed 0 on the version page, but a refresh showed the subscription I was expecting. not blocking and not related to this PR since it seems to happen on main too but just noting it here |
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.
Not sure I agree with the approach but agreed lets not block and get this shipped! We can clean it up on the server for M2 - thanks for looking into this
packages/app/src/cli/models/extensions/specifications/transform/app_config_webhook.ts
Outdated
Show resolved
Hide resolved
packages/app/src/cli/models/extensions/specifications/transform/app_config_webhook.ts
Show resolved
Hide resolved
packages/app/src/cli/models/extensions/specifications/transform/app_config_webhook.ts
Show resolved
Hide resolved
packages/app/src/cli/models/extensions/specifications/transform/app_config_webhook.ts
Outdated
Show resolved
Hide resolved
packages/app/src/cli/models/extensions/specifications/transform/app_config_webhook.ts
Show resolved
Hide resolved
Approved 👍 |
4f58dd8
to
f9ff097
Compare
3e080c8
to
d9a36d0
Compare
d9a36d0
to
a26cd35
Compare
to keep the diff btwn remote and local config consistent
09113fd
to
16d806c
Compare
Fixes https://github.com/Shopify/develop-app-management/issues/1792
WHY are these changes introduced?
There are two ways of defining webhooks in the toml:
When linking to a new app we need to default to the condensed state, but right now we are doing expanded.
WHAT is this pull request doing?
simplify
function from the specificationlink
command to further condense webhooksHow to test your changes?
See the description in this issue
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist
dev
ordeploy
have been reflected in the internal flowchart.