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
Hints
Check Config.Validate in internal/config/config.go and add coverage in internal/config/config_test.go. Run go test ./internal/config.
Detect duplicate rule IDs during config validation
Context
I loaded a config with two rules sharing the same
idwhile 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.Validatenever 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
id.Hints
Check
Config.Validateininternal/config/config.goand add coverage ininternal/config/config_test.go. Rungo test ./internal/config.