|
Some checks failed
CI Trade-In / changes (pull_request) Successful in 9s
CI / changes (pull_request) Successful in 10s
CI Trade-In / browser-tests (pull_request) Has been skipped
CI Trade-In / frontend-checks (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Failing after 2m34s
CI Trade-In / backend-tests (pull_request) Successful in 5m4s
CI / backend-tests (pull_request) Successful in 16m49s
Review-разбор ветки fix/tradein-uptime-honest-green:
1. [HIGH] Прод-симптом `HEAD gendsgn.ru/health -> 405` обслуживает Site
Finder (Caddyfile:60 `handle /health { reverse_proxy backend:8000 }`),
а предыдущий коммит правил только tradein-mvp/backend, чей /health наружу
не проксируется вообще. Добавлен @app.head("/health") в backend/app/main.py
рядом с существующим @app.get — эмпирически подтверждено (uv run pytest):
HEAD было 405, стало 200. tradein-mvp фикс не откачен (безвреден, годится
для будущего internal-caller), но обвязан комментарием, что реальный
прод-путь чинится не там.
2. [LOW] Response(status_code=200) без media_type отдавал HEAD без
Content-Type, тогда как GET отдаёт application/json — расходится с
заявленным в комментарии RFC 9110 §9.3.2. Добавлен media_type в обоих
бэкендах; Content-Length сознательно не подгоняем под байты GET-ответа
(payload header field, RFC разрешает опускать для HEAD) — не дублируем
сборку payload ради байт-в-байт соответствия.
Тесты: test_health_head_ok_no_body добавлен в backend/tests/test_health.py
(Site Finder) — RED-check (git stash app/main.py) воспроизводит прод-баг
1:1: assert 405 == 200. tradein-mvp/backend/tests/test_health_endpoint.py
дополнен проверкой Content-Type. uv run pytest — все зелёные.
|
||
|---|---|---|
| .. | ||
| api | ||
| fixtures | ||
| integration | ||
| scrapers | ||
| scripts | ||
| services | ||
| smoke | ||
| sql | ||
| workers | ||
| __init__.py | ||
| _sentry_wiring_probe.py | ||
| conftest.py | ||
| skip_allowlist.txt | ||
| test_admin_weight_profiles.py | ||
| test_app_logging.py | ||
| test_audit_middleware.py | ||
| test_auth_db.py | ||
| test_auth_session_guard.py | ||
| test_auth_session_service.py | ||
| test_concepts_stub.py | ||
| test_connection_capacity_loaders.py | ||
| test_eesk_reserve_loader.py | ||
| test_eias_heat_loader.py | ||
| test_ekb_geoportal_client.py | ||
| test_ekgas_outlet_loader.py | ||
| test_gas_grs_loader.py | ||
| test_gate_verdict.py | ||
| test_gisogd66_loader.py | ||
| test_health.py | ||
| test_layout_signature.py | ||
| test_layout_tz_html.py | ||
| test_layout_tz_pdf.py | ||
| test_network_obremenenie.py | ||
| test_network_zone_humanize.py | ||
| test_noise_loader.py | ||
| test_nspd_client.py | ||
| test_nspd_sync.py | ||
| test_ors_client.py | ||
| test_osm_tp_geocoder.py | ||
| test_osrm_client_local.py | ||
| test_ping.py | ||
| test_poi_score.py | ||
| test_quarter_dump_lookup.py | ||
| test_rbac.py | ||
| test_riasurt_sverdl_client.py | ||
| test_saturation.py | ||
| test_sentry_init.py | ||
| test_skip_guard_loud.py | ||
| test_utility_infrastructure_loader.py | ||
| test_velocity.py | ||
| test_weight_profiles.py | ||