Skip to content

[codex] Add adextensions CalloutFieldNames flag#359

Merged
axisrow merged 1 commit into
mainfrom
codex/adextensions-callout-field-names
May 25, 2026
Merged

[codex] Add adextensions CalloutFieldNames flag#359
axisrow merged 1 commit into
mainfrom
codex/adextensions-callout-field-names

Conversation

@axisrow

@axisrow axisrow commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

Adds strict Yandex Direct API contract support for AdExtensions.get CalloutFieldNames.

Changes

  • Adds direct adextensions get --callout-field-names as the kebab-case CLI projection of API CalloutFieldNames.
  • Keeps --fields scoped to top-level FieldNames; CalloutText is emitted only under CalloutFieldNames.
  • Uses the shared CSV parser and rejects explicit empty --callout-field-names input.
  • Adds dry-run and help regression coverage.

Validation

  • python3 -m black --check direct_cli/commands/adextensions.py tests/test_dry_run.py
  • python3 -m ruff check direct_cli/commands/adextensions.py tests/test_dry_run.py
  • python3 -m pytest tests/test_dry_run.py tests/test_cli.py -q
  • python3 -m pytest -q
  • direct adextensions get --types CALLOUT --fields Id,Type,State,Status --callout-field-names CalloutText --format json --dry-run
  • git diff --check

Copilot AI review requested due to automatic review settings May 25, 2026 18: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.

Pull request overview

Adds strict CLI support for the Yandex Direct API AdExtensions.get nested projection CalloutFieldNames, exposed as the kebab-case flag --callout-field-names, and verifies the resulting request payloads via dry-run tests.

Changes:

  • Added direct adextensions get --callout-field-names and wired it into the request body as CalloutFieldNames.
  • Ensured --fields continues to control only top-level FieldNames, while CalloutText is requested only via CalloutFieldNames.
  • Added dry-run and --help regression tests, plus validation rejecting explicitly empty --callout-field-names.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
direct_cli/commands/adextensions.py Adds the --callout-field-names option, parses it via shared CSV parsing, validates non-empty input when provided, and includes CalloutFieldNames in the request params.
tests/test_dry_run.py Adds dry-run payload coverage + help visibility + empty-input rejection coverage for --callout-field-names.

@axisrow

axisrow commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@axisrow
axisrow merged commit c23f153 into main May 25, 2026
7 checks passed
@axisrow
axisrow deleted the codex/adextensions-callout-field-names branch May 25, 2026 18:13
axisrow added a commit that referenced this pull request May 28, 2026
…nd keywordbids

Per Yandex Direct API WSDL (tests/wsdl_cache/sitelinks.xml,
tests/wsdl_cache/keywordbids.xml), the GetRequest of both services
declares nested *FieldNames request parameters that are independent
of the top-level FieldNames:

  sitelinks.get      -> SitelinkFieldNames (SitelinkFieldEnum)
  keywordbids.get    -> SearchFieldNames (KeywordBidSearchFieldEnum)
                        NetworkFieldNames (KeywordBidNetworkFieldEnum)

Previously the CLI either folded these into --fields (overloading the
top-level FieldNames projection) or auto-emitted defaults with no way
to override. Mirroring the reference pattern from PR #359
(--callout-field-names), this change exposes each *FieldNames
parameter as a dedicated kebab-case option.

- direct_cli/commands/sitelinks.py: add --sitelink-field-names. Empty
  CSV input rejected with UsageError; omitted means the parameter is
  not sent (server default).
- direct_cli/commands/keywordbids.py: add --fields,
  --search-field-names, --network-field-names. Each falls back to the
  COMMON_FIELDS default when not provided so existing behavior is
  preserved.
- tests/test_dry_run.py: 11 new dry-run tests covering payload shape,
  --help surface, and empty-CSV rejection for the new flags.
- tests/test_api_coverage.py: new regression test
  test_every_nested_fieldnames_param_has_cli_option scans every cached
  WSDL get request for *FieldNames parameters and verifies that each
  one has a matching kebab-case CLI option, ensuring future separate
  field-list parameters cannot silently disappear. Acknowledged
  remaining gaps registered in NESTED_FIELDNAMES_EXCLUSIONS with a
  pointer to follow-up issue #402.

Closes #360.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
axisrow added a commit that referenced this pull request May 28, 2026
…nd keywordbids (#403)

Per Yandex Direct API WSDL (tests/wsdl_cache/sitelinks.xml,
tests/wsdl_cache/keywordbids.xml), the GetRequest of both services
declares nested *FieldNames request parameters that are independent
of the top-level FieldNames:

  sitelinks.get      -> SitelinkFieldNames (SitelinkFieldEnum)
  keywordbids.get    -> SearchFieldNames (KeywordBidSearchFieldEnum)
                        NetworkFieldNames (KeywordBidNetworkFieldEnum)

Previously the CLI either folded these into --fields (overloading the
top-level FieldNames projection) or auto-emitted defaults with no way
to override. Mirroring the reference pattern from PR #359
(--callout-field-names), this change exposes each *FieldNames
parameter as a dedicated kebab-case option.

- direct_cli/commands/sitelinks.py: add --sitelink-field-names. Empty
  CSV input rejected with UsageError; omitted means the parameter is
  not sent (server default).
- direct_cli/commands/keywordbids.py: add --fields,
  --search-field-names, --network-field-names. Each falls back to the
  COMMON_FIELDS default when not provided so existing behavior is
  preserved.
- tests/test_dry_run.py: 11 new dry-run tests covering payload shape,
  --help surface, and empty-CSV rejection for the new flags.
- tests/test_api_coverage.py: new regression test
  test_every_nested_fieldnames_param_has_cli_option scans every cached
  WSDL get request for *FieldNames parameters and verifies that each
  one has a matching kebab-case CLI option, ensuring future separate
  field-list parameters cannot silently disappear. Acknowledged
  remaining gaps registered in NESTED_FIELDNAMES_EXCLUSIONS with a
  pointer to follow-up issue #402.

Closes #360.

Co-authored-by: axisrow <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

2 participants