Add filters to SingleWebhookSubscriptionType
WHY are these changes introduced?
- This adds filter that was introduced in https://github.com/Shopify/cli/pull/3862 to the SingleWebhookSubscriptionType which was introduced in https://github.com/Shopify/cli/pull/3846. As we're moving to multiple modules for webhook subscriptions this is required to enable filtering.
WHAT is this pull request doing?
Adds filtering to SingleWebhookSubscriptionType so we can create webhook subscriptions with filters in the new module layout.
How to test your changes?
- Enable the declarative webhooks beta flags
- Created an app with the following webhooks configuration in the TOML file
[webhooks]
api_version = "unstable"
[[webhooks.subscriptions]]
topics = [ "products/update" ]
uri = "https://webhook.site/f8577819-9c7e-44ab-8012-b13f784ddc73"
include_fields = [ "id" ]
filter = "id:>100"
Ran the following command to deploy my app:
export SPIN_INSTANCE=constellation-partners-events-cli-k9kt
SHOPIFY_SERVICE_ENV=spin NODE_TLS_REJECT_UNAUTHORIZED=0 pnpm shopify app deploy --path ./test-filter-app
Validated that the subscription was set with the filter in the multi-module subscription's app module:
Measuring impact
How do we know this change was effective? Please choose one:
- [ ] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
- [x] Existing analytics will cater for this addition
- [ ] PR includes analytics changes to measure impact
Checklist
- [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
- [x] I've considered possible documentation changes
- [x] I've made sure that any changes to
devordeployhave been reflected in the internal flowchart.
We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** and there are no updates in the .changeset. If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| π‘ | Statements | 71.97% | 7034/9774 |
| π‘ | Branches | 68.81% | 3484/5063 |
| π‘ | Functions | 71.44% | 1881/2633 |
| π‘ | Lines | 73.28% | 6632/9050 |
Test suite run success
1650 tests passing in 766 suites.
Report generated by π§ͺjest coverage report action from 534f9c5d2e124e01ea1952d43ad313fe06eeb26d