Skip to content

fix: support ucp envelope in discovery profile tests#40

Closed
antomtech wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
antomtech:fix/ucp-envelope-compat
Closed

fix: support ucp envelope in discovery profile tests#40
antomtech wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
antomtech:fix/ucp-envelope-compat

Conversation

@antomtech

@antomtech antomtech commented Apr 27, 2026

Copy link
Copy Markdown

Description

The UCP specification (2026-01-23 / 2026-04-08) wraps the .well-known/ucp discovery response under a top-level "ucp" key. The current test code assumes services is always at the top level of the JSON response, which causes test failures against compliant server implementations that use the envelope format.

This PR adds backward-compatible envelope unwrapping:

  • If the response contains a "ucp" key, it is used as the root for field access.
  • If not, the original top-level object is used (maintaining backward compatibility).

Files changed

  • integration_test_utils.py: Updated discovery profile parsing to unwrap the ucp envelope before extracting shopping service endpoints.
  • protocol_test.py: Updated all discovery-related tests to unwrap the ucp envelope when validating profile structure, service bindings, and version negotiation.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@antomtech
antomtech requested review from a team as code owners April 27, 2026 10:22
@google-cla

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

@antomtech

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@antomtech

Copy link
Copy Markdown
Author

@googlebot I signed it.

@antomtech
antomtech force-pushed the fix/ucp-envelope-compat branch from 524b502 to 304cb1a Compare April 27, 2026 10:55
@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:stale Applied when PR is waiting for author response for 30 days labels Jul 7, 2026
@damaz91 damaz91 added status:under-review and removed status:needs-triage Signal that the PR is ready for human triage status:stale Applied when PR is waiting for author response for 30 days labels Jul 20, 2026
@damaz91
damaz91 requested review from damaz91 and removed request for a team, alexpark20 and yanheChen July 20, 2026 10:39
@damaz91

damaz91 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thanks for flagging! We already fixed this in the current conformance test suite version, please take a look!

Thanks again.

@damaz91 damaz91 closed this Jul 20, 2026
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.

2 participants