fix(kanban): honor severity thresholds in diagnostics
Salvages #26431 by @LeonSGP43. Dashboard plugin_api list_diagnostics was using exact-match (severity == filter), so '--severity warning' hid 'error' and 'critical' diagnostics. Adds severity_at_or_above() helper to kanban_diagnostics and uses it in the dashboard endpoint (CLI already used SEVERITY_ORDER comparison correctly).
This commit is contained in:
@@ -737,3 +737,14 @@ def test_config_from_runtime_config_carries_aux_and_model():
|
||||
def test_config_from_runtime_config_handles_empty_input():
|
||||
assert kd.config_from_runtime_config(None) == {}
|
||||
assert kd.config_from_runtime_config({}) == {}
|
||||
|
||||
|
||||
def test_severity_at_or_above_uses_threshold_semantics():
|
||||
assert kd.severity_at_or_above("warning", "warning") is True
|
||||
assert kd.severity_at_or_above("error", "warning") is True
|
||||
assert kd.severity_at_or_above("critical", "warning") is True
|
||||
assert kd.severity_at_or_above("critical", "error") is True
|
||||
assert kd.severity_at_or_above("warning", "error") is False
|
||||
assert kd.severity_at_or_above("error", "critical") is False
|
||||
assert kd.severity_at_or_above("mystery", "warning") is False
|
||||
assert kd.severity_at_or_above("warning", None) is True
|
||||
|
||||
Reference in New Issue
Block a user