Skip to content

Normalize subscription migration cancellation JSON - #8541

Merged
gonzaloriestra merged 9 commits into
mainfrom
donald/subscription-migrations-cancel-json-schema
Oct 9, 2026
Merged

gonzaloriestra merged 9 commits into
mainfrom
donald/subscription-migrations-cancel-json-schema

Conversation

@dmerand

@dmerand dmerand commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

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 outcomes with operations, use operationGid/gid/shopGid, flatten per-shop results, and place fieldPath diagnostics in item errors. Failed single cancellations use the fatal error envelope, and batch requests retain every outcome when another request fails. Remove schemaVersion; 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?

shopify app subscription-migrations cancel --id <operation-gid> --json
shopify app subscription-migrations cancel --json-schema

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing and includes a major changeset

@github-actions github-actions Bot added the Area: @shopify/app @shopify/app package issues label Sep 14, 2026
@gonzaloriestra

Copy link
Copy Markdown
Contributor

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ 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-20260915114653

Caution

After installing, validate the version by running shopify version 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.

Base automatically changed from gonzalo/json-schema-flag to gonzalo/json-support-by-default September 16, 2026 11:13
@gonzaloriestra
gonzaloriestra force-pushed the donald/subscription-migrations-cancel-json-schema branch from 17cc3a4 to ec5bcbb Compare September 16, 2026 11:20
@gonzaloriestra
gonzaloriestra changed the base branch from gonzalo/json-support-by-default to main September 16, 2026 11:20
@github-actions github-actions Bot added Area: @shopify/cli @shopify/cli package issues and removed Area: @shopify/app @shopify/app package issues labels Sep 16, 2026
Comment thread .changeset/clever-cancellations.md Outdated
Comment thread packages/app/src/cli/services/subscription-migrations/cancel-operations.ts Outdated
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Sep 17, 2026
@gonzaloriestra
gonzaloriestra added this pull request to stack #8590 September 18, 2026 12:23
@gonzaloriestra
gonzaloriestra force-pushed the donald/subscription-migrations-cancel-json-schema branch 3 times, most recently from c57291a to 85e8086 Compare September 24, 2026 10:41
@gonzaloriestra
gonzaloriestra marked this pull request as ready for review September 24, 2026 10:46
@gonzaloriestra
gonzaloriestra requested review from a team as code owners September 24, 2026 10:46
@gonzaloriestra gonzaloriestra changed the title Add JSON Schema for subscription migration cancellation Normalize subscription migration cancellation JSON Oct 6, 2026
@gonzaloriestra
gonzaloriestra marked this pull request as draft October 6, 2026 12:00
@gonzaloriestra
gonzaloriestra force-pushed the donald/subscription-migrations-cancel-json-schema branch from 85e8086 to 1fad179 Compare October 6, 2026 12:05
@github-actions github-actions Bot added Area: @shopify/cli @shopify/cli package issues and removed no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. labels Oct 6, 2026
@gonzaloriestra
gonzaloriestra force-pushed the donald/subscription-migrations-cancel-json-schema branch from 1fad179 to 460570a Compare October 6, 2026 12:26
@gonzaloriestra
gonzaloriestra marked this pull request as ready for review October 8, 2026 08:57

@isaacroldan isaacroldan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One issue with cancellation batch output.


🤖 Generated by the review-pr skill

Comment thread packages/app/src/cli/services/subscription-migrations/types.ts
Comment thread packages/app/src/cli/services/subscription-migrations/types.ts
Copilot AI balanced review requested due to automatic review settings October 8, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 schemaVersion from 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.

Comment thread packages/app/src/cli/services/subscription-migrations/cancel-operations.ts Outdated
@gonzaloriestra
gonzaloriestra force-pushed the donald/subscription-migrations-cancel-json-schema branch from 5b74237 to 57663c1 Compare October 9, 2026 07:45
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ Potential Breaking Changes Detected

This PR contains changes that may break the existing contract.

@shopify/dev_experience — this PR contains breaking changes that require coordination for the next major release.

📦 Major Version Changesets

The following changesets request a major version bump:

Changeset Package
normalize-subscription-migration-json.md "@shopify/cli": major

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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

packages/cli-kit/dist/public/node/error/serialization.d.ts
import 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 declarations

packages/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

@gonzaloriestra
gonzaloriestra added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit 83b71f1 Oct 9, 2026
29 of 30 checks passed
@gonzaloriestra
gonzaloriestra deleted the donald/subscription-migrations-cancel-json-schema branch October 9, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants