Repository navigation
Normalize subscription migration cancellation JSON - #8541
Conversation
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260915114653Caution After installing, validate the version by running |
17cc3a4 to
ec5bcbb
Compare
c57291a to
85e8086
Compare
85e8086 to
1fad179
Compare
1fad179 to
460570a
Compare
isaacroldan
left a comment
There was a problem hiding this comment.
One issue with cancellation batch output.
🤖 Generated by the review-pr skill
There was a problem hiding this comment.
🟡 Changes recommended
Batch exception handling loses shared error classifications and recovery guidance.
1 open finding
What changed in this PR
Normalizes subscription migration cancellation JSON and exposes its contract through the CLI’s shared schema support.
Changes:
- Adds normalized operation fields, flattened results, and structured cancellation errors.
- Retains batch outcomes and uses fatal errors for failed single cancellations.
- Removes
schemaVersionfrom migration outputs; updates tests, generated help, and the major changeset.
| File | Description |
|---|---|
| packages/eslint-plugin-cli/rules/json-output-command-exceptions.js | Removes cancellation’s schema exception. |
| packages/cli/README.md | Updates generated command documentation. |
| packages/cli/oclif.manifest.json | Refreshes generated help metadata. |
| packages/app/src/cli/services/subscription-migrations/types.ts | Defines cancellation schema and domain types. |
| packages/app/src/cli/services/subscription-migrations/result-codec.ts | Projects normalized operations and diagnostics. |
| packages/app/src/cli/services/subscription-migrations/list-output.ts | Removes list output’s schema version. |
| packages/app/src/cli/services/subscription-migrations/list-output.test.ts | Updates list serialization expectations. |
| packages/app/src/cli/services/subscription-migrations/command-output.ts | Removes operation output’s schema version. |
| packages/app/src/cli/services/subscription-migrations/command-output.test.ts | Updates operation output expectations. |
| packages/app/src/cli/services/subscription-migrations/cancel-operations.ts | Validates IDs and retains batch failures. |
| packages/app/src/cli/services/subscription-migrations/cancel-operations.test.ts | Covers validation and retained outcomes. |
| packages/app/src/cli/commands/app/subscription-migrations/result-presenter.ts | Makes single cancellation failures fatal. |
| packages/app/src/cli/commands/app/subscription-migrations/result-presenter.test.ts | Updates presentation coverage. |
| packages/app/src/cli/commands/app/subscription-migrations/result-presenter-output.test.ts | Checks JSON stdout behavior. |
| packages/app/src/cli/commands/app/subscription-migrations/result-codec.ts | Encodes normalized cancellation JSON. |
| packages/app/src/cli/commands/app/subscription-migrations/result-codec.test.ts | Tests serialization and schema validation. |
| packages/app/src/cli/commands/app/subscription-migrations/list.ts | Updates JSON help wording. |
| packages/app/src/cli/commands/app/subscription-migrations/list.integration.test.ts | Updates integration output expectations. |
| packages/app/src/cli/commands/app/subscription-migrations/commands.test.ts | Checks output and schema metadata. |
| packages/app/src/cli/commands/app/subscription-migrations/cancel.ts | Exposes the cancellation JSON schema. |
| .changeset/normalize-subscription-migration-json.md | Declares a major release change. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Assisted-By: devx/1e560c9c-f00c-48d7-8346-971b7fcfb30c
Assisted-By: devx/8b520d2e-bc34-4a3d-b5fa-748b2fff362e
5b74237 to
57663c1
Compare
|
| Changeset | Package |
|---|---|
normalize-subscription-migration-json.md |
"@shopify/cli": major |
Differences in type declarationsWe 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:
New type declarationspackages/cli-kit/dist/public/node/error/serialization.d.tsimport type { JsonError } from './types.js';
/**
* Projects an error into the shared JSON error contract, retaining only allowlisted fields.
*
* @param source - Error to project.
* @returns The error classification, message, and available recovery information.
*/
export declare function errorToJson(source: unknown): JsonError;
Existing type declarationspackages/cli-kit/dist/private/node/json-error.d.ts@@ -1,16 +1,3 @@
-interface FatalErrorLike {
- type?: number;
- message?: unknown;
- formattedMessage?: unknown;
- tryMessage?: unknown;
- nextSteps?: unknown;
- customSections?: unknown;
- stack?: unknown;
- command?: unknown;
- args?: unknown;
- details?: unknown;
- code?: unknown;
-}
/**
* Writes the public JSON representation of a fatal error to stdout.
*
@@ -19,5 +6,4 @@ interface FatalErrorLike {
*
* @param error - Fatal error to serialize.
*/
-export declare function renderFatalErrorAsJson(error: FatalErrorLike): void;
-export {};
\ No newline at end of file
+export declare function renderFatalErrorAsJson(error: unknown): void;
\ No newline at end of file
|

WHY are these changes introduced?
Subscription migration JSON must follow the shared CLI conventions and expose a discoverable contract.
WHAT is this pull request doing?
Replace
outcomeswithoperations, useoperationGid/gid/shopGid, flatten per-shop results, and placefieldPathdiagnostics in item errors. Failed single cancellations use the fatal error envelope, and batch requests retain every outcome when another request fails. RemoveschemaVersion; result contracts follow CLI release versions. Update the schema, tests, and generated help together. These existing JSON contract changes include a major changeset.How to manually test your changes?
Checklist