fix: resolve order endpoint from discovered UCP profile#47
Conversation
|
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. |
a627f40 to
7187ce4
Compare
|
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 Could someone from |
|
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 |
TAG=agy CONV=5a92af33-18c0-4e9a-9f13-6ec5e5ff1e26
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. |
dcf6824
into
Universal-Commerce-Protocol:main
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
IntegrationTestBase.get_order_url(order_id)as the order-resource equivalent ofget_shopping_url(...).order_test.pyGET 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/ucpunderservices["dev.ucp.shopping"][transport=rest].endpoint. Checkout tests already follow this pattern throughget_shopping_url(...), but order tests were still using the rootserver_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.pyuv run ruff check integration_test_utils.py order_test.pyuv run python -m py_compile integration_test_utils.py order_test.pyget_order_url(...)with discovered endpoints both with and without a trailing slash.I also attempted to run
order_test.pyagainst 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.