Skip to content

feat(agencyclients): expose five nested *FieldNames on agencyclients get#419

Merged
axisrow merged 2 commits into
mainfrom
feat/407-agencyclients-nested-field-names
May 28, 2026
Merged

feat(agencyclients): expose five nested *FieldNames on agencyclients get#419
axisrow merged 2 commits into
mainfrom
feat/407-agencyclients-nested-field-names

Conversation

@axisrow

@axisrow axisrow commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add five --*-field-names flags to direct agencyclients get for the nested WSDL *FieldNames parameters declared by AgencyClientsGetRequest:
    • --contract-field-names (ContractInfoFieldEnum)
    • --contragent-field-names (ContragentInfoFieldEnum)
    • --contragent-tin-info-field-names (TinInfoFieldEnum)
    • --organization-field-names (OrgInfoFieldEnum)
    • --tin-info-field-names (TinInfoFieldEnum)
  • Add --dry-run for parity with every other read-path command (matching rationale added to DRY_RUN_PAYLOAD_EXCLUSIONS).
  • Mirrors PR feat(clients): expose five nested *FieldNames on clients get #418 (clients) which exposes the exact same five enums on the sibling request. Help strings reference AgencyClientsGetRequest WSDL.
  • Remove the five corresponding rows from NESTED_FIELDNAMES_EXCLUSIONS.

Closes #407. Fifth PR in Wave 2 milestone 0.3.14.

Test plan

  • pytest tests/test_api_coverage.py::test_every_nested_fieldnames_param_has_cli_option — passes after row removal.
  • pytest tests/test_dry_run.py -k agencyclients_get — 8 new tests pass.
  • pytest tests/test_api_coverage.py tests/test_cli.py tests/test_comprehensive.py — 247 tests pass.
  • direct agencyclients get --help | grep field-names — 5 new flags + existing --fields visible.

🤖 Generated with Claude Code

Add `--contract-field-names`, `--contragent-field-names`,
`--contragent-tin-info-field-names`, `--organization-field-names`,
and `--tin-info-field-names` to `direct agencyclients get` for the
five nested WSDL `*FieldNames` request parameters declared by
`AgencyClientsGetRequest` (`ContractInfoFieldEnum`,
`ContragentInfoFieldEnum`, `TinInfoFieldEnum`, `OrgInfoFieldEnum`,
`TinInfoFieldEnum`). Mirrors PR #418 (clients) which exposes the
exact same five enums on the sibling `clients get` request.

Also add `--dry-run` for parity with every other read-path command,
and the matching rationale in DRY_RUN_PAYLOAD_EXCLUSIONS.

Each flag parses CSV via `parse_csv_strings`, rejects empty input
with `click.UsageError`, and only injects the WSDL key when
non-empty. The five options share one selector loop.

Removes the corresponding rows from `NESTED_FIELDNAMES_EXCLUSIONS`
so `test_every_nested_fieldnames_param_has_cli_option` enforces
all five flags. Adds parametrized dry-run tests for payload,
default-omission, `--help` visibility, and empty-CSV rejection.

Closes #407.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Copilot AI review requested due to automatic review settings May 28, 2026 04:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@axisrow

axisrow commented May 28, 2026

Copy link
Copy Markdown
Owner Author

@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

claude Bot commented May 28, 2026

Copy link
Copy Markdown

Claude finished @axisrow's task in 2m 33s —— View job


Claude Code Review

  • Read changed files (direct_cli/commands/agencyclients.py, tests, coverage)
  • Verified WSDL parameter names against tests/wsdl_cache/agencyclients.xml:66-72
  • Checked parse_csv_strings edge cases for empty/whitespace input
  • Confirmed dry-run path, exception handling, and test coverage

No critical issues found. The five flags map 1:1 to the WSDL elements, the params.update(parsed_nested) placement matches the sibling-element structure of AgencyClientsGetRequest, and the empty/whitespace rejection logic is sound.

What I verified

Check Result
WSDL element name parity (5 nested *FieldNames) ContractFieldNames, ContragentFieldNames, ContragentTinInfoFieldNames, OrganizationFieldNames, TinInfoFieldNames all match agencyclients.xml:68-72
Top-level placement ✅ Sibling of FieldNames per WSDL — params.update(parsed_nested) is correct
Empty-CSV rejection parse_csv_strings(",") and parse_csv_strings("") both return None; the raw_value is not None and not parsed guard fires UsageError correctly (direct_cli/commands/agencyclients.py:155-160)
UsageError not swallowed except click.UsageError: raise at L191 prevents the broad except Exception at L193 from converting it to print_error + abort, preserving Click's exit code 2
Default omission ✅ When a flag is absent, parse_csv_strings(None) returns None, no key injected — schema treats them as minOccurs=0
Smoke-matrix safety agencyclients.get is SAFE in direct_cli/smoke_matrix.py:28; no mutation surface added
Test coverage ✅ Payload, default-omission, help visibility, and empty-CSV rejection are all parametrized across the five flags
NESTED_FIELDNAMES_EXCLUSIONS cleanup ✅ All five agencyclients.get rows removed; test_every_nested_fieldnames_param_has_cli_option will now enforce them
DRY_RUN_PAYLOAD_EXCLUSIONS rationale ✅ New entry is a legitimate read-path exclusion (covered by SelectionCriteria tests), matching the allowed categories in CLAUDE.md

Minor observations (non-blocking)

  • create_client(...) is called before the new validation block at L147-162, so an empty-CSV UsageError happens after credentials are resolved. Not a bug — create_client is lazy and makes no network call, and this matches the existing pattern in the file.
  • Naming: --organization-field-namesOrganizationFieldNames and --tin-info-field-namesTinInfoFieldNames (note the Tin vs TIN styling), which matches the WSDL casing exactly. Good.

LGTM from a correctness/safety standpoint.
· feat/407-agencyclients-nested-field-names

Resolve conflicts with #415 #416 #417 #418: keep all five CHANGELOG entries
ordered by merge time and append agencyclients tests after the
feeds/keywords/creatives/clients blocks in test_dry_run.py.
@axisrow
axisrow merged commit 61f8ef9 into main May 28, 2026
6 checks passed
@axisrow
axisrow deleted the feat/407-agencyclients-nested-field-names branch May 28, 2026 04:50
axisrow added a commit that referenced this pull request May 28, 2026
Resolve conflicts with #415 #416 #417 #418 #419: keep all six CHANGELOG
entries ordered by merge time and append adgroups tests after the
feeds/keywords/creatives/clients/agencyclients blocks in test_dry_run.py.
axisrow added a commit that referenced this pull request May 28, 2026
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).
axisrow added a commit that referenced this pull request May 28, 2026
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.
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.

Wave 2 (#402): expose agencyclients get nested *FieldNames as CLI options

2 participants