refactor(campaigns)!: rename --*-fields → --*-field-names (BREAKING)#421
Conversation
… on get Register the canonical kebab-case form `--xxx-field-names` for every existing `--xxx-fields` legacy flag on `direct campaigns get`. Click accepts both names on the same Python variable, so the `CampaignsGetRequest` WSDL parameter name maps 1:1 to the CLI: - `--text-campaign-field-names` (legacy: `--text-campaign-fields`) - `--mobile-app-campaign-field-names` - `--dynamic-text-campaign-field-names` - `--cpm-banner-campaign-field-names` - `--smart-campaign-field-names` - `--unified-campaign-field-names` - `--text-campaign-search-strategy-placement-types-field-names` - `--dynamic-text-campaign-search-strategy-placement-types-field-names` - `--unified-campaign-search-strategy-placement-types-field-names` - `--unified-campaign-package-bidding-strategy-platforms-field-names` The legacy `-fields` aliases remain accepted unchanged for backward compatibility. The internal `selector_options` dict is untouched — only the `@click.option` decorators above `get` change. Help strings gain sample values (drawn from the corresponding `*FieldEnum` in `tests/wsdl_cache/campaigns.xml`) and call out the alias. Removes the ten corresponding rows from `NESTED_FIELDNAMES_EXCLUSIONS` so `test_every_nested_fieldnames_param_has_cli_option` enforces all ten flags. Adds dry-run tests for: canonical-flag payload coverage (all 10), legacy-alias regression guard (subset), and `--help` visibility. Existing legacy-form tests (`test_campaigns_get_text_campaign_fields_dry_run` etc.) continue passing unchanged. Closes #409. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
@claude review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude finished @axisrow's task in 2m 13s —— View job Claude Code Review — complete
Verdict: No critical issues foundPer the trigger scope (bugs / security / logic errors / data loss / performance only — no style nits), this PR is clean. Summary of why: Click multi-decl pattern is correct
@click.option("--canonical-form", "--legacy-form", "snake_case_var", help="...")Click resolves the first non- Backward compatibility is preserved end-to-end
Coverage tightening is safeRemoving 10 rows from No data-loss / security / perf concerns
Non-blocking observation (informational, not a bug)
Ship itDiff is small, surgical, well-tested, and adds an explicit regression guard for the backward-compat surface. No blockers. |
…ield-names BREAKING CHANGE: The ten `--*-fields` options on `direct campaigns get` (`--text-campaign-fields`, `--mobile-app-campaign-fields`, etc.) are removed in favour of the WSDL-canonical `--*-field-names` form. The parameter name now maps 1:1 to the kebab-case CLI flag. Per CLAUDE.md "No legacy CLI flag aliases" rule: when the WSDL canonical name differs from an existing CLI flag, rename it as a breaking change rather than keeping the old name as a second Click alias. Also enforces the rule by a rejection test for the old form.
Resolve conflicts with #415 #416 #417 #418 #419 #420: keep all six previously-merged CHANGELOG entries (feeds/keywords/creatives/clients/ agencyclients/adgroups) and place the campaigns BREAKING CHANGES block at the end of Unreleased. Drop the already-removed NESTED_FIELDNAMES_EXCLUSIONS rows. Update the surviving legacy `-fields` test fixtures to the new `-field-names` form, while keeping one explicit rejection test for `--text-campaign-fields` (the old name).
|
@claude review. PR scope changed since the previous review: aliases were removed per the new no-legacy-aliases rule in CLAUDE.md — this is now a breaking rename. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude finished @axisrow's task in 2m 4s —— View job Claude Code Review — complete
Verdict: No critical issues foundRe-reviewed after the scope flip from "alias both names" → "rename, drop the legacy form." Per the trigger (bugs / security / logic / data-loss / perf only — no style nits), this PR is clean. Rename is wired end-to-end with no stragglers
No silent data loss from the breakageClick rejects unknown options with a hard Test coverage tightens rather than weakens
No leftover references in the repo
Breaking-change is correctly advertised
No data-loss / security / perf concerns
Non-blocking observation (informational only — not a bug, not flagging per trigger scope)The test function name Ship itBreaking rename is surgical, fully wired, well-tested, and announced. No blockers. |
When the WSDL canonical name differs from an existing CLI flag, rename it as a breaking change rather than keeping the old name as a second Click alias. Reference implementation: PR #421 (campaigns). This rule was articulated during Wave 2 (#402) review and applies project-wide. New CLI options must be exactly the kebab-case form of the WSDL request parameter (e.g. `SitelinkFieldNames` → `--sitelink-field-names`). Co-authored-by: axisrow <[email protected]>
Resolve conflicts with #415 #416 #417 #418 #419 #420 #421: keep all six previously-merged CHANGELOG entries (feeds/keywords/creatives/clients/ agencyclients/adgroups), the campaigns BREAKING CHANGES block, and add the bidmodifiers entry as a separate 'Additional features' block. Drop already-removed NESTED_FIELDNAMES_EXCLUSIONS rows. Append bidmodifiers tests after the canonical campaigns block in test_dry_run.py.
Summary
BREAKING CHANGE. The ten
--*-fieldsoptions ondirect campaigns getare renamed to their WSDL-canonical--*-field-namesform (one per*FieldNamesparameter declared byCampaignsGetRequest). The previous names are no longer accepted by Click.Renames:
--text-campaign-fields--text-campaign-field-names--mobile-app-campaign-fields--mobile-app-campaign-field-names--dynamic-text-campaign-fields--dynamic-text-campaign-field-names--cpm-banner-campaign-fields--cpm-banner-campaign-field-names--smart-campaign-fields--smart-campaign-field-names--unified-campaign-fields--unified-campaign-field-names--text-campaign-search-strategy-placement-types-fields--text-campaign-search-strategy-placement-types-field-names--dynamic-text-campaign-search-strategy-placement-types-fields--dynamic-text-campaign-search-strategy-placement-types-field-names--unified-campaign-search-strategy-placement-types-fields--unified-campaign-search-strategy-placement-types-field-names--unified-campaign-package-bidding-strategy-platforms-fields--unified-campaign-package-bidding-strategy-platforms-field-namesPer the new "No legacy CLI flag aliases" rule in
CLAUDE.md(added in this branch's follow-up): when the WSDL canonical name differs from an existing CLI flag, rename it as a breaking change rather than keeping the old name as a second Click alias.Closes #409. Seventh PR in Wave 2 milestone 0.3.14.
Test plan