fix: Strict thinks Quiet Sev is an error #157
Merged
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.
When run with
--strict
today an error is reported even if it is a quiet issue, this will move quiet under warning so that will not trigger anymore.Fixed #156
Bug:
When you run the linter with --strict it reports failures even though from a ui perspective nothing is visible as a failure.
Analysis:
All of the Severity levels are iota based with Success being 0 and importantly Quiet being 4
https://github.com/grafana/dashboard-linter/blob/main/lint/lint.go#L11
The Results object is processed for MaximumSeverity and looks for the highest number based on iota: https://github.com/grafana/dashboard-linter/blob/main/lint/results.go#L160 which makes Quiet higher than the default Success so it is returned with the response of 4
Finally when strict is enabled, it will report errors for any level above Warning, https://github.com/grafana/dashboard-linter/blob/main/main.go#L91 which Quiet is, so errors are reported but they are not visible at all anywhere
Possible fixes:
Chosen fix: 2 - Change the iota and validate other tests don't fail