feat: added slo duplicates check during validate #1
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.
I've noticed that if I pass a folder to sloth validate it allows SLO duplicates to exist.
When creating a new SLO sometemes I copy spec from existing specs and forgot to change names.
Sloth perfectly validates and generates rules in such cases. But it can lead to duplicates of recording rules, and unpredictable behaviour durind recording.
We can deploy rules as prom, k8s, and openslo. Prom and K8S are almost the same and have equal slo_id format -<slo.name>, but OpenSLO uses slightly different -<slo.name>-<seq_no>.
So it looks like better not to mix spec types for the same service.
But if I have a folder with specs of one type, e.g. Prom specs for CLI generation, I want to know about slo duplicates in a folder or multifile yml.
Issue slok#493