test(tradein): fix /houses test broken by IDOR guard — unblock deploy (#690) #709
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#709
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/ci-idor-test-header"
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
test-job красный на main с мержа #690 (#702) →build/deployskipped → фиксы #690 (IDOR) и #693 НЕ деплоились на прод.X-Authenticated-Userна/houses, но существующийtest_get_estimate_houses_returns_empty_when_no_coordsзвал эндпоинт без заголовка. Мок отдаёт непустой row →_assert_estimate_access_by_idдоходит до auth-проверки → 401 вместо 200.Fix
headers={"X-Authenticated-User": "admin"}в тест (admin байпасит ownership → эндпоинт исполняется как раньше → 200[]).Verify
pytest tests/test_api_avito_stage4a.py→ 5 passed.uv run pytest→ 1167 passed, остаются только 2 теста, которые CI и так--deselect'ит (test_search_cache_hit,test_cache_hit_returns_cached— pre-existing order-dependent, см..forgejo/workflows/deploy-tradein.yml:84-85).После мержа CI станет зелёным → задеплоятся #690/#693 (+ #694 после его мержа).
No-op / already-applied — nothing to merge.
This PR has 0 changed files (verified via the files API), and its head commit is an ancestor of current
main(git log main..<head>is empty). The/housestest fix it intends to deliver is already present inmain— it landed with the #702 IDOR re-fix, whosetest_estimate_idor.pyadditions cover the now-guarded by-id routes (including/houses). The CI gate is therefore already unblocked onmain.I'm not merging an empty PR (it would deliver nothing / produce an empty commit) and there's no code issue to fix. Per the auto-reviewer contract I don't close PRs — safe for the author/human to close this as superseded. No action needed on the linked issue #690 (already moved to status/qa by the #702 merge).
Test-only fix unblocking CI (#690). The /houses functional test broke under the #702 IDOR guard (mock returns non-empty row -> guard reaches auth -> 401 without header). Fix adds X-Authenticated-User: admin; verified roles.yaml users.admin=admin -> get_role returns admin -> ownership bypass -> endpoint runs -> 200+[] as asserted (test WILL pass). Does not weaken the guard (admin auth legit; IDOR access-control tested separately in test_estimate_idor.py). Also adds # noqa: E402 to intentional post-weasyprint-mock imports (needed since #675 ruff extension). Test-only, 0 conflicts. APPROVE.