Skip to content

codemod: flag MediaBuyStatus.pending_activation split + required-field omissions #513

@bokelley

Description

@bokelley

From the salesagent v3.12 → 4.x migration (SDK_FEEDBACK.md, items #3 and #4).

Two semantic changes in 4.x that the codemod doesn't catch — both surfaced as runtime test failures after collection was otherwise clean:

1. MediaBuyStatus.pending_activation split

Removed in 4.x and split into pending_start | pending_creatives based on cause. Surfaces as AttributeError: type object 'MediaBuyStatus' has no attribute 'pending_activation' at runtime.

Batch-replaced 9 files mechanically with pending_start to unblock collection, then immediately added a TODO(...) because the correct mapping is per-call-site (needs_creatives → pending_creatives; schedule-future → pending_start).

Ask: flag MediaBuyStatus.pending_activation references with a "use pending_start | pending_creatives based on cause" pointer, OR ship a deprecation alias mapping to pending_start with a DeprecationWarning for one minor.

2. idempotency_key becoming required on CreateMediaBuyRequest

The first runtime test failure after a clean collection was a Pydantic ValidationError: idempotency_key Field required. The codemod doesn't flag request constructions that omit now-required fields. This is one of ~600 legacy-test failures still pending.

Ask: codemod or pytest-level warning hook that flags request constructions missing fields that became required between two schema versions. Even a per-construction warning would beat per-test debugging.

Notes

The required-field detection is a bigger lift (needs schema diff between two adcp versions). The pending_activation flagger is a one-off enum mapping. Either ships value independently.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions