refactor(eventrecorder): move configuration to eventrecorder package#5189
Conversation
Avoid import cycles when moving notifier configuration types from config to their own package in the future. Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
📝 WalkthroughWalkthroughConfiguration for the event recorder is consolidated by moving type definitions from the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
🧹 Nitpick comments (1)
eventrecorder/config.go (1)
14-23: Duplicate package doc comment.The same
// Package eventrecorder ...doc block already exists at the top ofeventrecorder/eventrecorder.go(lines 14–22). Having the package comment in two files risks future drift and is non-idiomatic; godoc will only surface one. Consider dropping it here (or consolidating both into a dedicateddoc.go).♻️ Proposed drop
-// Package eventrecorder provides a structured event recorder for -// significant Alertmanager events. Events are serialized as JSON and -// fanned out to one or more configured destinations (JSONL file, -// webhook, etc.). -// -// RecordEvent never blocks the caller: events are serialized and -// placed on a bounded in-memory queue. A background goroutine -// drains the queue and sends to destinations. If the queue is full, -// events are dropped and a metric is incremented. package eventrecorder🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@eventrecorder/config.go` around lines 14 - 23, Remove the duplicate package doc comment for package eventrecorder that appears in config.go; keep the canonical package comment only in the existing eventrecorder.go (or move both into a dedicated doc.go), and ensure you delete the top comment block beginning "// Package eventrecorder ..." from config.go so godoc isn’t duplicated and the package builds cleanly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@eventrecorder/config.go`:
- Around line 14-23: Remove the duplicate package doc comment for package
eventrecorder that appears in config.go; keep the canonical package comment only
in the existing eventrecorder.go (or move both into a dedicated doc.go), and
ensure you delete the top comment block beginning "// Package eventrecorder ..."
from config.go so godoc isn’t duplicated and the package builds cleanly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4f64b2ef-8b8c-42ec-8797-1bc4526af239
📒 Files selected for processing (6)
config/config.goeventrecorder/config.goeventrecorder/eventrecorder.goeventrecorder/eventrecorder_test.goeventrecorder/webhook.goeventrecorder/webhook_test.go
Pull Request Checklist
Which user-facing changes does this PR introduce?
Summary by CodeRabbit