-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Detect duplicate rule IDs during config validation
Context
I loaded a config with two rules sharing the same id while testing a new pipeline, and the later rule silently replaced the first one. No error was raised, so I only noticed after chasing missing alerts.
Problem
Config.Validate never checks for duplicate rule IDs. The parser builds a map and overwrites earlier entries, so the config appears valid but runs with an incomplete rule set.
Expected behavior
Config validation should fail fast when two rules share an id, with a clear error message pointing to the duplicate.
Fail in Config.Validate (not at runtime).
Scope / non-goals
Just detect duplicates; don’t change the config schema or rework how rules are stored.
Acceptance criteria
- Validation returns an error when two rules use the same
id. - Configs with unique rule IDs still load successfully.
- A test covers the duplicate rule case.
Hints
Check Config.Validate in internal/config/config.go and add coverage in internal/config/config_test.go. Run go test ./internal/config.