test(codegen): lock deprecation-decorator generation on deprecated JSON Schema properties#781
test(codegen): lock deprecation-decorator generation on deprecated JSON Schema properties#781bokelley 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
|
Closing this draft as deferred/stale, not rejecting the underlying test contract. The PR is test-only, has a fixup commit plus stale storyboard failures, and only partially satisfies #778 by testing older 3.0.7 deprecated fields while the actual 3.1 anchor cases remain commented out. Keep #778 open and re-cut this after the 3.1 schema/codegen path is settled, ideally after the current codegen cleanup work lands. |
|
Acknowledged — closing as deferred/stale makes sense given the partial coverage and stale storyboard failures. #778 stays open; will re-cut after the 3.1 schema/codegen path settles and the current codegen cleanup work lands. Generated by Claude Code |
|
Noted. #778 stays open; this PR can be re-cut once the 3.1 schema/codegen path settles. _Generated by Claude Code Generated by Claude Code |
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