Skip to content

fix: resolve 13 confirmed bugs from the #483 bug hunt - #486

Merged
axisrow merged 4 commits into
mainfrom
fix/issue-483-bug-hunt
May 30, 2026
Merged

fix: resolve 13 confirmed bugs from the #483 bug hunt#486
axisrow merged 4 commits into
mainfrom
fix/issue-483-bug-hunt

Conversation

@axisrow

@axisrow axisrow commented May 30, 2026

Copy link
Copy Markdown
Owner

Закрывает #483. Стек поверх #485 (сетевой фикс) — после мержа #485 эта ветка автоматически перенацелится на main.

Каждый из 15 заявленных багов перепроверен вручную: по живому API (read-only), по WSDL-кэшу и по официальной документации Yandex Direct. Баги 10 (retargeting get/delete) и 14 (advideos get) оказались ложными срабатываниями — внутри try нет источника UsageError до вызова API, это лишь стиль; они намеренно пропущены.

Функциональные фиксы

Фиксы проглоченной валидации

Вставлен except click.UsageError/ClickException: raise перед except Exception: #6 balance, #7 strategies get, #9 campaigns get, #13 ads get, #5 negativekeywordsharedsets update.

Прочее

Тесты

Добавлены регресс-тесты во все затронутые наборы. Полный unit-набор: 2064 passed, 47 skipped, 0 failed.

🤖 Generated with Claude Code

axisrow and others added 3 commits May 30, 2026 21:02
…twork call

A regression from #480 made get_credentials() resolve the bare Client-Login
via a network clients.get on every CLI invocation when an OAuth profile with
an email login lacked the login_migration_checked flag — including plain
`<group> --help`. That call had no timeout (neither the vendored client nor
tapi2 set one), so a slow link or a Yandex SmartCaptcha gateway could hang the
CLI indefinitely. Under CliRunner this also hung the unit suite (it stalled on
test_registered_mapped_groups_show_docs_url, which fires ~30 `--help` calls).

Three independent guards:
- auth.py: cap the best-effort resolver with LOGIN_RESOLVE_TIMEOUT_SECONDS=8
  and disable retries, so it can never wait forever.
- cli.py: skip the resolver entirely on --help/--version/-h passes
  (allow_login_resolve=False) — no command runs, so no login is needed.
- tests/conftest.py: autouse fixture neutralizes the network resolver for the
  whole unit suite; the module-level test-credential probe no longer triggers it.

Adds regression tests asserting a --help pass makes zero resolver calls and
that allow_login_resolve=False suppresses the migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verified each finding against the live API, the WSDL cache, and the official
Yandex Direct docs before fixing. Bugs 10 and 14 were false positives
(no UsageError source inside the try — style only) and are intentionally skipped.

Functional fixes:
- bids/keywordbids get: reject empty SelectionCriteria with a UsageError
  before the request (live API error 4001) (#1, #2).
- bids get: re-raise UsageError so the new guard surfaces with exit code 2 (#8).
- bids set-auto: require exactly one of CampaignId/AdGroupId/KeywordId via
  add_single_id_selector (docs: the three are mutually exclusive) (#4).
- vendored to_columns: pad short report rows instead of IndexError (#3).
- vendored error handler: error_data.get("error_detail") to avoid KeyError (#11).
- reports build_report_request: reject empty FieldNames (live API error 8000) (#12).

Swallowed-validation fixes (add `except click.UsageError/ClickException: raise`
before the bare `except Exception`): balance (#6), strategies get (#7),
campaigns get (#9), ads get (#13), negativekeywordsharedsets update (#5).

Type annotation: parse_priority_goals_spec items -> List[Dict[str, Any]] (#15).

build_api_coverage_report: supply --campaign-ids for bids/keywordbids get
wire-capture so the empty-criteria guard does not break schema parity.

Closes #483

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Incorporates the genuinely-better parts of the parallel PR #484 into this
branch, which already carries the regression tests, the #15 annotation fix,
and the localized messages:

- ads: re-raise click.UsageError in all lifecycle handlers (update, delete,
  archive, unarchive, suspend, resume, moderate) in addition to get — so the
  whole resource matches bug #13's "get + 8 lifecycle" scope. Defensive: these
  handlers have no pre-API UsageError source today, but the guard keeps them
  consistent and future-proof.
- retargeting get/delete, advideos get: same defensive re-raise for uniformity
  (issue #483 items 10/14; not live defects, but harmless consistency).
- bids/keywordbids get: the empty-criteria message now also lists
  --serving-statuses, which likewise populates SelectionCriteria (kept the
  t() localization wrapper).
- CHANGELOG.md: document the bug-hunt fixes (#483) and the --help network-hang
  follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@axisrow
axisrow changed the base branch from fix/login-resolve-network-hang to main May 30, 2026 14:25
@axisrow
axisrow merged commit f2c500f into main May 30, 2026
6 checks passed
@axisrow
axisrow deleted the fix/issue-483-bug-hunt branch May 30, 2026 14:28
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.

1 participant