Skip to content

Conversation

@shauns
Copy link
Contributor

@shauns shauns commented Nov 24, 2025

WHY are these changes introduced?

Adds shopify app import-custom-data-definitions, a command to automatically convert existing metafields and metaobjects to declarative TOML.

WHAT is this pull request doing?

Exposes the service from the downstack PR. The command uses the dev store, so this follows the same patterns as app dev.

How to test your changes?

Run shopify app import-custom-data-definitions on an app that has some app-reserved definitions in its dev store. If you want to make one via GraphQL, this example is good.

The command has an --include-existingoption. If this is set, definitions already in the TOML will be included too. That's a very fast way of testing/iterating.

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

Copy link
Contributor Author

shauns commented Nov 24, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@shauns shauns marked this pull request as ready for review November 24, 2025 10:38
@shauns shauns requested review from a team as code owners November 24, 2025 10:38
@shauns shauns force-pushed the shauns/11-24-shopify_app_data_import-definitions branch from 240c3d5 to 37bd585 Compare November 24, 2025 10:40
@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
79.35% (+0.23% 🔼)
14073/17735
🟡 Branches
73.43% (+0.18% 🔼)
6894/9389
🟡 Functions
79.58% (+0.32% 🔼)
3620/4549
🟡 Lines
79.72% (+0.24% 🔼)
13304/16689
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / get-bulk-operation-by-id.ts
100% 100% 100% 100%
🟢
... / list-bulk-operations.ts
100% 100% 100% 100%
🔴
... / import-custom-data-definitions.ts
0% 100% 0% 0%
🔴
... / execute.ts
0% 0% 0% 0%
🔴
... / status.ts
0% 0% 0% 0%
🔴
... / pull.ts
0% 100% 0% 0%
🔴
... / pull.ts
0% 0% 0% 0%
🟢
... / bulk-operation-status.ts
96% 90.63% 100% 100%
🟢
... / download-bulk-operation-results.ts
100% 100% 100% 100%
🟢
... / format-bulk-operation-status.ts
100% 100% 100% 100%
🟢
... / watch-bulk-operation.ts
100% 100% 100% 100%
🔴
... / promiseWithResolvers.ts
33.33% 50% 50% 33.33%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / extension-instance.ts
84.8% (+0.23% 🔼)
77.6% (-0.91% 🔻)
92.06% (+0.13% 🔼)
85.11% (+0.24% 🔼)
🟡
... / specification.ts
69.09%
75.61% (+2.44% 🔼)
76.47% (-1.31% 🔻)
68.75%
🟢
... / ui_extension.ts
85.38% (-9.44% 🔻)
72.34% (-8.91% 🔻)
84% (-16% 🔻)
88% (-8.46% 🔻)
🟢
... / execute-bulk-operation.ts
91.94% (-3.3% 🔻)
84.21% (-1.5% 🔻)
100%
93.22% (-1.78% 🔻)
🟡
... / stage-file.ts
72.73% (-1.56% 🔻)
62.5% (+9.17% 🔼)
83.33% (-2.38% 🔻)
71.88% (-1.65% 🔻)
🟢
... / api.ts
87.07% (-0.43% 🔻)
76.71% (-0.1% 🔻)
100%
86.49% (-0.43% 🔻)
🟢
... / SingleTask.tsx
84.21% (-15.79% 🔻)
50% (-50% 🔻)
80% (-20% 🔻)
84.21% (-15.79% 🔻)
🔴
... / environment.ts
41.67% (+1.67% 🔼)
42.86% (-4.51% 🔻)
50%
43.48% (+1.37% 🔼)
🟢
... / liquid.ts
94.29%
81.25% (-6.25% 🔻)
100% 94.12%
🟢
... / console.ts
81.82% (+15.15% 🔼)
75% (-25% 🔻)
100% (+33.33% 🔼)
81.82% (+15.15% 🔼)
🔴
... / dev.ts
14.29% (+0.95% 🔼)
3.13% (+0.18% 🔼)
50% (-7.14% 🔻)
14.29% (+0.95% 🔼)
🟢
... / init.ts
88% (-0.89% 🔻)
71.43% (+4.76% 🔼)
86.67% (+4.85% 🔼)
88% (-0.89% 🔻)
🟡
... / theme-polling.ts
67.12% (-0.93% 🔻)
68.75% 78.57%
66.67% (-0.98% 🔻)

Test suite run success

3489 tests passing in 1402 suites.

Report generated by 🧪jest coverage report action from ee3bfb6

@gonzaloriestra
Copy link
Contributor

/snapit

@github-actions
Copy link
Contributor

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

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20251126113029

Caution

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.

Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

The code LGTM and it works as expected, but I have some suggestions:

  • The command is too slow because of the iteration through all the product types and the delays. Some ideas to make it faster:
    • Get rid of the sleeps or reduce them
    • Reduce the number of queries by skipping types with no access
    • Run them concurrently
    • Add a new API endpoint to fetch all of them in batch
  • Why not updating the TOML directly instead of printing the changes? Most devs will have Git to check the changes. And we could add a --dry-run flag to only print.

@shauns shauns force-pushed the shauns/11-24-shopify_app_data_import-definitions branch from 37bd585 to f0a920f Compare December 4, 2025 16:10
@shauns shauns force-pushed the shauns/dcdd-import-service branch from bd265d7 to ac99e52 Compare December 5, 2025 09:31
@shauns shauns force-pushed the shauns/11-24-shopify_app_data_import-definitions branch from f0a920f to 1a20071 Compare December 5, 2025 09:31
@shauns shauns changed the title shopify app data import-definitions shopify app import-custom-data-definitions Dec 5, 2025
@shauns shauns force-pushed the shauns/11-24-shopify_app_data_import-definitions branch from 1a20071 to ee3bfb6 Compare December 5, 2025 10:28
@shauns shauns force-pushed the shauns/dcdd-import-service branch from ac99e52 to ae8cbbd Compare December 5, 2025 10:28
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/http.d.ts
@@ -18,7 +18,7 @@ type AutomaticCancellationBehaviour = {
 } | {
     useAbortSignal: AbortSignal | (() => AbortSignal);
 };
-type RequestBehaviour = NetworkRetryBehaviour & AutomaticCancellationBehaviour;
+export type RequestBehaviour = NetworkRetryBehaviour & AutomaticCancellationBehaviour;
 export type RequestModeInput = PresetFetchBehaviour | RequestBehaviour;
 /**
  * Specify the behaviour of a network request.
packages/cli-kit/dist/public/node/api/graphql.d.ts
@@ -47,6 +47,7 @@ export type GraphQLRequestDocOptions<TResult, TVariables> = GraphQLRequestBaseOp
     }>>;
     variables?: TVariables;
     unauthorizedHandler?: UnauthorizedHandler;
+    autoRateLimitRestore?: boolean;
 };
 export interface GraphQLResponseOptions<T> {
     handleErrors?: boolean;

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