fix(tradein): repoint rosreestr_poll to /data-sets/ + verify Content-Type (СДЕЛКИ dataset moved off /opendata) #2477
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#2477
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/rosreestr-poll-datasets-repoint"
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?
Summary
/opendata/(Bitrix redesign). The old flat dataset URLhttps://rosreestr.gov.ru/opendata/dataset_СДЕЛКИ_...csv.zipnow returns HTTP 200 with Content-Type: text/html (soft-404) instead of 404, socheck_new_quarter_available()was falsely reporting every quarter as available./opendata/f.jsonalso no longer serves JSON.https://rosreestr.gov.ru/data-sets/:"{quarter} квартал {year}г.".dataset_СДЕЛКИ_r-r_01-92_y_{year}_q_{quarter}.csv.ziphref the same way.Content-Type: application/zipandContent-Length > 100 KB. A bare HTTP 200 is no longer sufficient (that was the soft-404 bug).User-Agentand usesverify=False(RU TLS root CA not in the default trust store) — same pattern already used bysber_index.py(#922) for the analogoussberindex.ruissue.rosreestr_dataset_url()now builds a best-effort cp1251-encoded link into/data-sets/for the alert message (verified byte-for-byte against the live portal); detection itself never depends on this guessed URL, only on parsing the real autoindex.poll_rosreestr_new_quarter()return dict shape are unchanged, soapp/tasks/rosreestr_quarter_poll.pyneeded no changes.data/sql/02_load_all_quarters.sh,tradein-mvp/deploy/import-rosreestr.sh) live outside this repo and still point at the old/opendata/base — the alert log message now calls this out explicitly so ops know to update them too.Test plan
uv run pytest -q tests/test_rosreestr_poll.py— 21 tests green, including a regression test assertingavailable=Falsefor an HTTP 200 +Content-Type: text/htmlresponse (the exact soft-404 bug), plus tests for real-zip true, tiny-Content-Length false, missing-folder false, missing-file false, and network/timeout error handling.uv run pytest -q tests/test_backtest_regression_gate.py— untouched, stays green (2 tests).ruff check/ruff format --check/ pre-commit — all green.https://rosreestr.gov.ru/data-sets/1%20%EA%E2%E0%F0%F2%E0%EB%202026%E3./dataset_%D1%C4%C5%CB%CA%C8_r-r_01-92_y_2026_q_1.csv.zip→ HTTP 200,Content-Type: application/zip, ~9.5MB.