[Feature] Allow Flow action extension runtime_urls to be relative#7715
[Feature] Allow Flow action extension runtime_urls to be relative#7715EliasJRH wants to merge 10 commits into
runtime_urls to be relative#7715Conversation
runtime_urls to be relative
| return baseFieldSchema.parse(configField) | ||
| } | ||
|
|
||
| export const startsWithHttps = (url: string) => url.startsWith('https://') |
There was a problem hiding this comment.
Do we still have a validation where if the the url is not relative, we check that it starts with https?
There was a problem hiding this comment.
Yes, the validateFlowActionUrl calls validateRelativeUrl which will return true if the url is relative or https
| const containsUrlControlCharacter = (value: string) => /[\r\n\t]/.test(value) | ||
|
|
||
| const isFlowActionRelativeUrl = (value: string) => { | ||
| return value.startsWith('/') && !value.startsWith('//') && !containsUrlControlCharacter(value) | ||
| } |
There was a problem hiding this comment.
Are these relevant to the validateRelativeUrl function in validation/common.ts as well?
There was a problem hiding this comment.
They could be. I'm not sure what other cases the validateRelativeUrl handles so I think it'd be best to propose as a follow up for the CLI team.
| appModuleFeatures: (_) => [], | ||
| deployConfig: async (config, extensionPath) => { | ||
| /** | ||
| * During `app dev`, swap any relative URLs (starting with `/`) for the dev |
There was a problem hiding this comment.
Just confirming behaviour - this only happens for app dev, not app deploy?
There was a problem hiding this comment.
Yes, during app dev relative urls will be prepended by the auto-generated cloudflare tunnel url and during app deploy they'll be prepended with the configured application url
WHY are these changes introduced?
Closes https://github.com/Shopify/flow/issues/21604
To start allowing the usage of URLs relative to an apps
application_urlin Flow action extensions.WHAT is this pull request doing?
This pull request extends the capabilities of Flow action extensions to allow them to start using relative
runtime_urls in their config.How to test your changes?
runtime_urlshopify app dev, install app + Flow on dev store and create workflow using Flow action extensionshopify app deploy, create workflow with deployed Flow action extensionPost-release steps
The existing dev docs for Flow action extensions make no mention of using relative urls or how it would work with a local app dev setup. Documentation will be written to describe this.
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add