[Bulk Operations CLI] show live progress updates when `--watch` is provided
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
GetBulkOperationByIdto fetch the status and details of a bulk operation - Adds a
--watchflag to theapp executecommand 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
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 } } } }"
- #6595
: 2 dependent PRs (#6655
, #6656
) π (View in Graphite) - #6588
: 1 other dependent PR (#6596
) main
This stack of pull requests is managed by Graphite. Learn more about stacking.
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
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.
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
mainyou might see odd diffs, rebasemaininto 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
Everything looks good to me! Great tophatting video btw :+1:
/snapit
π«°β¨ 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
shopifyin your terminal. If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.