feat(masters): add direct masters suspend/resume (#630) - #641
Merged
Conversation
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
Owner
Author
📋 Review summary — all cyclesReviewed locally (
Totals: 0 FIX, 0 SKIP, 0 UNVERIFIED. Both reviewers approved on the first cycle. Merge is yours to trigger (local mode is review-only). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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).DANGEROUSinsmoke_matrix.py— Мастер кампаний has no API surface at all, so there's no--sandboxequivalent 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:
"Возобновить кампанию") is confirmed live — it's already intests/fixtures/masters_wizard_overview.html.direct_cli/browser/masters.py::_SUSPEND_BUTTON_TEXTStries a short list of plausible Russian labels ("Остановить кампанию","Приостановить кампанию","Остановить"). If none match, the command fails with a clear error suggesting--headfulrather than clicking the wrong element.suspend_master/resume_masterverify 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_TEXTSif needed (or confirm it already matches).Test plan
pytest tests/test_masters.py -q— 59 passed, including newTestSuspendResumeMaster(click+verify, idempotency, no-candidate-found, click-without-status-change) andTestMastersSuspendResumeCommand(CLI wiring)pytest -q --ignore=tests/test_read_cassettes.py --ignore=tests/test_integration_write.py— 2638 passed, 8 skippedblack --check/flake8on all changed filesscripts/test_dangerous_commands.sh) — not run in this PR per the above caveatCloses #630