Skip to content

Conversation

murray-andrew-r
Copy link
Contributor

@murray-andrew-r murray-andrew-r commented Jul 22, 2025

WHY are these changes introduced?

Closes https://github.com/shop/issues-develop/issues/12741#issue-3249208952

This puts us at parity with webhook subscription URLs, which already have this feature.

WHAT is this pull request doing?

Appends the application url to the start of the proxy URL if the proxy URL starts with / .

Updates validations to allow / leading proxy URLs. Also ensures that only HTTP proxies are used.

How to test your changes?

  1. pnpm shopify app init
  2. In app.toml add
    [app_proxy]
    url = "https://www.api.example.com/api/proxy2"
    subpath = "store-pickup"
    prefix = "apps"

Substituting focused-share-holder app with your app name:

  1. pnpm shopify app deploy --path=./focused-shareholder-app should succeed
  2. In dev dash, confirm that the app proxy URL is https://www.api.example.com/api/proxy2
  3. Update url to http://www.api.example.com/api/proxy2
  4. pnpm shopify app deploy --path=./focused-shareholder-app should fail with an HTTP validation.
  5. Update url to /api/proxy2
  6. pnpm shopify app deploy --path=./focused-shareholder-app should succeed
  7. In dev dash, confirm that the proxy url is https://example/com/api/proxy2

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
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@murray-andrew-r murray-andrew-r force-pushed the prepend-app-url-to-app-proxy branch 2 times, most recently from b159331 to 2f54132 Compare July 23, 2025 13:29
Copy link
Contributor

github-actions bot commented Jul 23, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.32% (+0.03% 🔼)
13173/16819
🟡 Branches
72.39% (+0.09% 🔼)
6425/8876
🟡 Functions
78.4% (+0.02% 🔼)
3419/4361
🟡 Lines
78.69% (+0.03% 🔼)
12464/15839
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / url_prepender.ts
100% 100% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app_config_webhook_subscription.ts
100%
50% (-16.67% 🔻)
100% 100%

Test suite run success

3121 tests passing in 1324 suites.

Report generated by 🧪jest coverage report action from 6efb593

@murray-andrew-r murray-andrew-r force-pushed the prepend-app-url-to-app-proxy branch 2 times, most recently from b0fc143 to b4d4f97 Compare July 23, 2025 14:08
@murray-andrew-r murray-andrew-r marked this pull request as ready for review July 23, 2025 14:18
@murray-andrew-r murray-andrew-r requested a review from a team as a code owner July 23, 2025 14:18

This comment has been minimized.

@murray-andrew-r murray-andrew-r force-pushed the prepend-app-url-to-app-proxy branch from b4d4f97 to 8cc6411 Compare July 23, 2025 14:28
@murray-andrew-r murray-andrew-r requested a review from a team as a code owner July 23, 2025 14:28
Copy link
Contributor

@isaacroldan isaacroldan left a comment

Choose a reason for hiding this comment

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

Let's investigate if this can be done server side

Copy link
Contributor

@isaacroldan isaacroldan left a comment

Choose a reason for hiding this comment

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

🎩 'ed and worked as expected.

Copy link
Contributor

@pt2pham pt2pham left a comment

Choose a reason for hiding this comment

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

LGTM. Note for future lurkers that this is a compromise in the CLI and it would be ideal to do a better platform solution for relative URLs across app config/extensions in the future.

Copy link
Contributor

@jackseok jackseok left a comment

Choose a reason for hiding this comment

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

LGTM just left a small comment

@murray-andrew-r murray-andrew-r added this pull request to the merge queue Jul 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 25, 2025
@murray-andrew-r murray-andrew-r added this pull request to the merge queue Aug 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 6, 2025
@murray-andrew-r murray-andrew-r force-pushed the prepend-app-url-to-app-proxy branch from 8cc6411 to 6efb593 Compare August 6, 2025 18:22
@murray-andrew-r murray-andrew-r added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit 4098d69 Aug 6, 2025
30 checks passed
@murray-andrew-r murray-andrew-r deleted the prepend-app-url-to-app-proxy branch August 6, 2025 18:41
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.

5 participants