Skip to content

audit: WSDL parity gate skips optional fields — audit all *Update/*Add types for missed CLI flags (CalloutSetting pattern) #239

Description

@axisrow

Background

Issue #238 (CalloutSetting missed in ads update) revealed a systemic gap: tests/test_wsdl_parity_gate.py::test_wsdl_required_fields_have_cli_options only validates fields with minOccurs>=1 and skips the entire test for commands where the only required item field is Id (see lines 596-598). CalloutSetting is minOccurs=0 → the gate silently passed for 0.3.11 even though the CLI surface was incomplete.

# tests/test_wsdl_parity_gate.py:596-598
wsdl_required = get_required_item_fields(schema, container)
if not wsdl_required:
    pytest.skip(f"{cli_group}.{cli_op}: WSDL declares no required item fields")

get_required_item_fields() in direct_cli/wsdl_coverage.py:549-564 filters by item.get("min_occurs", 1) >= 1. Optional fields are invisible to the gate by design.

Why this matters

The original design assumed minOccurs>=1 = hard contract violation if missing (API will reject), and minOccurs=0 = optional convenience (can be added incrementally). In practice, optional WSDL fields are often the only way to express a common scenario — CalloutSetting is the only way to manage callout extensions on existing ads, and without a CLI flag the entire workflow is blocked.

Strict-WSDL-parity policy in CLAUDE.md calls for 1:1 mirroring of the WSDL surface; the gate enforces that only for required fields. The two diverge.

Audit candidates (preliminary)

High-confidence misses found by an Explore agent sweep — to be verified per-ticket:

What to do

  1. Extend test_wsdl_parity_gate.py with a soft-gate test that collects all item-fields (including minOccurs=0) for each (cli_group, cli_op) in COMMAND_WSDL_MAP, compares against known Click options, and emits a coverage table. Implementation options: pytest writing an xfail-snapshot file as a whitelist, or a CI warning that does not fail.
  2. One-time per-resource walkthrough (ads, adgroups, keywords, vcards, feeds, strategies, bidmodifiers, retargeting, sitelinks, creatives, dynamicads, dynamicfeedadtargets, smartadtargets, audiencetargets, negativekeywordsharedsets, agencyclients, clients, adimages, advideos, adextensions) building a WSDL-field ↔ CLI-flag table marked SUPPORTED / MISSING / N/A.
  3. File follow-up issues for each confirmed miss (the way ads update: support CalloutSetting (ADD/REMOVE/SET) for managing callouts on existing ads #238 was filed), milestoned to 0.3.13 or 0.4.0 by priority.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions