monitoring(testing): make branch filter static

This commit is contained in:
jenkins 2026-05-20 15:10:24 -03:00
parent 974955ac83
commit f2ae3c1b0c
4 changed files with 82 additions and 15 deletions

View File

@ -601,6 +601,7 @@ PLATFORM_TEST_OVERVIEW_CATEGORY_REGEX = (
"performance|regression|reliability|security|smoke|system|ui" "performance|regression|reliability|security|smoke|system|ui"
) )
PLATFORM_TEST_SUPPORT_CATEGORY_REGEX = "fixtures|golden|helpers" PLATFORM_TEST_SUPPORT_CATEGORY_REGEX = "fixtures|golden|helpers"
PLATFORM_TEST_BRANCH_OPTIONS = ("main", "master", "origin/main", "origin/master", "unknown")
PLATFORM_TEST_RUNS_24H_ROLLUP = "platform_quality:suite_runs:increase_24h" PLATFORM_TEST_RUNS_24H_ROLLUP = "platform_quality:suite_runs:increase_24h"
PLATFORM_TEST_COVERAGE_ROLLUP = "platform_quality:suite_coverage_percent:latest_1h" PLATFORM_TEST_COVERAGE_ROLLUP = "platform_quality:suite_coverage_percent:latest_1h"
PLATFORM_TEST_SOURCE_FILES_ROLLUP = "platform_quality:suite_source_files_total:latest_1h" PLATFORM_TEST_SOURCE_FILES_ROLLUP = "platform_quality:suite_source_files_total:latest_1h"
@ -1495,19 +1496,28 @@ def testing_case_variable():
def testing_branch_variable(): def testing_branch_variable():
options = [
{
"text": branch,
"value": branch,
"selected": False,
}
for branch in PLATFORM_TEST_BRANCH_OPTIONS
]
query = ",".join(f"{branch} : {branch}" for branch in PLATFORM_TEST_BRANCH_OPTIONS)
return { return {
"name": "branch", "name": "branch",
"label": "Branch", "label": "Branch",
"type": "query", "type": "custom",
"query": f'label_values(platform_quality_gate_build_info{{suite=~"${{suite:regex}}",branch!="",{PLATFORM_TEST_EXPORT_FILTER}}}, branch)', "query": query,
"current": {"text": "All", "value": "$__all", "selected": True}, "current": {"text": "All", "value": "$__all", "selected": True},
"options": [], "options": options,
"hide": 0, "hide": 0,
"multi": False, "multi": False,
"includeAll": True, "includeAll": True,
"allValue": ".*", "allValue": ".*",
"refresh": 2, "refresh": 0,
"sort": 1, "sort": 0,
"skipUrlSync": False, "skipUrlSync": False,
} }

View File

@ -225,6 +225,11 @@ def test_jobs_dashboard_separates_current_gate_health_from_reliability():
assert "platform_quality:test_case_health_rate:percent_1h" in test_variable["query"] assert "platform_quality:test_case_health_rate:percent_1h" in test_variable["query"]
assert "platform_quality_gate_test_case_result" not in test_variable["query"] assert "platform_quality_gate_test_case_result" not in test_variable["query"]
assert test_variable["regex"] == '/test="([^"]+)"/' assert test_variable["regex"] == '/test="([^"]+)"/'
branch_variable = variables_by_name["branch"]
assert branch_variable["type"] == "custom"
assert branch_variable["allValue"] == ".*"
assert "platform_quality_gate_build_info" not in branch_variable["query"]
assert "origin/main : origin/main" in branch_variable["query"]
assert "Current Gate Health (%)" in panels_by_title assert "Current Gate Health (%)" in panels_by_title
assert "Suite Freshness (24h)" in panels_by_title assert "Suite Freshness (24h)" in panels_by_title

View File

@ -4787,20 +4787,46 @@
{ {
"name": "branch", "name": "branch",
"label": "Branch", "label": "Branch",
"type": "query", "type": "custom",
"query": "label_values(platform_quality_gate_build_info{suite=~\"${suite:regex}\",branch!=\"\",exported_job=\"platform-quality-ci\"}, branch)", "query": "main : main,master : master,origin/main : origin/main,origin/master : origin/master,unknown : unknown",
"current": { "current": {
"text": "All", "text": "All",
"value": "$__all", "value": "$__all",
"selected": true "selected": true
}, },
"options": [], "options": [
{
"text": "main",
"value": "main",
"selected": false
},
{
"text": "master",
"value": "master",
"selected": false
},
{
"text": "origin/main",
"value": "origin/main",
"selected": false
},
{
"text": "origin/master",
"value": "origin/master",
"selected": false
},
{
"text": "unknown",
"value": "unknown",
"selected": false
}
],
"hide": 0, "hide": 0,
"multi": false, "multi": false,
"includeAll": true, "includeAll": true,
"allValue": ".*", "allValue": ".*",
"refresh": 2, "refresh": 0,
"sort": 1, "sort": 0,
"skipUrlSync": false "skipUrlSync": false
}, },
{ {

View File

@ -4796,20 +4796,46 @@ data:
{ {
"name": "branch", "name": "branch",
"label": "Branch", "label": "Branch",
"type": "query", "type": "custom",
"query": "label_values(platform_quality_gate_build_info{suite=~\"${suite:regex}\",branch!=\"\",exported_job=\"platform-quality-ci\"}, branch)", "query": "main : main,master : master,origin/main : origin/main,origin/master : origin/master,unknown : unknown",
"current": { "current": {
"text": "All", "text": "All",
"value": "$__all", "value": "$__all",
"selected": true "selected": true
}, },
"options": [], "options": [
{
"text": "main",
"value": "main",
"selected": false
},
{
"text": "master",
"value": "master",
"selected": false
},
{
"text": "origin/main",
"value": "origin/main",
"selected": false
},
{
"text": "origin/master",
"value": "origin/master",
"selected": false
},
{
"text": "unknown",
"value": "unknown",
"selected": false
}
],
"hide": 0, "hide": 0,
"multi": false, "multi": false,
"includeAll": true, "includeAll": true,
"allValue": ".*", "allValue": ".*",
"refresh": 2, "refresh": 0,
"sort": 1, "sort": 0,
"skipUrlSync": false "skipUrlSync": false
}, },
{ {