Skip to content

fix(rest/python): return ready_for_complete only when fulfillment is selected - #254

Merged
damaz91 merged 2 commits into
Universal-Commerce-Protocol:mainfrom
aksharprabhudesai:fix/python-ready-for-complete
Oct 16, 2026
Merged

damaz91 merged 2 commits into
Universal-Commerce-Protocol:mainfrom
aksharprabhudesai:fix/python-ready-for-complete

Conversation

@aksharprabhudesai

Copy link
Copy Markdown
Contributor

Category (Required)

  • Core Protocol: Changes to the base communication layer, global context, or breaking refactors. (Requires Technical Council approval)
  • Governance/Contributing: Updates to GOVERNANCE.md, CONTRIBUTING.md, or CODEOWNERS. (Requires Governance Council approval)
  • Capability: New schemas (Discovery, Cart, etc.) or extensions. (Requires Maintainer approval)
  • Documentation: Updates to README, or documentations regarding schema or capabilities. (Requires Maintainer approval)
  • Infrastructure: CI/CD, Linters, or build scripts. (Requires DevOps Maintainer approval)
  • Maintenance: Version bumps, lockfile updates, or minor bug fixes. (Requires DevOps Maintainer approval)
  • SDK: Language-specific SDK updates and releases. (Requires DevOps Maintainer approval)
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: Changes to the ucp-schema tool (resolver, linter, validator). (Requires Maintainer approval)
  • Community Health (.github): Updates to templates, workflows, or org-level configs. (Requires DevOps Maintainer approval)

Description

The Python REST sample server was unconditionally setting checkout.status = CheckoutStatus.READY_FOR_COMPLETE at creation, even without buyer or fulfillment selection, but would reject complete_checkout with 400 until fulfillment address and option were selected (as noted in Universal-Commerce-Protocol/ucp#949).

This aligns the status assignment with the completion gate:

  • Extracts fulfillment selection validation into _has_fulfillment_selection
  • Sets ready_for_complete on create/update only when fulfillment requirements are satisfied; otherwise leaves status as incomplete
  • Updates README example responses that lacked fulfillment to show incomplete
  • Adds test_checkout_readiness_lifecycle covering the state transition from create (incomplete) -> update with fulfillment (ready_for_complete) -> complete (completed)

@google-cla

google-cla Bot commented Oct 14, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@aksharprabhudesai
aksharprabhudesai force-pushed the fix/python-ready-for-complete branch from 4e87501 to c4e1fba Compare October 14, 2026 08:18
@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Oct 14, 2026
@damaz91
damaz91 merged commit 3bec35a into Universal-Commerce-Protocol:main Oct 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants