cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bulk Operations CLI] show live progress updates when `--watch` is provided

Open jordanverasamy opened this issue 1 month ago β€’ 4 comments

Issue: https://github.com/shop/issues-api-foundations/issues/1093

WHY are these changes introduced?

Let users to monitor the progress and completion of bulk operations directly from the CLI.

WHAT is this pull request doing?

  • Adds a new GraphQL query GetBulkOperationById to fetch the status and details of a bulk operation
  • Adds a --watch flag to the app execute command that polls and displays live progress

How to test your changes?

Verify that when --watch is provided, we see live updates printed to the terminal, then eventually a final screen when it finishes:

pnpm shopify app execute --path=<YOUR_TEST_APP> --query="{ products { edges { node { id } } } }" --watch
image image

Next, verify that when --watch is not provided, the execute command prints some info about the bulk operation and returns right away, just like before this PR:

pnpm shopify app execute --path=<YOUR_TEST_APP> --query="{ products { edges { node { id } } } }"
image

jordanverasamy avatar Nov 11 '25 00:11 jordanverasamy

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

jordanverasamy avatar Nov 11 '25 00:11 jordanverasamy

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
79.28% (+0.05% πŸ”Ό)
13718/17303
🟑 Branches
73.2% (+0.09% πŸ”Ό)
6697/9149
🟑 Functions
79.41% (+0.04% πŸ”Ό)
3529/4444
🟑 Lines
79.64% (+0.06% πŸ”Ό)
12963/16276
Show new covered files 🐣
St.:grey_question:
File Statements Branches Functions Lines
🟒
... / admin-as-app.ts
100% 100% 100% 100%
🟒
... / bulk-operation-run-mutation.ts
100% 100% 100% 100%
🟒
... / bulk-operation-run-query.ts
100% 100% 100% 100%
🟒
... / get-bulk-operation-by-id.ts
100% 100% 100% 100%
🟒
... / staged-uploads-create.ts
100% 100% 100% 100%
🟒
... / execute-bulk-operation.ts
97.92% 90.63% 100% 97.83%
🟒
... / format-bulk-operation-status.ts
100% 100% 100% 100%
🟒
... / run-mutation.ts
100% 100% 100% 100%
🟒
... / run-query.ts
100% 100% 100% 100%
🟑
... / stage-file.ts
72.73% 62.5% 83.33% 71.88%
🟒
... / watch-bulk-operation.ts
100% 100% 100% 100%
Show files with reduced coverage πŸ”»
St.:grey_question:
File Statements Branches Functions Lines
🟑
... / specification.ts
68.52% (-0.57% πŸ”»)
75.61% (+2.44% πŸ”Ό)
76.47% (-1.31% πŸ”»)
68.09% (-0.66% πŸ”»)
🟒
... / developer-platform-client.ts
84.62% (-1.5% πŸ”»)
73.68% (+3.1% πŸ”Ό)
81.82% (+1.82% πŸ”Ό)
90.63% (-2.71% πŸ”»)
🟒
... / api.ts
87.07% (-0.43% πŸ”»)
76.71% (-0.1% πŸ”»)
100%
86.49% (-0.43% πŸ”»)
🟒
... / ConcurrentOutput.tsx
98.36% (-1.64% πŸ”»)
92% (-4% πŸ”»)
100%
98.33% (-1.67% πŸ”»)
πŸ”΄
... / ui.tsx
50.82% (-0.79% πŸ”»)
42.86% (-5.53% πŸ”»)
54.55% (+1.42% πŸ”Ό)
50% (-0.82% πŸ”»)
🟒
... / console.ts
81.82% (+15.15% πŸ”Ό)
75% (-25% πŸ”»)
100% (+33.33% πŸ”Ό)
81.82% (+15.15% πŸ”Ό)
πŸ”΄
... / dev.ts
12.77% (-0.57% πŸ”»)
2.78% (-0.16% πŸ”»)
57.14%
12.77% (-0.57% πŸ”»)
🟑
... / theme-environment.ts
69.57% (-1.86% πŸ”»)
50%
55.56% (-3.27% πŸ”»)
69.57% (-1.86% πŸ”»)

Test suite run success

3402 tests passing in 1384 suites.

Report generated by πŸ§ͺjest coverage report action from 4c198525738c584ee6b3151172807dbfd3635943

github-actions[bot] avatar Nov 11 '25 00:11 github-actions[bot]

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.

[!CAUTION] DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

github-actions[bot] avatar Nov 11 '25 00:11 github-actions[bot]

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/ink.d.ts
@@ -1 +1 @@
-export { Box, Text, Static, useInput, useStdin, useStdout, measureElement } from 'ink';
\ No newline at end of file
+export { Box, Text, Static, useInput, useStdin, useStdout, measureElement, useApp } from 'ink';
\ No newline at end of file

github-actions[bot] avatar Nov 14 '25 23:11 github-actions[bot]

Everything looks good to me! Great tophatting video btw :+1:

ericlee878 avatar Nov 22 '25 06:11 ericlee878

/snapit

gonzaloriestra avatar Nov 26 '25 09:11 gonzaloriestra

🫰✨ 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/[email protected]

[!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.

github-actions[bot] avatar Nov 26 '25 09:11 github-actions[bot]