Skip to content

[Feature] Allow Flow action extension runtime_urls to be relative#7715

Open
EliasJRH wants to merge 10 commits into
extend_deploy_configfrom
relative_dev_flow_action_urls
Open

[Feature] Allow Flow action extension runtime_urls to be relative#7715
EliasJRH wants to merge 10 commits into
extend_deploy_configfrom
relative_dev_flow_action_urls

Conversation

@EliasJRH
Copy link
Copy Markdown
Contributor

@EliasJRH EliasJRH commented Jun 4, 2026

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_url in 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?

  • Create an with a Flow action extension with a relative runtime_url
  • Run shopify app dev, install app + Flow on dev store and create workflow using Flow action extension
  • Trigger workflow, observe that local tunnel endpoint is hit at specified relative path
  • Deploy app with shopify app deploy, create workflow with deployed Flow action extension
  • Trigger workflow, observe that application url endpoint is hit at specified relative path

Post-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

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 4, 2026
@EliasJRH EliasJRH changed the title Relative dev flow action urls [Feature] Allow Flow action extension runtime_urls to be relative Jun 4, 2026
@EliasJRH EliasJRH self-assigned this Jun 4, 2026
@EliasJRH EliasJRH added the includes-post-release-steps PRs including this label require additional steps after releasing label Jun 4, 2026
@github-actions github-actions Bot added Area: @shopify/app @shopify/app package issues and removed no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. labels Jun 4, 2026
@EliasJRH EliasJRH marked this pull request as ready for review June 4, 2026 20:09
@EliasJRH EliasJRH requested review from a team as code owners June 4, 2026 20:09
@EliasJRH EliasJRH requested a review from ryanische June 4, 2026 20:14
return baseFieldSchema.parse(configField)
}

export const startsWithHttps = (url: string) => url.startsWith('https://')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we still have a validation where if the the url is not relative, we check that it starts with https?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the validateFlowActionUrl calls validateRelativeUrl which will return true if the url is relative or https

Comment on lines +59 to +63
const containsUrlControlCharacter = (value: string) => /[\r\n\t]/.test(value)

const isFlowActionRelativeUrl = (value: string) => {
return value.startsWith('/') && !value.startsWith('//') && !containsUrlControlCharacter(value)
}
Copy link
Copy Markdown
Contributor

@ryanische ryanische Jun 4, 2026

Choose a reason for hiding this comment

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

Are these relevant to the validateRelativeUrl function in validation/common.ts as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread packages/app/src/cli/services/flow/validation.ts Outdated
appModuleFeatures: (_) => [],
deployConfig: async (config, extensionPath) => {
/**
* During `app dev`, swap any relative URLs (starting with `/`) for the dev
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just confirming behaviour - this only happens for app dev, not app deploy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/app @shopify/app package issues includes-post-release-steps PRs including this label require additional steps after releasing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants