From f571d2362c03d843555d3f32555557d02b6e3485 Mon Sep 17 00:00:00 2001 From: Natalia Rybchenko Date: Thu, 11 Jun 2026 04:50:53 +0300 Subject: [PATCH 1/2] config: allow configuring default columns for run stats table Add `RUN_STATS_COLUMNS_DEFAULT` to the main project configuration schema. The setting accepts an array of column identifiers and controls which columns are displayed by default in the run stats table. All 13 available column names are enumerated in the schema with titles and descriptions for documentation purposes. The default value matches the previous hardcoded behaviour. Signed-off-by: Natalia Rybchenko --- bublik/data/schemas/per_conf.json | 85 +++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/bublik/data/schemas/per_conf.json b/bublik/data/schemas/per_conf.json index a4a88e7c..296a7be9 100644 --- a/bublik/data/schemas/per_conf.json +++ b/bublik/data/schemas/per_conf.json @@ -156,6 +156,91 @@ "uniqueItems": true, "default": ["Configuration"] }, + "RUN_STATS_COLUMNS_DEFAULT": { + "description": "Column names to display by default in the run stats table, in display order", + "type": "array", + "items": { + "type": "string", + "oneOf": [ + { + "const": "objective", + "title": "Objective", + "description": "Test objective" + }, + { + "const": "comments", + "title": "Notes", + "description": "User-provided comment for the test" + }, + { + "const": "total", + "title": "Total", + "description": "Total number of iterations" + }, + { + "const": "run", + "title": "Run", + "description": "Number of iterations actually run (all except skipped)" + }, + { + "const": "total_expected", + "title": "Expected Total", + "description": "Total number of expected iterations" + }, + { + "const": "passed", + "title": "Expected Passed", + "description": "Number of iterations that passed as expected" + }, + { + "const": "failed", + "title": "Expected Failed", + "description": "Number of iterations that failed as expected" + }, + { + "const": "total_unexpected", + "title": "Unexpected Total", + "description": "Total number of unexpected iterations" + }, + { + "const": "passed_unexpected", + "title": "Unexpected Passed", + "description": "Number of iterations that passed unexpectedly" + }, + { + "const": "failed_unexpected", + "title": "Unexpected Failed", + "description": "Number of iterations that failed unexpectedly" + }, + { + "const": "skipped", + "title": "Expected Skipped", + "description": "Number of iterations that were skipped as expected" + }, + { + "const": "skipped_unexpected", + "title": "Unexpected Skipped", + "description": "Number of iterations that were skipped unexpectedly" + }, + { + "const": "abnormal", + "title": "Abnormal", + "description": "Number of iterations that terminated abnormally" + } + ] + }, + "uniqueItems": true, + "default": [ + "run", + "passed", + "failed", + "passed_unexpected", + "failed_unexpected", + "skipped", + "skipped_unexpected", + "abnormal" + ] + }, "RUN_STATUS_META": { "description": "Represents meta name in meta_data.json that defines run status", "type": "string", From 54cc9bfa1ab3bcd0fa22465b4e6fba93ef9c828a Mon Sep 17 00:00:00 2001 From: Natalia Rybchenko Date: Thu, 11 Jun 2026 05:16:33 +0300 Subject: [PATCH 2/2] run: expose default run stats columns in stats API response Include the project-level default column configuration in the run stats API response alongside the existing results. The value is resolved from the main project config. Signed-off-by: Natalia Rybchenko --- bublik/interfaces/api_v2/results.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bublik/interfaces/api_v2/results.py b/bublik/interfaces/api_v2/results.py index 95ede3d7..13fac3a3 100644 --- a/bublik/interfaces/api_v2/results.py +++ b/bublik/interfaces/api_v2/results.py @@ -10,6 +10,7 @@ from rest_framework.viewsets import ModelViewSet from bublik.core.cache import RunCache +from bublik.core.config.services import ConfigServices from bublik.core.result import ResultService from bublik.core.run.services import RunsChartGroupBy, RunService from bublik.core.run.stats import ( @@ -17,6 +18,7 @@ generate_runs_details, ) from bublik.core.utils import get_difference +from bublik.data.models import GlobalConfigs, TestIterationResult from bublik.data.serializers import ( RunCommentSerializer, TestIterationResultSerializer, @@ -98,7 +100,17 @@ def details(self, _request, pk=None): @action(detail=True, methods=['get']) def stats(self, _request, pk=None): requirements = self.request.query_params.get('requirements') - return Response({'results': RunService.get_run_stats(pk, requirements)}) + project_id = TestIterationResult.objects.get(id=pk).project.id + return Response( + { + 'results': RunService.get_run_stats(pk, requirements), + 'default_columns': ConfigServices.getattr_from_global( + GlobalConfigs.PER_CONF.name, + 'RUN_STATS_COLUMNS_DEFAULT', + project_id, + ), + }, + ) @action(detail=True, methods=['get']) def requirements(self, _request, pk=None):