Skip to content

[Protocol] Adopt UCP 2026-08-25 across Checkout Kit - #765

Closed
adrian-augustyn wants to merge 1 commit into
Shopify:mainfrom
adrian-augustyn:ucp-2026-08-25
Closed

adrian-augustyn wants to merge 1 commit into
Shopify:mainfrom
adrian-augustyn:ucp-2026-08-25

Conversation

@adrian-augustyn

@adrian-augustyn adrian-augustyn commented Sep 14, 2026

Copy link
Copy Markdown

What changes are you making?

Checkout-web already understands UCP August when a client asks for it. Before this change, Checkout Kit still asked for April and used models generated from the April specification. This PR updates the Checkout Kit side: Web, Swift, and Android request 2026-08-25, and their generated models understand the August response.

The change also keeps focused support for older April messages that Checkout Kit may still encounter. This is compatibility when reading JSON from checkout-web; it does not mean that every application using the generated models will compile unchanged. This PR does not publish packages or change released dependency versions.

What changed?

  • UCP schemas and generated models: update the pinned UCP copy to August, include all schemas it references, and regenerate the TypeScript, Swift, and Kotlin models from the resulting 99 files.
  • Version sent to checkout-web: Web, Swift, and Android send exactly one ec_version=2026-08-25 in the checkout URL. Checkout Kit replaces older or duplicate values already present in that URL.
  • Stable generated APIs: prepare temporary schema copies before running quicktype, leaving the upstream UCP files untouched. These adjustments keep intentional names such as Measure, ConstraintExpression, and ConstraintProperty. They also ensure Swift and Kotlin retain business-specific JSON fields where the protocol allows them. Generation stops with a clear error if an upstream change invalidates any of these assumptions.
  • TypeScript generation: remove quicktype's internal rename-map declaration only after verifying that no generated declaration still refers to it.
  • Legacy descriptions: accept the older April string form of FulfillmentOption.description and convert it to the current Description object with plain set. Encoding that value again produces { "plain": "…" }; it does not recreate the old string form.

The separate public-event redesign in #748 is not part of this change.

Compatibility and public API impact

Compatibility tests run the same example April and August checkout messages through TypeScript, Swift, and Kotlin. Those examples decode successfully. This does not prove that every historical message works, or that code using the generated models will compile without changes.

  • August examples decode the new map_order, structured descriptions, business-location destinations, and new fulfillment values such as drone_delivery.
  • Example April checkout and error messages still decode. April destinations can omit the type field added in August, and old description strings become Description.plain.
  • When the protocol allows a business to add its own fields, those unknown JSON fields survive decoding and re-encoding. Extra keys inside UCP metadata have a narrower guarantee: TypeScript preserves them, while Swift and Kotlin accept them but may not write them back.
  • Fulfillment method types change from a fixed list to strings, allowing businesses to add values beyond shipping and pickup. Code that directly uses the old enum cases or exhaustive switches must change.
  • FulfillmentOption.description changes from a string to the structured Description type.
  • Generated Swift initializers and Kotlin/Java constructors, copy functions, and component functions change where August adds fields.
  • Payment-instrument constraints use the clearer generated names ConstraintExpression and ConstraintProperty.

These source changes affect code that directly constructs or inspects the generated protocol models. Applications using only higher-level Checkout Kit APIs may be unaffected.

Swift and Kotlin protocol API reports were regenerated and reviewed. The Android Checkout Kit API, other Swift module reports, React Native API report, published native SDK pointers, and release coordinates remain unchanged.

How was this tested?

Local verification for this change includes:

  • all 99 schema files match the pinned UCP commit;
  • TypeScript, Swift, and Kotlin generation passes, and running generation a second time produces no further changes;
  • TypeScript protocol tests pass (70/70), Kotlin protocol tests pass (50/50), and Web tests pass (247/247);
  • the April checkout, August checkout, and April error examples pass in TypeScript, Swift, and Kotlin;
  • Swift and Android tests, public API checks, and lint pass;
  • protocol and Web lint pass; and
  • git diff --check passes.

The all-in-one dev protocol check reaches its standalone macOS Swift test, compiles successfully, and then exits without diagnostics because of a local test-runner problem. The same Swift compatibility and package suites pass through the simulator-backed runner.

Where should reviewers focus?

  1. The temporary schema adjustments and safety checks in protocol/scripts/.
  2. The Swift and Kotlin public API changes, especially the move from fulfillment enums to strings and the changed generated signatures.
  3. The April/August examples and the specific older formats accepted for compatibility.
  4. The boundary between unknown fields preserved through re-encoding and unknown UCP metadata that native models may drop.

The 99 pinned schema files are an upstream import rather than hand-written Checkout Kit code. dev protocol check-upstream verifies that they exactly match the selected UCP commit.

Merge requirements

  • Required GitHub and Bitrise checks and code-owner approval.
  • A deployed checkout-web flow must confirm that Checkout Kit requests 2026-08-25; rendering through the April fallback is not sufficient evidence.

Package publication and release coordination happen separately from this PR.

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 14, 2026
Comment thread protocol/scripts/generate_models.mjs Outdated
Comment thread protocol/scripts/generate_models.mjs Outdated
Comment thread protocol/scripts/generate_models.mjs
Comment thread protocol/scripts/generate_models.mjs
Comment thread protocol/scripts/generate_models.mjs Outdated
Comment thread protocol/scripts/generate_swift_catalog.mjs
Comment thread protocol/languages/typescript/test/fixtures/checkout-2026-04-08.json Outdated
Comment thread protocol/languages/typescript/test/spec-metadata.test.ts
Comment thread protocol/languages/typescript/test/version-compatibility.test.ts
@adrian-augustyn
adrian-augustyn force-pushed the ucp-2026-08-25 branch 3 times, most recently from ce90809 to 3ac2bb0 Compare September 16, 2026 13:44
@adrian-augustyn
adrian-augustyn marked this pull request as ready for review September 18, 2026 13:06
@adrian-augustyn
adrian-augustyn requested a review from a team as a code owner September 18, 2026 13:06
Assisted-By: devx/9ecb7751-82f9-4062-885f-a23b95dfc4a7
@adrian-augustyn

Copy link
Copy Markdown
Author

Superseded by #794, which contains the same reviewed change on a Shopify-owned branch so the repository full CI can run. The replacement remains one commit and was rebased onto current main before opening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants