test(codegen): lock deprecation-decorator generation on deprecated JSON Schema properties#781
Draft
bokelley wants to merge 2 commits into
Draft
test(codegen): lock deprecation-decorator generation on deprecated JSON Schema properties#781bokelley wants to merge 2 commits into
bokelley wants to merge 2 commits into
Conversation
…ON Schema properties Adds CI gate asserting that JSON Schema ``deprecated: true`` is propagated to ``deprecated=True`` on Pydantic v2 field metadata by the pinned datamodel-code-generator==0.56.1. Catches silent regressions from codegen pin bumps or schema refreshes that drop the deprecation marker. Anchor cases (AdCP 3.0 schemas): TargetingOverlay.axe_include_segment / axe_exclude_segment, GetSignalsRequest.max_results, ProductFilters.required_axe_integrations. Commented-out block documents the pending 3.1 anchor cases (CreateMediaBuySuccessResponse.status, UpdateMediaBuySuccessResponse.status) for easy activation after adcp#4904 schema sync. Closes #778 https://claude.ai/code/session_0169cPJV4qE4hxoLvkJsm2mg
…ort in pending block - Comment now accurately says TargetingOverlay resolves to the core schema class, not the bundled variants (per pre-PR expert review) - Pending 3.1 commented-out block now imports from adcp.types (public API) instead of adcp.types.aliases (internal module) https://claude.ai/code/session_0169cPJV4qE4hxoLvkJsm2mg
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 #778
Adds a CI gate that asserts
"deprecated": truein the JSON Schema source propagates todeprecated=Trueon Pydantic v2FieldInfothrough the pinneddatamodel-code-generator==0.56.1codegen pipeline.Motivation: The expert review on adcontextprotocol/adcp#4904 (AdCP 3.1 additive-deprecate of
CreateMediaBuySuccess.status/UpdateMediaBuySuccess.status) flagged thatdatamodel-code-generatorhas historically had unevendeprecatedkeyword support across versions — older pinned versions silently drop it. This test locks the contract so regressions are caught in CI rather than in production.What changed:
tests/test_codegen_deprecation_contract.pywith 4 assertions covering existing deprecated fields in the 3.0.7 schema bundle:TargetingOverlay.axe_include_segment/.axe_exclude_segment(core schema class)GetSignalsRequest.max_resultsProductFilters.required_axe_integrations_assert_field_deprecated()helper with a failure message that points back to the codegen pinCreateMediaBuySuccessResponse.status,UpdateMediaBuySuccessResponse.status) for easy activation after adcp#4904 schema syncWhat tested:
pytest tests/test_codegen_deprecation_contract.py— 4 passedpytest tests/— 4734 passed, 1 pre-existing network test skipped (test_real_tls_handshake_still_validates_hostnamein the signing conformance suite, unrelated to this change)ruff check— cleanpython -m mypy src/adcp/— success, 805 source files, no issuesPre-PR review:
adcp.types.aliasestoadcp.types)TargetingOverlayresolves to the core schema class, not the structurally identical bundled variants)Session: https://claude.ai/code/session_0169cPJV4qE4hxoLvkJsm2mg
Generated by Claude Code