Repository navigation
Add typed JSON output to app import dashboard-extensions - #8819
isaacroldan wants to merge 6 commits into
Conversation
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007120950Caution After installing, validate the version by running |
edc35b3 to
396595c
Compare
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007133911Caution After installing, validate the version by running |
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007140409Caution After installing, validate the version by running |
d2387c9 to
ccf8f51
Compare
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261009084827Caution After installing, validate the version by running |
dmerand
left a comment
There was a problem hiding this comment.
Small note from the LLM, otherwise changes LGTM.
| identifiersUpdated: false, | ||
| }), | ||
| ) | ||
| if (cancelled) throw error |
There was a problem hiding this comment.
[P2] Flush the JSON result before the silent exit
This throw can cut off a large JSON result when stdout is a slow pipe. ExtensionImportCancelledError extends AbortSilentError. The shared error handler returns without flushStdout(), then Oclif calls process.exit(1). The partial path at line 148 has the same problem.
I reproduced both paths with the exact-head compiled launcher, real import service, result writer, TOML conversion, and local files. App/auth context, dashboard transport, picker answers, and telemetry were simulated; no live import was run. With 250 completed imports and a reader that starts after two seconds (... --json | { sleep 2; cat; }), cancellation and identifier-write failure each returned only 65,536 bytes. Both results failed JSON.parse, although all 250 TOML files existed. Success and fatal controls through the same pipe returned complete JSON documents. An independent repeat gave the same failures.
Please await flushStdout() after the result write and before either silent throw. Keep the intended exit code 1. The defect is the incomplete result, not the cancellation exit code.
WHY are these changes introduced?
Give scripts a typed dashboard-extension import result. Related to #23958.
WHAT is this pull request doing?
Add
--jsonwith absolute artifact paths and skipped, cancelled, or partial outcomes. Wait for started imports before final JSON, keep completed work when another import fails, and preserve text and identifier writes. Picker Cancel retains exit 1; a sibling failure producespartial.Text:
Imported the following extensions from the dashboard: • "Example action" at: extensions/example-action.JSON:
{"status":"success","reason":null,"extensions":[{"id":"e7282f2d-3017-4608-a9a4-54dd5a7a70aa","name":"Example action","type":"flow_action_definition","directory":"/tmp/app/extensions/example-action","configurationPath":"/tmp/app/extensions/example-action/shopify.extension.toml","changed":true}],"errors":[],"identifiersUpdated":true}.How to manually test your changes?
Use a linked test app with a dashboard-managed Flow extension. Use a fresh copy for each check so saved UUIDs do not exclude the extension.
shopify app import dashboard-extensions --path <app> --json > imports.jsonand select the extension. Check one success result, its absolute TOML path, and the UUID in.env.changed: false; Cancel returns one cancelled result and exit 1.--jsonin another copy to compare text. Runshopify app import dashboard-extensions --json-schemato inspect the contract.Checklist