Skip to content

feat(masters): add direct masters add — create Мастер кампаний - #647

Merged
axisrow merged 2 commits into
mainfrom
ao/issue-632-masters-add
Aug 1, 2026
Merged

feat(masters): add direct masters add — create Мастер кампаний#647
axisrow merged 2 commits into
mainfrom
ao/issue-632-masters-add

Conversation

@axisrow

@axisrow axisrow commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements direct masters add — creates a brand-new "Конверсии и трафик" Мастер кампаний by driving the same create wizard a human uses (Мастер кампаний has no API surface at all, same as list/get/suspend/resume/update).
  • Step 0 live recon (read-only, no campaign was ever created/saved) is committed as tests/fixtures/masters_wizard_create.html and found the create flow is not the multi-page "Далее" wizard the issue originally assumed: one micro-step (landing URL + client-side format validation) followed by a single long form, terminating in two buttons — "Запустить кампанию" (launch) and "Сохранить как черновик" (draft) — instead of masters update's single "Сохранить кампанию".
  • --headline/--text/--region are required (repeat for multiple values), even though Yandex's own wizard auto-generates headlines/texts by scanning the landing page — add refuses to silently publish AI-written ad copy the caller never reviewed, given there's no sandbox/rollback for Мастер кампаний.
  • --weekly-budget optional; --draft/--launch (default --launch) picks the terminal button.
  • NOT idempotent — a second run with the same arguments creates a second campaign, not an update. Documented in --help, README, and CHANGELOG per the issue's "Риски" section.
  • Classified DANGEROUS in smoke_matrix.py / test_dangerous_commands.sh — no --sandbox equivalent exists for Мастер кампаний mutations.

Test plan

  • pytest tests/test_masters.py -q — 112 tests covering every new private helper (_fill_landing_url, _wait_for_step2, _add_repeating_values, _set_region, _set_weekly_budget_on_create, _click_terminal_button, create_master) plus CLI wiring, all against fake Page/Locator objects (no real browser).
  • pytest -q — full offline suite green (2691 passed; the 62 errors are a pre-existing, unrelated VCR/aiohttp version-mismatch environment issue, not caused by this change).
  • black/flake8 clean on all touched files.
  • Live verification (manual, per issue direct masters add — создание Мастера кампаний #632 "Верификация") — not performed in this PR. create_master is offline-tested only; end-to-end launch/draft behavior against a real account (including where the created campaign's ID can be read from) still needs a live pass with --draft first.

Closes #632

@axisrow
axisrow force-pushed the ao/issue-632-masters-add branch from 7b4b6ff to 6ac9015 Compare August 1, 2026 16:08
axisrow added 2 commits August 2, 2026 00:13
Step 0 live recon only (per issue #632 plan) — no create_master/masters add
code yet, and no campaign was actually created or saved. Documents the
"Конверсии и трафик" Мастер кампаний create wizard: one micro-step (landing
URL + client-side format validation) followed by a single long form (not a
multi-page "Далее" wizard), its required-vs-optional field markers, and open
questions blocking implementation until #631 stabilizes.

Refs #632, blocked by #631.
Implements the "Конверсии и трафик" Мастер кампаний create flow found by
issue #632 step 0 recon (tests/fixtures/masters_wizard_create.html): NOT
a multi-page "Далее" wizard as originally assumed, but one micro-step
(landing URL, client-side format validation) followed by a single long
form terminating in "Запустить кампанию" (launch) or "Сохранить как
черновик" (draft).

--headline/--text/--region are required CLI-side even though Yandex's
wizard auto-generates headlines/texts by scanning the landing page —
create_master refuses to silently publish AI-written copy the caller
never reviewed, given there is no sandbox or rollback for Мастер
кампаний mutations. NOT idempotent (documented in --help/README/
CHANGELOG per the issue's Риски section): a second run creates a second
campaign.

Classified DANGEROUS in smoke_matrix.py / test_dangerous_commands.sh —
no --sandbox equivalent exists. Offline-only: fake Page/Locator unit
tests for every private helper plus create_master/CLI wiring; no live
save/launch was performed (step 0 recon was read-only per instruction).

Closes #632
@axisrow
axisrow force-pushed the ao/issue-632-masters-add branch from 6ac9015 to 1e30cef Compare August 1, 2026 16:41
@axisrow
axisrow merged commit cf1552e into main Aug 1, 2026
6 checks passed
@axisrow
axisrow deleted the ao/issue-632-masters-add branch August 1, 2026 16:43
@axisrow

axisrow commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author

Code review (post-merge)

Retroactive review requested by issue #648 (item 3) since PR #647 shipped without a formal review pass. Ran the standard 5-angle review (CLAUDE.md compliance, bug scan, git-blame/history, prior-PR review comments, code-comment compliance) against the diff as merged (cf1552e) and cross-checked every finding against current main.

No live issues found. Summary of what the passes surfaced:

No CLAUDE.md violations, no unresolved bugs, no inconsistency between code comments and behavior found in the current state of the code this PR introduced.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

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.

direct masters add — создание Мастера кампаний

1 participant