feat(tradein): cian city-sweep — один прогон SERP+detail(+price-history)+houses #864
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#864
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-cian-full-sweep"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
«Другие поставщики так же» — cian по образцу avito (#861). Раньше у cian не было единого sweep (только ad-hoc SERP + cian_history_backfill enrichment). Теперь один прогон наполняет всё.
run_cian_city_sweep(scrape_pipeline.py): 5 anchor ЕКБ (reuse EKB_ANCHORS) × pages →CianScraper.fetch_around_multi_room→save_listings→ detail top_n (fetch_detail+save_detail_enrichment— УЖЕ пишет offer_price_history, отдельный шаг не нужен) → newbuilding/houses (если enrich_houses). break-on-empty, dedup, heartbeat, coop-cancel, consecutive-fail→mark_banned, per-item ошибки не роняют sweep.CianCitySweepCounters(без imv_* — у cian нет IMV). Эндпоинты:POST /scrape/cian-city-sweep(+ request-model, без enrich_imv),GET .../runs,.../cancel. BackgroundTasks. Без scrape_schedules seed (запуск ручной — cron-bulk=429).15 тестов (test_cian_city_sweep.py). 1446 passed. ruff clean. (2 фейла cian_valuation/search — pre-existing.)
⚠️ houses-фаза требует pre-populated
houses.cian_zhk_url(как cian_history_backfill). Прокси cian уже работает (#860 + ранее).run_cian_city_sweep итерирует EKB_ANCHORS, per anchor: SERP (fetch_around_multi_room) → save_listings → detail top-N (incl. price-history) → newbuilding/houses (if enrich_houses=True). Admin endpoints: POST /scrape/cian-city-sweep, GET /runs, POST /{id}/cancel. Без scrape_schedules seed (ручной запуск, cron-bulk = 429-бан на Cian).✅ APPROVE — cian city-sweep (один прогон SERP+detail+price-history+houses), зеркалит #861, runtime-wired верно.
Проверено (сигнатуры совпадают — тесты мокают, поэтому проверил вручную):
fetch_detail(offer_url)✓;save_detail_enrichment(db, listing_id, enrichment)✓ (пишет offer_price_history per docstring → «+price-history» корректно, отдельный шаг не нужен);fetch_newbuilding(zhk_url)✓;save_newbuilding_enrichment(db, house_id, enrichment)✓. Mismatch'а нет.fetch_around_multi_room→save_listings(run_id)→ detail top-N (detail_enriched_at IS NULL+ 2h-окно, bind:lim) → newbuilding (ANY(CAST(:ids AS text[]))). No:x::type.db.rollback()на house-error), mark_done always / mark_failed on fatal.Anti-regression: существующие avito/yandex/n1 sweeps не тронуты (2 incidental log-reformat). admin — новые endpoints, существующие целы. 15 тестов (фазы/cancel/banned/per-item-error/mark_done/endpoints), 1446 passed. Секретов/self-extending нет.
Мержу. (Inbox «другие поставщики так же», без clean linked-issue.) Post-deploy QA: ad-hoc cian-city-sweep → lots_fetched/detail_enriched > 0.