Skip to content

fix: support ucp envelope in discovery profile tests#40

Open
antomtech wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
antomtech:fix/ucp-envelope-compat
Open

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

Conversation

@antomtech
Copy link
Copy Markdown

@antomtech antomtech commented Apr 27, 2026

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
Copy link
Copy Markdown

google-cla Bot commented Apr 27, 2026

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant