Skip to content

feat(masters): add direct masters suspend/resume (#630) - #641

Merged
axisrow merged 1 commit into
mainfrom
feat-630-masters-suspend-resume
Aug 1, 2026
Merged

feat(masters): add direct masters suspend/resume (#630)#641
axisrow merged 1 commit into
mainfrom
feat-630-masters-suspend-resume

Conversation

@axisrow

@axisrow axisrow commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds direct masters suspend/direct masters resume: click the campaign overview page's action button, then re-read the status to confirm the mutation actually took effect (never trusting the click alone).
  • Idempotent: a campaign already in the target status is a no-op with a warning, not an error.
  • Classified DANGEROUS in smoke_matrix.py — Мастер кампаний has no API surface at all, so there's no --sandbox equivalent to isolate these from a real Yandex account.

Not live-verified (important caveat)

Issue #630's step 0 calls for live confirmation of the exact stop-button text and post-click behavior before implementing. I do not currently have a live Chrome session with a real Мастер кампаний account available, so:

  • The resume button text ("Возобновить кампанию") is confirmed live — it's already in tests/fixtures/masters_wizard_overview.html.
  • The suspend/stop button text is NOT confirmed live. direct_cli/browser/masters.py::_SUSPEND_BUTTON_TEXTS tries a short list of plausible Russian labels ("Остановить кампанию", "Приостановить кампанию", "Остановить"). If none match, the command fails with a clear error suggesting --headful rather than clicking the wrong element.
  • Both suspend_master/resume_master verify the status text actually flips after the click (10s poll) before reporting success, so even with the wrong candidate list, a broken click surfaces as an explicit error, not silent data corruption.

Before relying on this in production, please live-verify the suspend button's exact text against a real stopped/active Мастер кампаний and update _SUSPEND_BUTTON_TEXTS if needed (or confirm it already matches).

Test plan

  • pytest tests/test_masters.py -q — 59 passed, including new TestSuspendResumeMaster (click+verify, idempotency, no-candidate-found, click-without-status-change) and TestMastersSuspendResumeCommand (CLI wiring)
  • pytest -q --ignore=tests/test_read_cassettes.py --ignore=tests/test_integration_write.py — 2638 passed, 8 skipped
  • black --check / flake8 on all changed files
  • Manual live smoke test on one non-critical campaign (see scripts/test_dangerous_commands.sh) — not run in this PR per the above caveat

Closes #630

Adds the first mutating `masters` commands: stop/resume a Мастер кампаний
by clicking the overview page's action button, then re-reading the status
to confirm the change actually took effect (a click alone is never treated
as success). Both are idempotent (already-in-target-status is a warning,
not an error).

Not live-verified: the resume button's text ("Возобновить кампанию") is
confirmed against a live account (existing fixture); the suspend button's
exact text is not, so browser/masters.py tries a short candidate list of
plausible Russian labels and fails with a clear "re-run with --headful"
message rather than guessing wrong.

Classified DANGEROUS in smoke_matrix.py (manual-only checklist) since
Мастер кампаний has no API and thus no --sandbox equivalent to isolate
these from a real account.

Closes #630
@axisrow

axisrow commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

📋 Review summary — all cycles

Reviewed locally (/review + Codex companion sol/xhigh), no bots pinged.

Cycle Reviewer Finding Verdict Resolution
1 claude (/review) (no findings) Clean
1 codex (no findings, verdict: approve) Clean

Totals: 0 FIX, 0 SKIP, 0 UNVERIFIED. Both reviewers approved on the first cycle.

Merge is yours to trigger (local mode is review-only).

@axisrow
axisrow merged commit e2db0ae into main Aug 1, 2026
6 checks passed
@axisrow
axisrow deleted the feat-630-masters-suspend-resume branch August 1, 2026 10:24
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 suspend/resume — остановка и возобновление Мастера кампаний

1 participant