[Feature] Relative url patching on contract app extensions - #8362
Open
EliasJRH wants to merge 5 commits into
Open
[Feature] Relative url patching on contract app extensions#8362EliasJRH wants to merge 5 commits into
EliasJRH wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends relative-URL support beyond locally-specified extensions by introducing shared URL resolution logic and applying it to contract-based modules (notably flow_trigger_lifecycle_callback), so relative URL fields can be resolved against the dev tunnel in app dev and against application_url during deploy.
Changes:
- Introduces
resolveAppRelativeUrl/patchAppRelativeUrlsto centralize “app-relative URL” resolution and validation (HTTPS-only, blocks protocol-relative URLs and control characters). - Applies the shared resolver to Flow action URL fields and to contract-based module config patching (dev + deploy).
- Adds/updates tests and a changeset documenting the new user-facing behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/app/src/cli/services/flow/validation.ts | Reuses shared control-character regex for Flow action URL validation. |
| packages/app/src/cli/services/flow/utils.ts | Removes Flow-action-specific URL resolution helper (now centralized elsewhere). |
| packages/app/src/cli/services/flow/utils.test.ts | Removes tests for deleted resolveFlowActionUrl. |
| packages/app/src/cli/services/flow/types.ts | Removes now-unused FlowActionUrlField type. |
| packages/app/src/cli/models/extensions/specifications/validation/app_relative_urls.ts | Adds shared resolver/patcher for app-relative URLs and contract-module field mapping. |
| packages/app/src/cli/models/extensions/specifications/validation/app_relative_urls.test.ts | Adds unit coverage for the shared resolver/patcher behavior and error cases. |
| packages/app/src/cli/models/extensions/specifications/flow_action.ts | Switches Flow action URL resolution to shared resolveAppRelativeUrl. |
| packages/app/src/cli/models/extensions/specification.ts | Hooks contract-based modules into app-relative URL patching in dev + deploy paths. |
| packages/app/src/cli/models/extensions/specification.integration.test.ts | Adds integration coverage for contract-based module relative URL behavior. |
| packages/app/src/cli/models/app/validation/common.ts | Adds shared URL_CONTROL_CHARACTERS and isHttpsUrl helpers. |
| .changeset/flow-trigger-lifecycle-callback-relative-url.md | Declares the user-facing feature as a minor bump. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WHY are these changes introduced?
Part of https://github.com/shop/issues-automate/issues/3352
Merge only after https://meteorite.shopify.io/repos/shop/world/pulls/2009553/files has merged
WHAT is this pull request doing?
We recently extended
deployConfigwith the capabilities of using application config info (primarily the application url) when deploying app extensions with local contracts (see #7715). This PR primarily extends this to extensions with remote contracts (in this PR, the Flow trigger lifecycle callback extension time).How to test your changes?
Tested on flow-with-local-apps rig from
flowzone./realtive-path) with corresponding route file in/app/routesshopify app devcreate and activate a Flow workflow using custom Flow trigger, observe that relative route file is hit in application logsshopify app deploy, create and activate a Flow workflow using custom Flow trigger, observe that application url receives callback request at relative pathCI
dev test packages/app/src/cli/models/extensions/specifications/validation/app_relative_urls.test.ts packages/app/src/cli/models/extensions/specification.integration.test.ts packages/app/src/cli/services/flow/utils.test.ts-> 34 tests passPost-release steps
Will update "Flow trigger lifecycle callback" extension docs to include info about relative url support. Will also publish developer changelog entry.
Checklist