Skip to content

feat(migrate): flag MediaBuyStatus.pending_activation split in v3-to-v4 codemod#523

Merged
bokelley merged 2 commits intomainfrom
claude/issue-513-flag-pending-activation-split
May 4, 2026
Merged

feat(migrate): flag MediaBuyStatus.pending_activation split in v3-to-v4 codemod#523
bokelley merged 2 commits intomainfrom
claude/issue-513-flag-pending-activation-split

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 4, 2026

Refs #513

Adds REMOVED_ENUM_VALUES dict and a flag_enum_value finding kind to the v3→v4 codemod so adopters migrating from v3.12 see an actionable codemod report entry for MediaBuyStatus.pending_activation rather than a runtime AttributeError. The hint names both replacement values (pending_start / pending_creatives) and points to valid_actions on the MediaBuy response as the runtime discriminator for which applies at a given call site.

Item 2 from #513 (required-field detection for idempotency_key) is deferred — text-match is not reliable for multi-line constructor calls and **kwargs unpacking; an AST-based pass is the correct architecture for that.

What was tested

  • pytest tests/test_migrate_v3_to_v4.py -v — 35 passed (2 new: test_flags_removed_enum_values, test_enum_value_word_boundary_no_false_positive)
  • ruff check src/adcp/migrate/v3_to_v4.py — clean
  • mypy src/adcp/migrate/v3_to_v4.py — no errors in changed file

Pre-PR review

  • code-reviewer: approved — no blockers; non-breaking (additive new dict + scan loop, existing findings unchanged); nit: kind field could use Literal type (out of scope)
  • dx-expert: approved — flag_enum_value as separate kind is correct for JSON consumers; hint is actionable; nit: hint opens redundantly with enum value name already shown in header; no migration_anchor slot (noted, acceptable until migration doc adds a section for it)

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_01294Agd3ZTguC1drs5Beous


Generated by Claude Code

…v4 codemod

Adds a REMOVED_ENUM_VALUES dict and flag_enum_value finding kind to the
v3→v4 codemod so adopters see an actionable hint rather than a runtime
AttributeError after migration. The hint names both replacement values
(pending_start / pending_creatives) and points to valid_actions as the
runtime discriminator.

https://claude.ai/code/session_01294Agd3ZTguC1drs5Beous
bokelley added a commit that referenced this pull request May 4, 2026
…ctivation

Per review on #523:
- REMOVED_ENUM_VALUES gains the (hint, anchor) tuple shape so findings
  carry a migration_anchor like REMOVED_TYPES do.
- New MIGRATION_v3_to_v4.md § ``MediaBuyStatus.pending_activation`` →
  split with the cause-to-replacement mapping and a code example,
  matching the anchor the codemod now emits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley marked this pull request as ready for review May 4, 2026 02:07
…ivation

Per review on #523:
- REMOVED_ENUM_VALUES gains the (hint, anchor) tuple shape so findings
  carry a migration_anchor like REMOVED_TYPES do.
- New MIGRATION_v3_to_v4.md § ``MediaBuyStatus.pending_activation`` →
  split with the cause-to-replacement mapping and a code example,
  matching the anchor the codemod now emits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley force-pushed the claude/issue-513-flag-pending-activation-split branch from 657cc95 to 4f5fade Compare May 4, 2026 02:12
@bokelley bokelley merged commit d0659c7 into main May 4, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants