Commit graph

2 commits

Author SHA1 Message Date
29ea46193e test(tradein): mock has_running_run в sweep-endpoint тестах после single-run guard
test_start_endpoint_ok / test_sweep_endpoint_passes_enrich_imv POST'ят на
/scrape/avito-city-sweep с mock-db (has_running_run → truthy) → новый guard
давал 409 вместо 200. Мокаем app.api.v1.admin.has_running_run→False (патчим
где используется). + ruff autofix import-sort, убран unused mock_create.
2026-05-31 12:02:05 +03:00
2914ff2ef2 feat(tradein): city sweep — auto ЕКБ pipeline (#477)
All checks were successful
Deploy Trade-In / build-frontend (push) Successful in 23s
Deploy Trade-In / deploy (push) Successful in 22s
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-backend (push) Successful in 38s
Stage 4d: full city sweep ЕКБ (5 anchors × N pages + enrichment + cooperative cancel).

- avito.py fetch_around(pages=N) — pagination backward compat default=1
- scrape_pipeline.run_avito_city_sweep — anchors loop + heartbeat + cancel check
- scrape_runs.py utility (create/heartbeat/done/failed/cancelled/list_recent)
- admin.py 3 endpoints: start (BackgroundTasks) / runs / cancel
- migration 051 ADD COLUMN IF NOT EXISTS + DROP/ADD CHECK constraint (text+CHECK, не enum — safe в transaction)
- deploy/avito-city-sweep.sh с random delay 0-3h (anti-pattern)
- 16 offline tests

Deep review approved: migration idempotent, cancel priority correct (mark_done guarded by status='running'), no SQL injection, psycopg v3 compliant.
2026-05-23 14:38:07 +00:00