From f48ed0cd7d0783cbf5b11443cedd4611632946c6 Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 17 May 2026 18:26:57 -0300 Subject: [PATCH] monitoring(testing): restrict category panels to taxonomy --- scripts/dashboards_render_atlas.py | 8 ++++++-- scripts/tests/test_dashboards_render_atlas.py | 4 +++- services/monitoring/dashboards/atlas-overview.json | 2 +- services/monitoring/dashboards/atlas-testing.json | 2 +- services/monitoring/grafana-dashboard-overview.yaml | 2 +- services/monitoring/grafana-dashboard-testing.yaml | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index a3987dda..e9bffdeb 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -574,6 +574,10 @@ PLATFORM_TEST_SUITE_MATCHER = "|".join( ) PLATFORM_TEST_SUITE_CANONICAL_MATCHER = "|".join(PLATFORM_TEST_SUITE_NAMES) PLATFORM_TEST_SUITE_VARIABLE_ALL_MATCHER = PLATFORM_TEST_SUITE_CANONICAL_MATCHER +PLATFORM_TEST_CATEGORY_REGEX = ( + "api|chaos|compatibility|component|contract|e2e|integration|manual|" + "performance|regression|reliability|security|smoke|system|ui|unit" +) PLATFORM_TEST_SUPPORT_CATEGORY_REGEX = "fixtures|golden|helpers" PLATFORM_TEST_SUCCESS_EVENTS_30D = ( f'(sum(increase(platform_quality_gate_runs_total{{suite=~"{PLATFORM_TEST_SUITE_MATCHER}",status=~"{PLATFORM_TEST_SUCCESS_STATUS}",{PLATFORM_TEST_EXPORT_FILTER}}}[30d])) or on() vector(0))' @@ -2067,7 +2071,7 @@ def build_overview(): overview_category_pass_rate = ( 'avg by (category) (platform_quality:test_case_pass_rate:percent_1h{' f'suite=~"{PLATFORM_TEST_SUITE_CANONICAL_MATCHER}",branch!="",branch=~"main|master|origin/main|origin/master",' - f'test!="",test!="__no_test_cases__",category!="",category!~"uncategorized|{PLATFORM_TEST_SUPPORT_CATEGORY_REGEX}"' + f'test!="",test!="__no_test_cases__",category=~"{PLATFORM_TEST_CATEGORY_REGEX}"' "})" ) for panel_id, title, draw_expr, runtime_expr, y_pos in [ @@ -3968,7 +3972,7 @@ def build_jobs_dashboard(): category_pass_rate_history = ( f'avg by (category) (platform_quality:test_case_pass_rate:percent_1h{{suite=~"{suite_var}",' f'branch!="",branch=~"{branch_var}",test!="",test!="__no_test_cases__",' - f'category!="",category!~"{PLATFORM_TEST_SUPPORT_CATEGORY_REGEX}"}})' + f'category=~"{PLATFORM_TEST_CATEGORY_REGEX}"}})' ) recent_branch_evidence = ( f'sort_desc(count by (suite, branch) (max_over_time(platform_quality_gate_build_info{{{build_info_selector}}}[30d])))' diff --git a/scripts/tests/test_dashboards_render_atlas.py b/scripts/tests/test_dashboards_render_atlas.py index 1b3cc09e..98ee3838 100644 --- a/scripts/tests/test_dashboards_render_atlas.py +++ b/scripts/tests/test_dashboards_render_atlas.py @@ -77,6 +77,7 @@ def test_overview_uses_readable_quality_power_and_gitops_panels(): assert panels_by_title["Test Category Pass Rate"]["targets"][0]["legendFormat"] == "{{category}}" assert "${overview_suite:regex}" not in panels_by_title["Test Category Pass Rate"]["targets"][0]["expr"] assert mod.PLATFORM_TEST_SUITE_CANONICAL_MATCHER in panels_by_title["Test Category Pass Rate"]["targets"][0]["expr"] + assert f'category=~"{mod.PLATFORM_TEST_CATEGORY_REGEX}"' in panels_by_title["Test Category Pass Rate"]["targets"][0]["expr"] assert panels_by_title["UPS History (Power Draw)"]["gridPos"] == {"h": 6, "w": 6, "x": 3, "y": 7} assert panels_by_title["Ariadne Run Volume"]["gridPos"] == {"h": 6, "w": 6, "x": 9, "y": 7} assert panels_by_title["Pyrphoros UPS Current"]["gridPos"]["w"] == 3 @@ -245,7 +246,8 @@ def test_jobs_dashboard_separates_current_gate_health_from_reliability(): category_panel = panels_by_title["Test Category Pass Rate History"] assert category_panel["type"] == "state-timeline" assert "category" in category_panel["targets"][0]["expr"] - assert 'category!~"fixtures|golden|helpers"' in category_panel["targets"][0]["expr"] + assert f'category=~"{mod.PLATFORM_TEST_CATEGORY_REGEX}"' in category_panel["targets"][0]["expr"] + assert "installer" not in mod.PLATFORM_TEST_CATEGORY_REGEX assert "Use the Suite filter" in category_panel["description"] assert "category-aware results" in category_panel["description"] diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index e085bf6d..b781cbc1 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -2809,7 +2809,7 @@ }, "targets": [ { - "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"ariadne|metis|ananke|atlasbot|lesavka|pegasus|soteria|titan_iac|typhon|bstein_home|data_prepper\",branch!=\"\",branch=~\"main|master|origin/main|origin/master\",test!=\"\",test!=\"__no_test_cases__\",category!=\"\",category!~\"uncategorized|fixtures|golden|helpers\"})", + "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"ariadne|metis|ananke|atlasbot|lesavka|pegasus|soteria|titan_iac|typhon|bstein_home|data_prepper\",branch!=\"\",branch=~\"main|master|origin/main|origin/master\",test!=\"\",test!=\"__no_test_cases__\",category=~\"api|chaos|compatibility|component|contract|e2e|integration|manual|performance|regression|reliability|security|smoke|system|ui|unit\"})", "refId": "A", "legendFormat": "{{category}}" } diff --git a/services/monitoring/dashboards/atlas-testing.json b/services/monitoring/dashboards/atlas-testing.json index 52833f5b..9d060f97 100644 --- a/services/monitoring/dashboards/atlas-testing.json +++ b/services/monitoring/dashboards/atlas-testing.json @@ -916,7 +916,7 @@ }, "targets": [ { - "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"${suite:regex}\",branch!=\"\",branch=~\"${branch:regex}\",test!=\"\",test!=\"__no_test_cases__\",category!=\"\",category!~\"fixtures|golden|helpers\"})", + "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"${suite:regex}\",branch!=\"\",branch=~\"${branch:regex}\",test!=\"\",test!=\"__no_test_cases__\",category=~\"api|chaos|compatibility|component|contract|e2e|integration|manual|performance|regression|reliability|security|smoke|system|ui|unit\"})", "refId": "A", "legendFormat": "{{category}}" } diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index 3e414783..38a147fa 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -2818,7 +2818,7 @@ data: }, "targets": [ { - "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"ariadne|metis|ananke|atlasbot|lesavka|pegasus|soteria|titan_iac|typhon|bstein_home|data_prepper\",branch!=\"\",branch=~\"main|master|origin/main|origin/master\",test!=\"\",test!=\"__no_test_cases__\",category!=\"\",category!~\"uncategorized|fixtures|golden|helpers\"})", + "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"ariadne|metis|ananke|atlasbot|lesavka|pegasus|soteria|titan_iac|typhon|bstein_home|data_prepper\",branch!=\"\",branch=~\"main|master|origin/main|origin/master\",test!=\"\",test!=\"__no_test_cases__\",category=~\"api|chaos|compatibility|component|contract|e2e|integration|manual|performance|regression|reliability|security|smoke|system|ui|unit\"})", "refId": "A", "legendFormat": "{{category}}" } diff --git a/services/monitoring/grafana-dashboard-testing.yaml b/services/monitoring/grafana-dashboard-testing.yaml index f043a1b3..8b8186e9 100644 --- a/services/monitoring/grafana-dashboard-testing.yaml +++ b/services/monitoring/grafana-dashboard-testing.yaml @@ -925,7 +925,7 @@ data: }, "targets": [ { - "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"${suite:regex}\",branch!=\"\",branch=~\"${branch:regex}\",test!=\"\",test!=\"__no_test_cases__\",category!=\"\",category!~\"fixtures|golden|helpers\"})", + "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"${suite:regex}\",branch!=\"\",branch=~\"${branch:regex}\",test!=\"\",test!=\"__no_test_cases__\",category=~\"api|chaos|compatibility|component|contract|e2e|integration|manual|performance|regression|reliability|security|smoke|system|ui|unit\"})", "refId": "A", "legendFormat": "{{category}}" }