Repository navigation
feat(phase-17): hardening and refactors (pipeline and gateway) - #79
Merged
Merged
Conversation
aggregate errors/warnings from go modules, python services and frontend in one copy-friendly report; strict config mirrors zed gopls settings (full staticcheck checks + govet shadow) so output matches IDE diagnostics
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 17 — hardening and refactors (pipeline and gateway), P1 scope
Closes #63
Closes #52
Closes #54
Closes #51
Implemented
pkg/(go.work): AuthMiddleware/OptionalAuth, логгер, метрики, WriteJSON сhttp.Flusher, bootstraphttp.Serverс таймаутами и graceful shutdown по SIGTERM (SHUTDOWN_GRACE), таймауты у исходящих клиентов; версии Go-сервисов выровнены (go 1.25.0, jwt v5.3.1, minio v7.3.0); Dockerfiles/compose-контексты пересобраны под общий модуль; gateway/upload не рвут in-flight загрузки (stop_grace_period: 5m).*+ credentials убраны — явный allowlist изCORS_ALLOWED_ORIGINS(чужой origin не получает ACAO); rate-limit переведён на Redis (атомарный Lua fixed-window), ключ — проверенный client IP; XFF/X-Real-IP доверяются только отTRUSTED_PROXY_CIDRS(дефолт пустой — gateway является edge, ревью M1); auth slowapi ключует поX-Real-IPот gateway, но только от доверенного пира + порт auth публикуется только на 127.0.0.1 (ревью H1).http.Clientс пулом вместо клиента на каждый сегмент; LRU-кешvideo_id→meta(TTL 10s) + negative-cache 404/403 (TTL 5s), 4096 записей; 200 сегментов → ~1 запрос в metadata, смена visibility видна ≤15s._kill_and_reap(SIGKILL + wait) по try/finally при ошибке стрима/таймауте — зомби не копятся;_HeartbeatKeeperдержит pika-соединение во время длинных транскодов (600s heartbeat vs 900s×3 ffmpeg); ack/publish только после гарантированной остановки heartbeat-потока (ревью M2).GET /api/v1/videosотдавал 500 всем (uuid = text, SQLSTATE 42883) с коммита 3a1a5bc;$3::uuid+ шагvideo list 200в e2e..golangci.strict.yaml) чист: package comments, shadow.Вне скоупа (не в PR)
P2-задачи фазы не реализованы и остались в Backlog: #55 (redis requirepass), #57 (atomic UPDATE), #58 (validate before insert), #59 (upload JSON errors), #62 (argv builder). #50 был закрыт ранее (PR #78).
Acceptance criteria
make lint-go && make test-goзелёные; деплой не обрывает in-flight загрузки (graceful shutdown + SHUTDOWN_GRACE < stop_grace_period)Verification
make lint-go— 0 issues (4 модуля),make lint-py,make lint-front— чистоmake -f Makefile lint-report(strict) — 0 issuesmake test-go— 12 пакетов ok;make test-py— auth 22, transcoder 32 passedmake up— все сервисы healthy;make e2e— PASS (включая новый list-check)Review
Remaining risks