Wire main with config, db, auth, jellyfin adapter#16
Conversation
|
Claude finished @koinsaari's task in 2m 35s —— View job PR Review: Wire main with config, db, auth, jellyfin adapter
No blocking issues. SummaryThe PR is clean and well-structured. The Import cycle check ( JWT keyfunc ( SQL parameterization: ✅ All queries use 🟡 Nit 1 — Shutdown error silently dropped
_ = httpSrv.Shutdown(shutdownCtx)If graceful shutdown times out (connections don't drain within 10 s), the context deadline error is swallowed. Consider logging it so an ops team can tell the shutdown timed out: if err := httpSrv.Shutdown(shutdownCtx); err != nil {
logger.Error("shutdown", "err", err)
}🟡 Nit 2 —
|
Flatten db.Open to return *sql.DB directly (the DB wrapper struct had no methods and no second consumer). Add jellyfin.AsAuthAdapter to translate between the clients and auth packages without an import cycle. Replace the placeholder main.go with full wiring: config load, db open, Jellyfin client, auth service, HTTP server, graceful shutdown. Delete the toy healthz test superseded by internal/http tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @koinsaari's task in 1m 23s —— View job PR Review: Wire main with config, db, auth, jellyfin adapter
No blocking issues. Both nits from the previous review have been addressed. SummaryThe PR is clean and the follow-up changes are correct. The previous nits are fixed: the shutdown error is now logged ( Import cycle check ( JWT keyfunc ( SQL parameterization: ✅ All queries use
Test coverage for adapter: ✅ All three error translation paths and the happy path are covered for all three methods, including the previously missing |
Summary
db.Opento return*sql.DBdirectly — theDBwrapper struct had no methods and no second consumerjellyfin.AsAuthAdapterto bridge*jellyfin.Clienttoauth.JellyfinAuthenticator, translating all three error sentinels (ErrInvalidCredentials,ErrUpstreamUnavailable,ErrQuickConnectPending) at the package boundarymain.gowith full wiring: config load, db open, Jellyfin client + adapter, auth service, HTTP server, graceful shutdown on SIGINT/SIGTERMcmd/api-proxy/main_test.go— toy healthz test superseded byinternal/httptestsTest plan
grep -rn "db\.DB\b" --include="*.go" .— no matchesgo build ./...— clean, no import cyclesgo test -race -count=1 ./...— all pass locallygolangci-lint run ./...— 0 issuesdocker build -t api-proxy:ci .— succeeds🤖 Generated with Claude Code
Closes #12