Skip to content

fix: resolve order endpoint from discovered UCP profile#47

Merged
carolinerg1 merged 2 commits into
Universal-Commerce-Protocol:mainfrom
ShuoRen-TT:codex/fix-order-endpoint-resolution
Jul 8, 2026
Merged

fix: resolve order endpoint from discovered UCP profile#47
carolinerg1 merged 2 commits into
Universal-Commerce-Protocol:mainfrom
ShuoRen-TT:codex/fix-order-endpoint-resolution

Conversation

@ShuoRen-TT

Copy link
Copy Markdown
Contributor

Summary

Fixes #42.

Order conformance tests now resolve /orders/{id} through the discovered UCP shopping service endpoint instead of calling the test server base URL directly.

What changed

  • Added IntegrationTestBase.get_order_url(order_id) as the order-resource equivalent of get_shopping_url(...).
  • Updated order_test.py GET and PUT calls for /orders/{id} to use the discovered shopping service endpoint.

Why

The shopping REST spec says operation paths are relative to the merchant-provided endpoint from /.well-known/ucp under services["dev.ucp.shopping"][transport=rest].endpoint. Checkout tests already follow this pattern through get_shopping_url(...), but order tests were still using the root server_url, which fails for implementations that mount the shopping service below a path prefix.

Validation

  • uv run ruff format --check integration_test_utils.py order_test.py
  • uv run ruff check integration_test_utils.py order_test.py
  • uv run python -m py_compile integration_test_utils.py order_test.py
  • Smoke-checked get_order_url(...) with discovered endpoints both with and without a trailing slash.

I also attempted to run order_test.py against the local Flower Shop sample server. The server failed to start before conformance tests ran due to an existing local samples/python-sdk import mismatch: ImportError: cannot import name 'Checkout' from 'ucp_sdk.models.schemas.shopping.ap2_mandate.

@google-cla

google-cla Bot commented Jul 7, 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.

@ShuoRen-TT
ShuoRen-TT force-pushed the codex/fix-order-endpoint-resolution branch from a627f40 to 7187ce4 Compare July 7, 2026 06:21
@ShuoRen-TT
ShuoRen-TT marked this pull request as ready for review July 7, 2026 06:27
@ShuoRen-TT

Copy link
Copy Markdown
Contributor Author

Hi maintainers, CLA is now passing and this PR is ready for review.

By way of introduction, we are an engineering team from TikTok currently working on UCP adoption together with merchants and ecosystem partners, including Shopify. As we go through real integration work, we expect to contribute fixes, conformance improvements, sample updates, and implementation feedback back to the UCP open source community.

This PR is intentionally small: it fixes #42 by making the order conformance tests resolve /orders/{id} through the discovered dev.ucp.shopping REST endpoint, matching the endpoint-resolution pattern already used by the checkout tests.

Could someone from devops-maintainers or above please take a look when you have a chance?

@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Jul 7, 2026
@ptiper
ptiper requested a review from damaz91 July 7, 2026 14:36
@carolinerg1

carolinerg1 commented Jul 7, 2026

Copy link
Copy Markdown

Welcome to the community! Thank you so much for your contribution.

Could you please update your PR to follow the following format for the title: https://github.com/Universal-Commerce-Protocol/.github/blob/main/CONTRIBUTING.md#pull-request-titles-and-commit-messages

Also, it looks like you are using CODEX, please take a look at this to improve CODEX on UCP: https://github.com/Universal-Commerce-Protocol/ucp/blob/main/AGENTS.md

@ptiper
ptiper requested a review from carolinerg1 July 7, 2026 14:42
@ptiper ptiper added status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Jul 7, 2026
TAG=agy
CONV=5a92af33-18c0-4e9a-9f13-6ec5e5ff1e26
@ShuoRen-TT ShuoRen-TT changed the title [codex] fix order endpoint resolution fix: resolve order endpoint from discovered UCP profile Jul 7, 2026
@ShuoRen-TT

Copy link
Copy Markdown
Contributor Author

Welcome to the community! Thank you so much for your contribution.

Could you please update your PR to follow the following format for the title: https://github.com/Universal-Commerce-Protocol/.github/blob/main/CONTRIBUTING.md#pull-request-titles-and-commit-messages

Also, it looks like you are using CODEX, please take a look at this to improve CODEX on UCP: https://github.com/Universal-Commerce-Protocol/ucp/blob/main/AGENTS.md

Thanks for the welcome and the pointers!

I've updated the PR title to follow the Conventional Commits format and reviewed the UCP AGENTS.md guidance for AI-assisted contributions.

The remaining conformance CI failure appears to come from the Flower Shop sample server startup issue tracked in Universal-Commerce-Protocol/samples#118. I opened Universal-Commerce-Protocol/samples#119 to fix that SDK import mismatch. Once that lands, I can rerun this PR's conformance check.

@carolinerg1
carolinerg1 merged commit dcf6824 into Universal-Commerce-Protocol:main Jul 8, 2026
15 of 17 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.

[Bug]: order_test.py uses server base URL instead of shopping service endpoint for /orders/{id} paths

4 participants