refactor(campaigns): extract CPM_BANNER_CAMPAIGN to _campaigns_cpm_banner.py (#613)#619
Open
axisrow wants to merge 2 commits into
Open
refactor(campaigns): extract CPM_BANNER_CAMPAIGN to _campaigns_cpm_banner.py (#613)#619axisrow wants to merge 2 commits into
axisrow wants to merge 2 commits into
Conversation
Owner
Author
📋 Review summary — all cycles (local review)Reviewed locally with
Totals: 0 FIX, 1 SKIP (1 later applied as cleanup), 0 UNVERIFIED. CLI surface byte-for-byte identical. Local review is review-only on merge — merge is yours to trigger (PR is stacked on #612, so rebase to |
…nner.py (#613) Step 2 of the incremental campaigns.py split (epic #602, follows shared-helpers extraction in PR #612). Moves the CPM_BANNER_CAMPAIGN add/update subtype-block composition out of the inline `elif campaign_type_norm == "CPM_BANNER_CAMPAIGN":` branches into a new sibling module direct_cli/commands/_campaigns_cpm_banner.py (build_add_block / build_update_block). Both commands now snapshot their CLI parameters once via `p = dict(locals())` and delegate; the per-type builder pulls only the CPM-relevant flags from `p`. CLI surface, every flag and every --dry-run payload is byte-for-byte identical (28 test_campaigns_*cpm* fixtures green, offline tier 2507 passed, WSDL parity + API coverage green). Smallest campaign type, used to validate the per-type extraction mechanics before the larger types (mobile_app, smart, dynamic, unified, text). Part of #602. Co-Authored-By: Claude <noreply@anthropic.com>
`from typing import Dict` is genuinely used (Dict[str, object] annotations), so the `# noqa: F401` was misleading. flake8 stays clean without it. Co-Authored-By: Claude <noreply@anthropic.com>
axisrow
force-pushed
the
ao/issue-602-cpm-banner
branch
from
July 23, 2026 00:56
5384996 to
6aacef1
Compare
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.
Summary
Step 2 of the incremental
campaigns.pysplit (epic #602). Stacked on PR #612 (Step 0 — shared helpers). Extracts theCPM_BANNER_CAMPAIGNadd/update subtype-block composition into a new sibling module.Smallest campaign type → validates the per-type extraction mechanics before the larger types.
What moved
The former inline
elif campaign_type_norm == "CPM_BANNER_CAMPAIGN":branches inadd(~34 lines) andupdate(~45 lines) → new moduledirect_cli/commands/_campaigns_cpm_banner.py:build_add_block(p, campaign_data, parsed_settings, counter_ids_obj, frequency_cap_obj)build_update_block(p, sub_block)Both commands now snapshot their CLI parameters once (
p = dict(locals())) and delegate; the per-type builder pulls only the CPM-relevant flags fromp.CLI surface
No breaking changes. Every flag, every
--dry-runpayload byte-for-byte identical. Pure internal relocation — no legacy aliases, strict WSDL parity preserved.Tests run
pytest tests/test_dry_run.py -k cpm: 28 passedpytest(full offline tier): 2507 passed, 8 skipped (identical to baseline)pytest tests/test_wsdl_parity_gate.py tests/test_api_coverage.py: 263 passed, 6 skipped (green)black+flake8— my files clean (only pre-existing E501 long-line warnings)Risks / follow-ups
COMMAND_WSDL_MAPnot touched.mainafter refactor(campaigns): extract shared helpers to _campaigns_base.py (#602, step 1) #612 merges.Closes #613. Part of #602.
🤖 Generated with Claude Code