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

Relative uris declarative subscriptions #3956

Conversation

alexanderMontague
Copy link
Contributor

WHY are these changes introduced?

depends on #3955
closes https://github.com/Shopify/develop-app-management/issues/1599

Adds relative URIs to your app's URL to declarative webhooks

WHAT is this pull request doing?

exposes the fullAppConfiguration to various deploy and link locations in order to transform webhook subscriptions by checking the application_url

Copy link
Contributor

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.

Copy link
Contributor

github-actions bot commented May 30, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
71.94% (+0.04% 🔼)
7236/10058
🟡 Branches
69.15% (+0.05% 🔼)
3578/5174
🟡 Functions
71.56% (+0.05% 🔼)
1935/2704
🟡 Lines
73.21% (+0.05% 🔼)
6814/9307
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app_config_privacy_compliance_webhooks.ts
100%
93.94% (-2.36% 🔻)
100% 100%
🟢
... / app_config_webhook.ts
98.39% (+0.08% 🔼)
85.37% (-3.21% 🔻)
100% 100%
🟢
... / common.ts
87.5% (-12.5% 🔻)
88.89% (-11.11% 🔻)
100% 100%

Test suite run success

1684 tests passing in 781 suites.

Report generated by 🧪jest coverage report action from 9b4b90c

@shauns shauns changed the base branch from main to app-config-provided-to-transforms May 31, 2024 08:16

[[webhooks.subscriptions]]
topics = [ "products/create", "products/update" ]
uri = "/webhooks"
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

import {WebhooksConfig, NormalizedWebhookSubscription, WebhookSubscription} from '../types/app_config_webhook.js'
import {deepCompare, deepMergeObjects, getPathValue} from '@shopify/cli-kit/common/object'

export function transformFromWebhookConfig(content: object) {
export function transformFromWebhookConfig(content: object, appConfiguration: AppConfigurationWithoutPath) {
const webhooks = getPathValue(content, 'webhooks') as WebhooksConfig
if (!webhooks) return content

const webhookSubscriptions = []
// eslint-disable-next-line @typescript-eslint/naming-convention
Copy link
Contributor

Choose a reason for hiding this comment

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

I've added to https://github.com/Shopify/develop-app-management/issues/1797

Maybe we could change https://typescript-eslint.io/rules/naming-convention/#ignore-destructured-names -- if you're destructuring its not really your fault that the names are "wrong".

@shauns shauns merged commit d9e50b7 into app-config-provided-to-transforms May 31, 2024
@shauns shauns deleted the relative_uris_declarative_subscriptions branch May 31, 2024 08:49
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.

None yet

2 participants