fix(examples/multi_platform_seller): add list_creatives + query_summary to both mock platforms#526
Closed
fix(examples/multi_platform_seller): add list_creatives + query_summary to both mock platforms#526
Conversation
…ry to both mock platforms Both MockGuaranteedPlatform and MockNonGuaranteedPlatform were missing a list_creatives method, causing storyboard validation to fail with 'query_summary' is a required property. The JSON schema requires creative items to carry creative_id, name, format_id, status, created_date, and updated_date. - Store approved creatives in _synced_creatives (dict keyed by creative_id) inside the same lock block as buy-status mutation in sync_creatives, so idempotency replays upsert rather than accumulate duplicates - list_creatives returns list_creatives_response(values, sandbox=False) which fills created_date/updated_date and builds the required query_summary and pagination envelope - 13 new unit tests cover: empty-list schema shape, synced-creative round-trip, required-field presence, name fallback, dedup on re-sync, and sandbox=False Fixes #510 https://claude.ai/code/session_015eWELLixehtjTexkZ3ahvr
Closed
3 tasks
Contributor
Author
|
Superseded by #521 (fix(examples/multi_platform_seller): list_creatives populates query_summary), already merged to main. |
Contributor
Author
|
Acknowledged — noted that this PR is superseded by #521, already merged to main. Generated by Claude Code |
Contributor
Author
|
Confirmed — #521 covers the same fix and is already on Generated by Claude Code Generated by Claude Code |
Contributor
Author
|
Acknowledged — noted that #521 landed the same fix on _Generated by Claude Code Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #510
Summary
Both
MockGuaranteedPlatformandMockNonGuaranteedPlatformwere missing alist_creativesmethod, causing storyboard validation to fail with'query_summary' is a required property. Thelist-creatives-response.jsonschema requires each creative item to carrycreative_id,name,format_id,status,created_date, andupdated_date.Changes:
self._synced_creatives: dict[str, dict]to both__init__(keyed bycreative_idso idempotency-replay re-syncs upsert rather than accumulate duplicates)sync_creativesin both mocks to store the creative items (with all required list-response fields) inside the same lock block as buy-status mutationlist_creativesmethod to both mocks usinglist_creatives_response(values, sandbox=False), which auto-fillscreated_date/updated_dateand builds the requiredquery_summary/paginationenvelopepending_creatives → pending_start → active)What was tested
ruff check src/ tests/test_multi_platform_seller.py— cleanmypy src/adcp/— clean (777 source files)pytest tests/ -q --ignore=tests/conformance/signing/test_ip_pinned_transport.py— 3749 passed, 0 new failures (the ignored test is a pre-existing sandbox TLS failure unrelated to this change)tests/test_multi_platform_seller.pycovering: empty-listquery_summary/paginationshape, synced-creative round-trip, all required fields present,namefallback, dedup on re-sync of samecreative_id,sandbox=Falsein responsePre-PR review:
sandbox=False) addressed before PR; nits (module-level_DEFAULT_FORMAT_IDconstant) noted belowsandbox=Falseexplicit per blocker fixKnown nits (not fixed here to keep scope tight):
format_idfallback dict{"agent_url": "https://creative.adcontextprotocol.org/", "id": "display_300x250"}is inlined in both mock files rather than extracted to a module-level constant. Acceptable for example code; extracting it is a cosmetic follow-up._synced_creativesis not filtered by account (the storyboard uses single-tenant instances, so cross-contamination can't occur in the current topology; comment noting this added inline)Session: https://claude.ai/code/session_015eWELLixehtjTexkZ3ahvr
Generated by Claude Code