Skip to content

feat(migrate): flag MediaBuyStatus.pending_activation split#541

Closed
bokelley wants to merge 1 commit intomainfrom
bokelley/codemod-pending-activation
Closed

feat(migrate): flag MediaBuyStatus.pending_activation split#541
bokelley wants to merge 1 commit intomainfrom
bokelley/codemod-pending-activation

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 4, 2026

Closes part of #513.

Summary

The codemod now flags every MediaBuyStatus.pending_activation reference and points adopters at the per-call-site decision (pending_start vs pending_creatives).

Also adds the corresponding migration-guide section with the cause-to-replacement table and a code example.

Why

Salesagent feedback (issue #513): pending_activation was removed in 4.x and split based on cause (schedule-future → pending_start; waiting on creatives → pending_creatives). Adopters hit it as a runtime AttributeError after the import cascade was otherwise clean. The codemod's static finding count missed this — the new flagger surfaces it pre-runtime.

What this does NOT do (deferred)

The second half of issue #513 — codemod detection of fields that became required (e.g. idempotency_key on CreateMediaBuyRequest) — needs schema diffing across two adcp versions. That's a bigger lift and stays as the follow-up the issue identified.

Test plan

  • 2 new tests in tests/test_migrate_v3_to_v4.py:
    • pending_activation reference is flagged with both replacement names in the hint and the migration anchor
    • Word-boundary regex doesn't false-positive on .pending_activation_v2, .pending_activation_count
  • Full suite: 35 passed
  • ruff, mypy, all pre-commit hooks pass

🤖 Generated with Claude Code

The pending_activation enum value was split in 4.0 into pending_start
(schedule-future buys) and pending_creatives (waiting on creative
approval). Adopters hit this only at runtime — the codemod now flags
every reference with the per-call-site decision hint and a migration-
guide anchor.

The replacement is intentionally per-site rather than a blanket
auto-rewrite — the spec split was driven by adopters needing distinct
behaviour for the two cases, so a uniform substitution would silently
collapse a real branching decision.

Adds MIGRATION_v3_to_v4.md § ``MediaBuyStatus.pending_activation`` →
split with the cause-to-replacement mapping and a code example.

Required-field detection (the second half of issue #513) needs schema
diffing across two adcp versions and isn't shipped here — left as the
follow-up the issue identified.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley
Copy link
Copy Markdown
Contributor Author

bokelley commented May 4, 2026

Closing as duplicate of #523 (triage-managed) which was opened first. Both PRs add the same codemod flagger; #523 went first, going with that one.

@bokelley bokelley closed this May 4, 2026
@bokelley
Copy link
Copy Markdown
Contributor Author

bokelley commented May 4, 2026

Understood — deferring to #523. Nothing further needed here.


Generated by Claude Code

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