Commit graph

7 commits

Author SHA1 Message Date
0d010a707c feat(tradein-imv): route IMV backfill через BrowserFetcher.fetch_json за dormant-флагом (#915 Stage 3)
All checks were successful
CI / changes (pull_request) Successful in 7s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
Транспорт-своп для avito IMV backfill: вместо curl_cffi 4 IMV-запроса
(warm-up → coords → position → get-data) ходят через камуфокс in-page fetch
(/fetch-json sidecar). Same-origin avito.ru + прокси + warmed-cookies +
реальный fingerprint обходят datacenter-403 (#562/#853) без отдельного
IMV-прокси. За dormant-флагом avito_imv_use_browser_fetcher (default False) —
деплой не меняет prod IMV-поведение.

- avito_imv.py: _BrowserResponse + _BrowserSessionAdapter (мимикрия под
  curl_cffi session/response: .get/.post/.close, .status_code/.text/.json/
  .raise_for_status). evaluate_via_imv получает browser_fetcher kwarg; при
  его наличии адаптер вместо curl-сессии (browser-путь не требует curl_cffi).
- config.py: avito_imv_use_browser_fetcher (ENV AVITO_IMV_USE_BROWSER_FETCHER).
- house_imv_backfill.py: backfill_house_imv при флаге открывает ОДИН
  BrowserFetcher(source="avito") на батч и прокидывает в _process_one_house →
  evaluate_via_imv. Флаг OFF → browser_fetcher=None → curl-путь как раньше.
  Backfill-only: estimator и sweep-путь (process_houses_imv_batch) не тронуты.
- browser_fetcher.py: _post_fetch_json защищён от ответа без status/body keys.
- test_server_fetch_json.py: тест crash-retry ветки _do_fetch_json (relaunch
  + второй _fetch_json_once после browser-crash).
- tests: _BrowserResponse/_BrowserSessionAdapter юниты, evaluate_via_imv
  browser happy-path + 403→IMVAuthError, backfill flag on/off проводка.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 14:42:26 +05:00
4494866574 fix(tradein): route yandex/valuation/imv/newbuilding scrapers через scraper_proxy_url (#860)
All checks were successful
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / test (push) Successful in 28s
Deploy Trade-In / deploy (push) Successful in 35s
Deploy Trade-In / build-backend (push) Successful in 40s
Co-authored-by: bot-backend <bot-backend@gendsgn.local>
Co-committed-by: bot-backend <bot-backend@gendsgn.local>
2026-05-31 07:04:31 +00:00
81bf7e6def fix(tradein-imv): harden Avito IMV anti-bot path + offline contract tests (#565)
Add warm-up GET /evaluation/realty + production browser header set (Sec-Fetch,
X-Requested-With, 25s timeout) mirroring avito.py, чтобы защитить 3-step IMV flow
от server-IP анти-бот 403. Refactor step B/C парсинга в pure helpers
(_parse_geo_position/_parse_price/_parse_placement_history/_parse_suggestions)
+ fixture-driven offline тесты из живых JSON-captures.

Честный диагноз: контракт (geoFieldsHash, price-блок, categoryId=24) НЕ менялся —
проверено живым capture'ом с этой машины (A→B→C, recommended 7.39M). Реальная
причина #565 — скорее анти-бот по PROD-IP, не код → если #565 останется после
deploy, настоящий фикс = ротация egress IP воркера (devops, отдельно).

code-reviewer:  APPROVE no critical — warm-up non-fatal, injected-session path
unchanged, refactor preserves shapes, graceful-None сохранён, fixtures без PII.
Tests: 12 new (27 total). Ruff clean.

Closes #565
2026-05-28 16:29:05 +05:00
ee2262d605 fix(tradein-phase-c): house_type 'monolith'→'monolithic' + log 400 body (#537)
All checks were successful
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / build-backend (push) Successful in 46s
Deploy Trade-In / deploy (push) Successful in 38s
2026-05-24 15:05:49 +00:00
0f7d6c4996 fix(tradein-imv): adapt to Avito 3-step API contract (2026-05+) (#524)
All checks were successful
Deploy Trade-In / changes (push) Successful in 6s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / deploy (push) Successful in 33s
Deploy Trade-In / build-backend (push) Successful in 45s
2026-05-24 13:48:52 +00:00
7f23a9b3f1 feat(tradein-imv): retry with cleaned address + categorize errors (#505)
All checks were successful
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / build-backend (push) Successful in 40s
Deploy Trade-In / deploy (push) Successful in 38s
2026-05-24 11:04:24 +00:00
6a2f734356 feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) (#444)
Some checks failed
Deploy Trade-In / deploy (push) Blocked by required conditions
Deploy Trade-In / changes (push) Successful in 5s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / build-backend (push) Has been cancelled
2026-05-23 12:16:47 +00:00