gendesign/tradein-mvp/packages/scraper-kit/src/scraper_kit
bot-backend 7800f6014a
All checks were successful
CI / changes (pull_request) Successful in 10s
CI Trade-In / changes (pull_request) Successful in 11s
CI Trade-In / frontend-checks (pull_request) Has been skipped
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
CI Trade-In / backend-tests (pull_request) Successful in 1m48s
refactor(tradein/scraper-kit): yandex providers on shared _base.py (#2363)
F4c-yandex (epic #2277 Group F, parent #2352): migrate the SERP scraper's
BrowserFetcher construction onto build_browser_fetcher() from the Foundation
module (#2358, providers/_base.py) instead of local ad-hoc construction.

- yandex/serp.py::__aenter__ now calls build_browser_fetcher(config, source=,
  proxy_provider=, fetch_timeout_s=) instead of constructing BrowserFetcher(...)
  directly. Preserves the existing fetch_timeout_s=30 (see caveat below),
  endpoint/proxy_provider/use_pool resolution byte-for-byte. The retry/tarpit
  logic in fetch_around() (rotate_ip + sleep on status==0/JSON-error) is
  untouched, per the Foundation module's documented exclusion.

Left unchanged (deliberate, not an oversight):
- yandex/serp.py::_rotate_ip's curl_cffi AsyncSession(timeout=30) — this hits
  the mobile-proxy provider's own changeip API, not Yandex; it intentionally
  carries no impersonate/headers/proxy (same as the mirrored avito/serp.py
  rotate-ip session). Not listed among the _base.py docstring's documented
  extraction sites -- consistent exclusion, not a new one.
- yandex/detail.py -- no BrowserFetcher/curl_cffi construction exists in this
  file (uses BaseScraper's httpx-based _http_get). Nothing to migrate.
- yandex/newbuilding.py -- both BrowserFetcher(...) call sites take an
  OPTIONAL `config: ScraperConfig | None`, a genuinely different contract from
  build_browser_fetcher's mandatory `config`. Migrating would require making
  config mandatory (breaking admin.py:1511, yandex_newbuilding_sweep.py:353,
  and several tests that call without config -- out of scope for a call-site
  swap) and breaks test_scraper_kit_newbuilding_endpoint.py's "without config,
  endpoint=None" regression case (its SimpleNamespace mock lacks
  use_proxy_pool_browser, and the mock config path can never satisfy a
  mandatory-config helper). Left untouched; the class-bug #2322/#2330 this
  file already fixed (config now threaded, just not via the shared helper)
  remains fixed.

Also updates test_kit_serp_proxy_pool.py's 3 yandex-specific tests: they
monkeypatched the module-local `yandex_serp.BrowserFetcher` name, which the
migrated call path no longer references directly (it now goes through
scraper_kit.providers._base.build_browser_fetcher -> _base's own BrowserFetcher
import). Patch target moved to scraper_kit.providers._base.BrowserFetcher;
every assertion is unchanged -- this adapts the mock to the new (intentional)
call path, it does not weaken what the test verifies. Cian's tests in the same
file are untouched (cian/serp.py is not migrated yet, separate F4b issue).
2026-07-04 09:38:43 +03:00
..
orchestration fix(tradein/scraper-kit): проброс config= в pipeline.py::fetch_newbuilding call 2026-07-04 03:12:08 +03:00
pricing refactor(scraper-kit): unify price bisection engine across providers + dedup (#2134) 2026-07-02 16:41:04 +00:00
providers refactor(tradein/scraper-kit): yandex providers on shared _base.py (#2363) 2026-07-04 09:38:43 +03:00
__init__.py feat(scraper-kit): copy core layer (base/save_listings/transport) with protocol injection, strangler (#2132) 2026-07-02 15:43:15 +00:00
avito_exceptions.py feat(scraper-kit): copy core layer (base/save_listings/transport) with protocol injection, strangler (#2132) 2026-07-02 15:43:15 +00:00
base.py fix(tradein/scrapers): bump scraped_at при ре-подтверждении живым + бэкфилл (#2206) (#2224) 2026-07-02 20:30:01 +00:00
browser_fetcher.py feat(proxy-pool): P4 — browser dynamic pool-proxy (acquire→/fetch→relaunch) + orchestration wiring, ship-dark (#2164) 2026-07-02 19:20:29 +00:00
cian_state_parser.py feat(scraper-kit): copy core layer (base/save_listings/transport) with protocol injection, strangler (#2132) 2026-07-02 15:43:15 +00:00
contracts.py feat(proxy-pool): P4 — browser dynamic pool-proxy (acquire→/fetch→relaunch) + orchestration wiring, ship-dark (#2164) 2026-07-02 19:20:29 +00:00
domclick_exceptions.py feat(scraper-kit): copy core layer (base/save_listings/transport) with protocol injection, strangler (#2132) 2026-07-02 15:43:15 +00:00
geo.py feat(scraper-kit): copy avito providers with protocol injection, strangler (#2133 avito) 2026-07-02 15:58:00 +00:00
house_type_normalizer.py feat(scraper-kit): copy cian providers with protocol injection, strangler (#2133 cian) 2026-07-02 16:11:31 +00:00
price_brackets.py feat(scraper-kit): copy core layer (base/save_listings/transport) with protocol injection, strangler (#2132) 2026-07-02 15:43:15 +00:00
py.typed chore(scraper-kit): scaffold internal package + uv workspace, build-safe (#2128) 2026-07-02 14:06:07 +00:00
repair_state_normalizer.py feat(scraper-kit): copy core layer (base/save_listings/transport) with protocol injection, strangler (#2132) 2026-07-02 15:43:15 +00:00
snapshot_writer.py feat(scraper-kit): copy core layer (base/save_listings/transport) with protocol injection, strangler (#2132) 2026-07-02 15:43:15 +00:00
yandex_helpers.py feat(scraper-kit): copy core layer (base/save_listings/transport) with protocol injection, strangler (#2132) 2026-07-02 15:43:15 +00:00