fix: remove keywords archive/unarchive, fix credential-leak in 18 tests#102
Conversation
…x credential-leak in 18 tests (#101) Keywords service API only supports add/update/delete/suspend/resume/get. The archive/unarchive methods don't exist, causing timeouts on every call. Also fixes test isolation: 18 tests in 5 files leaked real tokens from ~/.direct-cli/auth.json because get_active_profile() wasn't mocked. Closes #101 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@claude 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. |
|
Claude finished @axisrow's task in 3m 1s —— View job PR Review
SummaryThe PR is correct and well-motivated. No critical bugs, security issues, or data-loss risks found. Two minor observations below. Keywords archive/unarchive removalClean removal. All cross-references are consistent:
The Credential-leak fixThe fix is correct and addresses a real non-determinism bug. Without patching Decorator ordering is correct — Minor gap (non-blocking)Two tests in
Since both pass a token directly, Overall: Approved. The removal is accurate (the API truly doesn't support these methods), the fix is correct and targeted, and the test count updates match the deletions. The two unpatched tests are a minor consistency gap, not a correctness issue. |
Summary
keywords archiveandkeywords unarchivecommands — Yandex Direct API Keywords service doesn't support these methods (onlyadd,update,delete,suspend,resume,get)@patch("direct_cli.auth.get_active_profile", return_value=None)so tests don't read real tokens from~/.direct-cli/auth.jsonChanges
Keywords archive/unarchive removal (11 files):
direct_cli/commands/keywords.py— removedarchive()andunarchive()functionsdirect_cli/smoke_matrix.py— removed from WRITE_SANDBOXdirect_cli/wsdl_coverage.py— removed from INTENTIONAL_EXTRA_METHODStests/test_api_coverage.py— removed from exclusionstests/test_smoke_matrix.py— updated counts (122→120, 118→116, 77→75)scripts/sandbox_write_live.py— removed handlersscripts/test_dangerous_commands.sh,README.md,.github/copilot-instructions.md,tests/MANUAL_COVERAGE.md,tests/test_dry_run.py— updated docsCredential-leak fix (5 files, 18 tests):
tests/test_auth_bw.py(7 tests)tests/test_auth_op.py(6 tests)tests/test_cli.py(1 test)tests/test_comprehensive.py(3 tests)tests/test_dry_run.py(1 test)Test plan
pytest— 288 passed, 0 failed, 51 skippeddirect keywords archive→ "No such command"direct keywords unarchive→ "No such command"keywords.archive/keywords.unarchivereferences in codebaseCloses #101
🤖 Generated with Claude Code