feat: config validation improvements, wire DebugLogInterceptor#74
feat: config validation improvements, wire DebugLogInterceptor#74
Conversation
Config validation (4.1): - TLS file existence check via os.Stat - OTLP endpoint host:port format validation - Log level validation against known levels - Timeout vs shutdown duration sanity check DebugLogInterceptor wiring: - Add DisableDebugLogInterceptor and DebugLogHeaderName config fields - Wire to interceptors in processConfig - Update getCustomHeaderMatcher to variadic headers for HTTP support Also adds goleak.VerifyTestMain for goroutine leak detection.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR extends the configuration system with new interceptor and logging controls, adds comprehensive startup validation for TLS files, OTLP endpoint format, log levels, and gRPC timeout settings. It updates header matching logic to support multiple headers and adds goleak dependency for goroutine leak detection in tests. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR improves startup-time configuration validation, wires the new DebugLogInterceptor controls into the core interceptor setup, and adds goroutine leak detection for the core package test suite.
Changes:
- Added additional
Config.Validate()checks (TLS file existence, OTLPhost:portformatting, log level validation, and timeout vs shutdown sanity warning) plus new unit tests. - Wired
DisableDebugLogInterceptor/DebugLogHeaderNameintoprocessConfig()and forwarded the debug header from HTTP gateway to gRPC metadata via an updated header matcher. - Added
goleak.VerifyTestMainforcoretests and introducedgo.uber.org/goleakas a dependency.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| goleak_test.go | Adds a TestMain to verify goroutine leaks with documented ignores. |
| go.mod | Adds the go.uber.org/goleak dependency. |
| core.go | Wires DebugLogInterceptor config and forwards debug header via grpc-gateway header matcher. |
| config/config.go | Adds new config fields and validation warnings for common misconfigurations. |
| config/config_test.go | Adds tests covering the new config validation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review: use os.IsNotExist for "not found" vs general "could not be accessed" with error details. Add TestGetCustomHeaderMatcher_MultipleHeaders for variadic header matching.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Config validation (ROADMAP 4.1):
os.Statwhen both cert and key are sethost:portformat validation vianet.SplitHostPortDebugLogInterceptor wiring:
DisableDebugLogInterceptorbool andDebugLogHeaderNamestring config fieldsprocessConfig()getCustomHeaderMatcherto variadic headers — forwards debug log header from HTTP to gRPC metadata alongside trace headerGoroutine leak detection:
goleak.VerifyTestMainwith documented ignores for third-party singletonsDepends on: go-coldbrew/interceptors#38 (DebugLogInterceptor)
Test plan
make testandmake lintclean (tested with localreplacedirective for interceptors)Summary by CodeRabbit
Release Notes
New Features
Improvements
Dependencies