fix: production hardening, test coverage, and GitHub App JWT#1
Merged
Conversation
Fix all P0-P2 issues from code review: - Fix API route prefix duplication (routes were 404ing) - Add http.Flusher to metrics statusRecorder (SSE was broken) - Add sync.RWMutex for config mutation race condition - Add HTTP server timeouts (Read/Write/Idle) - Add request body size limit on POST endpoints - Normalize Prometheus path labels to prevent cardinality explosion - Enable PRAGMA foreign_keys in SQLite tenant/apikey stores - Remove query param API key auth (leak risk) - Fix auth error responses to use application/json - Guard daemon Stop() with sync.Once against double-close panic - Replace os.Exit(0) with signal.NotifyContext for clean shutdown - Make listServices fetch releases concurrently - Log store write errors in daemon instead of swallowing - Handle time.Parse and LastInsertId errors in providers/tenant - Implement real RS256 JWT for GitHub App (golang-jwt/jwt/v5) - Add 83 tests across 8 new test files (api, tenant, errors, githubapp, metrics, model, logging, ratelimit) - Enable Homebrew formula in goreleaser - Add ADR-0001 documenting all decisions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove WriteTimeout (was 60s) to avoid killing long-lived SSE connections; rely on ReadTimeout + IdleTimeout instead - Fix golang-jwt/jwt/v5 go.mod marker from indirect to direct - Use json.Marshal in writeJSONError to prevent invalid JSON from unescaped quotes in error messages - Cap unknown path labels at 3 segments and collapse /dashboard/* to prevent Prometheus cardinality explosion on all routes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add CLAUDE.md with project conventions, build commands, and architecture - Enable Codecov coverage upload in CI workflow - Add CLI tests for version, init, check, help, and parseOwnerRepo - Fix stdout capture for version command test (fmt.Printf → os.Pipe) - Fix config loading in check test (use temp nonexistent config path) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Check os.Pipe() and buf.ReadFrom() return values in CLI tests - Update ADR-0001 to reflect no WriteTimeout (SSE compatibility) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
golang-jwt/jwt/v5(replaces non-functional stub).goreleaser.ymlChanges
api.go,metrics.go,server.goserver.go,api.go,metrics.go,tenant.go,apikey.go,auth.godaemon.go,serve.go,api.gogithub.go,gitlab.go,tenant.go,daemon.goapp.go*_test.gofilesdocs/adr/0001-production-hardening.md.goreleaser.ymlTest plan
go build ./...passesgo test ./... -count=1— all 21 suites passgo vet ./...— cleangofmt— clean🤖 Generated with Claude Code