Skip to content

feat(feeds): expose FileFeedFieldNames and UrlFeedFieldNames on feeds get#415

Merged
axisrow merged 1 commit into
mainfrom
feat/412-feeds-nested-field-names
May 28, 2026
Merged

feat(feeds): expose FileFeedFieldNames and UrlFeedFieldNames on feeds get#415
axisrow merged 1 commit into
mainfrom
feat/412-feeds-nested-field-names

Conversation

@axisrow

@axisrow axisrow commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add --file-feed-field-names and --url-feed-field-names to direct feeds get for the separate WSDL FileFeedFieldNames (FileFeedFieldEnum: Filename) and UrlFeedFieldNames (UrlFeedFieldEnum: Login, Url, RemoveUtmTags) request parameters declared by FeedsGetRequest.
  • Pattern mirrors Wave 1 sitelinks (PR feat(api): expose separate *FieldNames params for sitelinks and keywordbids #403): parse CSV via parse_csv_strings, reject empty input with click.UsageError, only inject the WSDL key when non-empty (Yandex falls back to server-side defaults otherwise).
  • Remove the two corresponding rows from NESTED_FIELDNAMES_EXCLUSIONS (tests/test_api_coverage.py) so test_every_nested_fieldnames_param_has_cli_option now enforces both flags unconditionally.

Closes #412. First PR in Wave 2 milestone 0.3.14 (proof-of-pattern for the remaining 9 sub-issues #405#411, #413, #414).

Test plan

  • pytest tests/test_api_coverage.py::test_every_nested_fieldnames_param_has_cli_option — passes (regression unblocks both rows).
  • pytest tests/test_dry_run.py -k feeds_get — 5 new tests pass: payload, default-omission, --help visibility, two empty-CSV rejections.
  • pytest tests/test_api_coverage.py tests/test_cli.py tests/test_comprehensive.py — 247 tests pass.
  • direct feeds get --help | grep field-names — both new flags visible.

🤖 Generated with Claude Code

… get

Add `--file-feed-field-names` and `--url-feed-field-names` to
`direct feeds get` for the separate WSDL `FileFeedFieldNames`
(`FileFeedFieldEnum`: `Filename`) and `UrlFeedFieldNames`
(`UrlFeedFieldEnum`: `Login`, `Url`, `RemoveUtmTags`) request
parameters declared by `FeedsGetRequest`. Mirrors the Wave 1
sitelinks pattern (#403): each flag parses CSV via
`parse_csv_strings`, rejects empty input with `click.UsageError`,
and only injects the WSDL key into the payload when non-empty so
Yandex falls back to its server-side default otherwise.

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

Closes #412.

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

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 1m 52s —— View job


Claude PR Review — Done


Verdict

No blocking issues found. This is a clean, narrow change that faithfully mirrors the already-merged Wave 1 sitelinks pattern (direct_cli/commands/sitelinks.py:105-184). Recommend merge.

Critical-issue checks (per trigger filter)

  • Bugs / logical errors — None. The empty-CSV guard if file_feed_field_names is not None and not parsed_file_feed_field_names (direct_cli/commands/feeds.py:157, 163) correctly distinguishes "flag not passed" (None → silently omit, matches WSDL minOccurs="0" at tests/wsdl_cache/feeds.xml:179-182) from "flag passed with empty/whitespace value" (e.g. , → reject). parse_csv_strings returns None in both the "input is None" and "input parses to empty list" cases, so the dual-check (raw arg is not None and parsed result falsy) is necessary and correct.
  • UsageError swallowing — The except click.UsageError: raise re-raise at direct_cli/commands/feeds.py:203 is required because the broader except Exception below would otherwise turn a UsageError into print_error(str(e)) + click.Abort() and lose Click's standard usage-error exit semantics. Correctly handled, matches sitelinks.
  • Payload injection — Keys are only added to params when non-empty (direct_cli/commands/feeds.py:178-181), so defaults aren't perturbed for callers who don't opt in. Backward-compatible.
  • Security — Pure string-list passthrough to the typed API client; no shell, no eval, no path/URL handling. No injection surface introduced.
  • Performance — One small CSV split on a short flag value per invocation. Negligible.
  • Data loss / production safetyfeeds.get is read-only; no mutating risk. Not in WRITE_SANDBOX / DANGEROUS paths.
  • WSDL parity — Both rows correctly removed from NESTED_FIELDNAMES_EXCLUSIONS (tests/test_api_coverage.py:2537-2538 deletion) so test_every_nested_fieldnames_param_has_cli_option now enforces them unconditionally. WSDL declares both fields with minOccurs="0", matching the optional-flag treatment in code.
  • Test coverage — 5 new tests in tests/test_dry_run.py:22013-22078: payload shape, default omission, --help visibility, and both empty-CSV rejections. The empty-CSV tests use "," (single comma) to force parse_csv_strings to return None while the raw arg is non-None — exercising the exact branch in the new guard.

Observations (non-blocking, not requested)

  • No client-side validation of enum membership (Filename / Login,Url,RemoveUtmTags) — values are forwarded to the API as-is. This is consistent with how sitelinks handles SitelinkFieldNames and other *FieldNames flags across the codebase, so it's not a deviation. Server returns the appropriate error if an invalid enum value is sent.
    · branch feat/412-feeds-nested-field-names

@axisrow
axisrow merged commit b96a82c into main May 28, 2026
6 checks passed
@axisrow
axisrow deleted the feat/412-feeds-nested-field-names branch May 28, 2026 04:07
axisrow added a commit that referenced this pull request May 28, 2026
Resolve conflicts with #415 (feeds): keep both feeds.get and
keywords.get *FieldNames additions in CHANGELOG, NESTED_FIELDNAMES_EXCLUSIONS,
and dry-run tests.
axisrow added a commit that referenced this pull request May 28, 2026
Resolve conflicts with #415 (feeds) and #416 (keywords): preserve all
three CHANGELOG entries, drop already-removed NESTED_FIELDNAMES_EXCLUSIONS
rows, and append creatives tests after the feeds/keywords blocks in
test_dry_run.py.
axisrow added a commit that referenced this pull request May 28, 2026
Resolve conflicts with #415 #416 #417: keep all four CHANGELOG entries
ordered by merge time, drop the already-removed creatives/feeds/keywords
NESTED_FIELDNAMES_EXCLUSIONS rows, and append clients tests after the
feeds/keywords/creatives 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: 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 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 feeds get nested *FieldNames as CLI options

2 participants