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

Create app with latest api version #5188

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

jamieguerrero
Copy link
Contributor

@jamieguerrero jamieguerrero commented Jan 13, 2025

WHY are these changes introduced?

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

Creating an app with USE_APP_MANAGEMENT_API=1 shopify app init and then deploying the app fails because the default webhooks that come in the template require the 2025-01 webhooks api version.

Screenshot 2025-01-13 at 11 09 04 AM

This PR queries for the latest Webhook API Version before creating an app.

shopify(dev)> CoreApiVersioning.non_private_app_schedule.accessible_versions.map(&:handle)
=> ["2024-01", "2024-04", "2024-07", "2024-10", "2025-01", "2025-04", "unstable"]
Screenshot 2025-01-13 at 11 10 40 AM

To tophat:

  • Use the App Management API export USE_APP_MANAGEMENT_API=1
  • Create an app with shopify app init
  • Notice in the template the web api version is latest. Should be 2025-04 as of today.
  • Attempt to deploy with shopify app deploy

Checklist

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

@jamieguerrero jamieguerrero marked this pull request as ready for review January 13, 2025 16:10
@jamieguerrero jamieguerrero requested a review from a team as a code owner January 13, 2025 16:10
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.

Copy link
Contributor

github-actions bot commented Jan 13, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.21% (+0.17% 🔼)
8877/11803
🟡 Branches
70.45% (+0.33% 🔼)
4320/6132
🟡 Functions
75.14% (+0.17% 🔼)
2321/3089
🟡 Lines
75.78% (+0.2% 🔼)
8393/11075
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% 🔻)
🟢
... / 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% 🔻)
🔴
... / partners-client.ts
26.28% (-0.53% 🔻)
37.5% 17.86%
25.76% (-0.56% 🔻)

Test suite run success

2004 tests passing in 905 suites.

Report generated by 🧪jest coverage report action from 49ef624

Copy link
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

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

Is it possible to add a test that the API version is set from the API by default in CreatAppVars?

@jamieguerrero jamieguerrero force-pushed the jg/create-app-with-latest-api-version branch from b6c63c7 to 23f410f Compare January 13, 2025 18:37
Copy link
Contributor Author

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

@jamieguerrero jamieguerrero force-pushed the jg/create-app-with-latest-api-version branch from 23f410f to 49ef624 Compare January 13, 2025 20:16
Copy link
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

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

Thanks for adding tests!

@jamieguerrero jamieguerrero added this pull request to the merge queue Jan 13, 2025
Merged via the queue into main with commit 9a836cc Jan 13, 2025
28 checks passed
@jamieguerrero jamieguerrero deleted the jg/create-app-with-latest-api-version branch January 13, 2025 21:08
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