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

Stop updating the app urls in the app toml when using the app management API #5246

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

isaacroldan
Copy link
Contributor

@isaacroldan isaacroldan commented Jan 21, 2025

WHY are these changes introduced?

For dev sessions we don't want to update the toml, but to inject the Application URLs directly in the toml at runtime.

WHAT is this pull request doing?

Refactors the partner URL updating logic to:

  • Store new URLs in the local app for dev sessions without updating the TOML file
  • Maintain existing URL update behavior for non-dev session environments

How to test your changes?

Remember that you can find the manifest in ./shopify/bundle while running app dev

  1. Start dev with dev sessions enabled
  • Having automatically_update_urls_on_dev = true:
    • Verify that tunnel URLs are included in the manifest and not in the toml
    • Verify that modifying the URLs in the toml during dev, doesn't update them in the manifest (the manifest keeps the tunnel URL and ignores url changes from the toml)
  • Having automatically_update_urls_on_dev = false:
    • Verify that tunnel URLs are NOT included in the manifest, the manifest should include a copy of the urls value from the toml
    • Verify that modifying the URLs in the toml during dev, DO also update them in the manifest.
  1. Start dev without dev sessions
    • Verify that tunnel URLs are updated in the toml.

Measuring impact

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

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

@isaacroldan isaacroldan marked this pull request as ready for review January 21, 2025 13:17
@isaacroldan isaacroldan requested a review from a team as a code owner January 21, 2025 13:17
Copy link
Contributor

We detected some changes at packages/*/src 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.

@isaacroldan isaacroldan force-pushed the 01-21-patch_the_app_manifest_with_the_development_urls_add_tests branch from b965907 to 6f9b1e8 Compare January 21, 2025 16:35
@isaacroldan isaacroldan force-pushed the 01-21-stop_updating_the_app_urls_in_the_app_toml_when_using_the_app_management_api branch 2 times, most recently from 8a036b9 to 14732be Compare January 21, 2025 16:44
Copy link
Contributor

github-actions bot commented Jan 21, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.57% (-0.03% 🔻)
9053/11979
🟡 Branches
70.81% (-0.04% 🔻)
4423/6246
🟡 Functions
75.42% (+0.02% 🔼)
2378/3153
🟡 Lines
76.1% (-0% 🔻)
8550/11235
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app.ts
87.2% (-1.69% 🔻)
69.66% (-0.67% 🔻)
92.86% (-0.13% 🔻)
89.29% (-1.13% 🔻)
🟢
... / extension-instance.ts
84.66% (-0.34% 🔻)
82.05% (-0.56% 🔻)
92.31% (+0.15% 🔼)
85.23% (+0.2% 🔼)
🟢
... / app_config_app_home.ts
100%
50% (-50% 🔻)
100% 100%
🟢
... / app_config_app_proxy.ts
100%
75% (-25% 🔻)
100% 100%
🔴
... / dev.ts
19.38% (-0.15% 🔻)
14.93% (-0.46% 🔻)
24.39%
20% (-0.17% 🔻)
🟢
... / app-event-watcher.ts
95.18% (-1.2% 🔻)
86.49% (-2.7% 🔻)
95.45% 100%

Test suite run success

2045 tests passing in 913 suites.

Report generated by 🧪jest coverage report action from e75e2d6

@isaacroldan isaacroldan force-pushed the 01-21-patch_the_app_manifest_with_the_development_urls_add_tests branch from 1662daa to 3eae494 Compare January 24, 2025 10:15
@isaacroldan isaacroldan force-pushed the 01-21-stop_updating_the_app_urls_in_the_app_toml_when_using_the_app_management_api branch from 14732be to 5dfd581 Compare January 24, 2025 10:15
@isaacroldan isaacroldan force-pushed the 01-21-patch_the_app_manifest_with_the_development_urls_add_tests branch from 3eae494 to 1e1b0eb Compare January 28, 2025 15:01
@isaacroldan isaacroldan force-pushed the 01-21-stop_updating_the_app_urls_in_the_app_toml_when_using_the_app_management_api branch from 5dfd581 to d403209 Compare January 28, 2025 15:02
@craigmichaelmartin
Copy link
Contributor

/snapit

Copy link
Contributor

🫰✨ Thanks @craigmichaelmartin! Your snapshot has been published to npm.

Test the snapshot by intalling your package globally:

pnpm i -g @shopify/[email protected]

After installing, validate the version by running just shopify in your terminal
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

Base automatically changed from 01-21-patch_the_app_manifest_with_the_development_urls_add_tests to main February 4, 2025 12:55
@isaacroldan isaacroldan force-pushed the 01-21-stop_updating_the_app_urls_in_the_app_toml_when_using_the_app_management_api branch 3 times, most recently from 924baa2 to 343f9cf Compare February 4, 2025 16:29
Copy link
Contributor Author

@craigmichaelmartin I've fixed the issue you found while tophatting, and in fact I refactored this PR to use a different approach. Safer and more organized (each module has a function to be patched now)

@isaacroldan isaacroldan force-pushed the 01-21-stop_updating_the_app_urls_in_the_app_toml_when_using_the_app_management_api branch from 343f9cf to e75e2d6 Compare February 7, 2025 17:18
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.

2 participants