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

Hide all banners that tell you to change app URL #5172

Merged

Conversation

jamieguerrero
Copy link
Contributor

@jamieguerrero jamieguerrero commented Jan 8, 2025

WHAT is this pull request doing?

Fixes https://github.com/Shopify/develop-app-inner-loop/issues/2348

Removes this app url change banner since it is no longer needed by Developer Dashboard apps or apps using consistent dev
Screenshot 2025-01-08 at 2 45 41 PM

Additionally, isCurrentAppSchema is always true now, so we remove some of the mentions of it from the files we are touching.

How to test your changes?

From within the CLI folder:

Try not using the App Management API first and confirm partners dashboard app url update banner doesn't show

  • Create an app p shopify app init
  • Choose a remix app
  • p shopify app dev --path ./name-of-your-app --reset
  • You should not see the app url banner saying you can change App URL on Partners.

Now try using the App Management API and confirm partners dashboard app url update banner doesn't show

  • USE_APP_MANAGEMENT_API=1 p shopify app dev --path ./name-of-your-app --reset
    • This flag makes the CLI use the App Management API
    • We are attempting to dev but with reset flag so you can choose the option 'create as new app' from dropdown
    • Choose creating a new app, and put it a new app name and create a new TOML file
    • Screenshot 2025-01-08 at 2 45 12 PM
    • You still shouldn't see any banner

Confirm that the app config push banner is gone:

  • Confirm that in TOML you do not have automatically_update_urls_on_dev defined
    -USE_APP_MANAGEMENT_API=1 p shopify app dev --path ./name-of-your-app
  • When asked to update App URL's select no, never:
?  Have Shopify automatically update your app's URL in order to create a preview experience?
✔  No, never
  • You should not see this banner
Screenshot 2025-01-13 at 3 57 13 PM

Checklist

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

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.12% (+0% 🔼)
8855/11788
🟡 Branches
70.3% (+0.02% 🔼)
4300/6117
🟡 Functions
75.05% (+0.01% 🔼)
2316/3086
🟡 Lines
75.69% (+0.02% 🔼)
8371/11060
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app.ts
85.92% (-0.29% 🔻)
69.62%
91.67% (-0.33% 🔻)
87.8% (-0.2% 🔻)
🟢
... / extension-instance.ts
84.28% (-0.1% 🔻)
80% 92.16%
84.93% (-0.1% 🔻)
🟡
... / context.ts
70.75% (-0.54% 🔻)
62.07% (+0.4% 🔼)
73.91%
73.33% (-0.58% 🔻)
🟡
... / ui.tsx
70.59% (-11.55% 🔻)
60% (-12.22% 🔻)
100%
73.33% (-11.28% 🔻)
🟢
... / urls.ts
82.57%
77.5% (-0.81% 🔻)
75% 84.47%
🟢
... / app-diffing.ts
100%
85.71% (-3.17% 🔻)
100% 100%
🟢
... / app-event-watcher.ts
93.83% (-1.23% 🔻)
86.49% (-2.7% 🔻)
90.48% 98.61%
🟡
... / build.ts
76.36% (-2.15% 🔻)
61.36% (-3.22% 🔻)
77.14% (-1.24% 🔻)
74.51% (-2.48% 🔻)
🔴
... / app-management-client.ts
29.52% (-3.93% 🔻)
16.83% (-9.38% 🔻)
31.25% (-2.77% 🔻)
28.4% (-4.28% 🔻)
🔴
... / partners-client.ts
26.28% (-0.53% 🔻)
37.5% 17.86%
25.76% (-0.56% 🔻)
🟢
... / ConcurrentOutput.tsx
98.36% (-1.64% 🔻)
88% (-4% 🔻)
100%
98.33% (-1.67% 🔻)

Test suite run success

1996 tests passing in 902 suites.

Report generated by 🧪jest coverage report action from a622479

@jamieguerrero jamieguerrero marked this pull request as ready for review January 8, 2025 19:52
@jamieguerrero jamieguerrero requested a review from a team as a code owner January 8, 2025 19:52

This comment has been minimized.

@jamieguerrero jamieguerrero force-pushed the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch from 1207bd4 to cdee477 Compare January 8, 2025 19:57
@jamieguerrero jamieguerrero requested a review from a team as a code owner January 8, 2025 19:57
Copy link
Contributor

@MitchDickinson MitchDickinson left a comment

Choose a reason for hiding this comment

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

LGTM but I was not able to tophat. When I follow the testing script for partners I never see the message. Here's my output

cli git:(jg/hide-partners-banner-app-url-when-using-appmgmtapi) p shopify app init --path=/Users/mitch/test-apps/
Note that p is an alias for pnpm activated by shadowenv in the CLI repository

> @0.0.0 shopify /Users/mitch/src/github.com/Shopify/cli
> nx build cli && node packages/cli/bin/dev.js "app" "init" "--path=/Users/mitch/test-apps/"

Debugger attached.

   ✔  10/10 dependent project tasks succeeded [10 read from cache]

   Hint: you can run the command with --verbose to see the full dependent project outputs

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————


> nx run cli:build  [existing outputs match the cache, left as is]

> pnpm tsc -b ./tsconfig.build.json

Debugger attached.
Waiting for the debugger to disconnect...

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Successfully ran target build for project cli and 10 tasks it depends on (273ms)

Nx read the output from the cache instead of running the command for 11 out of 11 tasks.

Waiting for the debugger to disconnect...
Debugger attached.

To run this command, log in to Shopify.
User verification code: LVKJ-ZTQK
👉 Press any key to open the login page on your browser
Opened link to start the auth process: https://accounts.shopify.com/activate-with-code?device_code%5Buser_code%5D=LVKJ-ZTQK
✔ Logged in.
?  Get started building your app:
✔  Build an extension-only app

?  Which organization is this work for?
✔  Mitch Dickinson Partner Biz

?  Create this project as a new app on Shopify?
✔  Yes, create it as a new app

?  App name:
✔  jan9-test

╭─ info ───────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Initializing project with `pnpm`                                            │
│  Use the `--package-manager` flag to select a different package manager.     │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯


╭─ success ────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  jan9-test is ready for you to build!                                        │
│                                                                              │
│  Next steps                                                                  │
│    • Run `cd jan9-test`                                                      │
│    • For extensions, run `shopify app generate extension`                    │
│    • To see your app, run `shopify app dev`                                  │
│                                                                              │
│  Reference                                                                   │
│    • Shopify docs                                                            │
│    • For an overview of commands, run `shopify app --help`                   │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

Waiting for the debugger to disconnect...
➜  cli git:(jg/hide-partners-banner-app-url-when-using-appmgmtapi) p shopify app dev --path=/Users/mitch/test-apps/jan9-test --reset
Note that p is an alias for pnpm activated by shadowenv in the CLI repository

> @0.0.0 shopify /Users/mitch/src/github.com/Shopify/cli
> nx build cli && node packages/cli/bin/dev.js "app" "dev" "--path=/Users/mitch/test-apps/jan9-test" "--reset"

Debugger attached.

   ✔  10/10 dependent project tasks succeeded [10 read from cache]

   Hint: you can run the command with --verbose to see the full dependent project outputs

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————


> nx run cli:build  [existing outputs match the cache, left as is]

> pnpm tsc -b ./tsconfig.build.json

Debugger attached.
Waiting for the debugger to disconnect...

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Successfully ran target build for project cli and 10 tasks it depends on (282ms)

Nx read the output from the cache instead of running the command for 11 out of 11 tasks.

Waiting for the debugger to disconnect...
Debugger attached.
?  Which organization is this work for?
✔  Mitch Dickinson Partner Biz

?  Create this project as a new app on Shopify?
✔  No, connect it to an existing app

?  Which existing app is this for?
✔  jan9-test (shopify.app.toml)

╭─ success ────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  shopify.app.toml is now linked to "jan9-test" on Shopify                    │
│                                                                              │
│  Using shopify.app.toml as your default config.                              │
│                                                                              │
│  Next steps                                                                  │
│    • Make updates to shopify.app.toml in your local project                  │
│    • To upload your config, run `shopify app deploy`                         │
│                                                                              │
│  Reference                                                                   │
│    • App configuration                                                       │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

?  Which store would you like to use to view your project?
✔  mitch-dev-store

╭─ info ───────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Using shopify.app.toml for default values:                                  │
│                                                                              │
│    • Org:             Mitch Dickinson Partner Biz                            │
│    • App:             jan9-test                                              │
│    • Dev store:       mitch-dev-store.myshopify.com                          │
│    • Update URLs:     Not yet configured                                     │
│                                                                              │
│   You can pass  `--reset`  to your command to reset your app configuration.  │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

07:00:52 │    graphiql │ GraphiQL server started on port 3457

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

› Press g │ open GraphiQL (Admin API) in your browser
› Press p │ preview in your browser
› Press q │ quit

Preview URL:
https://mitch-dev-store.myshopify.com/admin/oauth/redirect_from_cli?client_id=5d4505f3c23f26aa67009ad78688c3ca
GraphiQL URL: http://localhost:3457/graphiql

@amcaplan
Copy link
Contributor

amcaplan commented Jan 9, 2025

I'm actually getting the same result! I suspect the newApp boolean isn't completely reliable, but I'm not sure why it's not getting set correctly.

@jamieguerrero
Copy link
Contributor Author

@amcaplan @MitchDickinson can you try again but making sure you select to create a new app?

?  Which existing app is this for?
✔  jan9-test (shopify.app.toml)

Here you should choose this option:

Screenshot 2025-01-09 at 3 55 01 PM

@MitchDickinson
Copy link
Contributor

Still not working for me: https://share.descript.com/view/FbFodrR8Rjg

@jamieguerrero
Copy link
Contributor Author

Still not working for me: https://share.descript.com/view/FbFodrR8Rjg

Okay, last requirement you must pick a Remix app template. I'd imagine an extension-only app doesn't need an App URL so they don't show the banner or set the newApp variable. For extension only app your App URL is always https://shopify.dev/docs/apps/build/cli-for-apps/app-configuration

Copy link
Contributor

amcaplan commented Jan 9, 2025

Ah, that makes sense! I created a new app but forgot it has to be the Remix template!

Copy link
Contributor

amcaplan commented Jan 9, 2025

Honestly, I wonder if we should just get rid of this warning entirely. Now that shopify app init creates an app, you don't create an app the first time you run dev in most cases. So this warning will only appear when you do a reset. It's just not really particularly effective anymore, and it's not worth fixing if App Management and consistent dev are the way forward...

Copy link
Contributor

@amcaplan amcaplan left a comment

Choose a reason for hiding this comment

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

Approving as this works. Added a couple comments, and I think the most important bit is that maybe we don't need this warning at all?

.changeset/cyan-poets-exist.md Outdated Show resolved Hide resolved
@jamieguerrero jamieguerrero force-pushed the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch from cdee477 to 1547704 Compare January 10, 2025 16:49
@jamieguerrero
Copy link
Contributor Author

I removed the warning altogether since I think that was Isaac's ultimate suggestion.

@jamieguerrero jamieguerrero force-pushed the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch from 4411167 to 0b7a1f3 Compare January 10, 2025 17:41
Copy link
Contributor

@amcaplan amcaplan left a comment

Choose a reason for hiding this comment

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

Perfect! Deleted code is best code 👍

@jamieguerrero jamieguerrero force-pushed the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch from 0b7a1f3 to 55fe914 Compare January 13, 2025 20:58
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

) {
const dashboardURL = await partnersURL(remoteApp.organizationId, remoteApp.id)
if (remoteApp.newApp) {
export async function outputUpdateURLsResult(updated: boolean, urls: PartnersURLs, localApp: AppInterface) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remoteApp is no longer needed to check since we are now only looking if users wanted us to update their TOML's app URLs for them during dev. If not, just let them know they can do it themselves with the tunneled URLs.

@jamieguerrero jamieguerrero force-pushed the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch 2 times, most recently from d777777 to a5eeda5 Compare January 13, 2025 21:45
@jamieguerrero jamieguerrero force-pushed the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch from a5eeda5 to 39ca8ca Compare January 14, 2025 17:02
@jamieguerrero jamieguerrero force-pushed the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch 3 times, most recently from 44d71fd to bcc170f Compare January 14, 2025 19:02
@jamieguerrero jamieguerrero changed the title Hide banner that tells you to change app URL in Partners dashboard when using App Management API Hide all banners that tell you to change app URL Jan 14, 2025
@jamieguerrero jamieguerrero force-pushed the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch from bcc170f to a622479 Compare January 14, 2025 19:13
@isaacroldan
Copy link
Contributor

Just to confirm, we are OK with not showing any message at all related to the URLs (whether they were updated or not) right?

@MitchDickinson
Copy link
Contributor

Just to confirm, we are OK with not showing any message at all related to the URLs (whether they were updated or not) right?

Do we need UX weigh in here?

@jamieguerrero
Copy link
Contributor Author

Just to confirm, we are OK with not showing any message at all related to the URLs (whether they were updated or not) right?

Do we need UX weigh in here?

Got @nickwesselman 's blessing here!

@jamieguerrero jamieguerrero added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit e2b829d Jan 16, 2025
28 checks passed
@jamieguerrero jamieguerrero deleted the jg/hide-partners-banner-app-url-when-using-appmgmtapi branch January 16, 2025 14:14
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.

4 participants