Auto-commit local changes before build (2026-01-04 16:02:09)
This commit is contained in:
parent
fc275a0285
commit
fdeeaef0e6
@ -1 +1 @@
|
||||
v20260104-09-reports-html-total-runs-selection-and-jobs-text-column-remove
|
||||
v20260104-10-reports-html-export-fix-stats-view-and-total-runs
|
||||
|
||||
@ -870,11 +870,15 @@ def _compute_success_rate(success: int, warning: int, failed: int, missed: int,
|
||||
|
||||
|
||||
|
||||
def _build_report_stats_payload(report_id: int) -> dict:
|
||||
def _build_report_stats_payload(report_id: int, view_key: str = "summary") -> dict:
|
||||
"""Compute summary and chart datasets for a generated report."""
|
||||
report = ReportDefinition.query.get_or_404(report_id)
|
||||
|
||||
include_keys = _get_success_rate_keys_from_report(report, view_key=view)
|
||||
view_key = (view_key or "summary").strip().lower()
|
||||
if view_key not in ("summary", "snapshot", "jobs"):
|
||||
view_key = "summary"
|
||||
|
||||
include_keys = _get_success_rate_keys_from_report(report, view_key=view_key)
|
||||
|
||||
with db.engine.connect() as conn:
|
||||
status_rows = conn.execute(
|
||||
@ -1060,7 +1064,11 @@ def api_reports_stats(report_id: int):
|
||||
if err is not None:
|
||||
return err
|
||||
|
||||
return _build_report_stats_payload(report_id)
|
||||
view = (request.args.get("view") or "summary").strip().lower()
|
||||
if view not in ("summary", "snapshot", "jobs"):
|
||||
view = "summary"
|
||||
|
||||
return _build_report_stats_payload(report_id, view_key=view)
|
||||
|
||||
|
||||
|
||||
@ -1197,7 +1205,7 @@ def _export_csv_response(report: ReportDefinition, report_id: int, view: str):
|
||||
|
||||
|
||||
def _export_html_response(report: ReportDefinition, report_id: int, view: str):
|
||||
stats = _build_report_stats_payload(report_id)
|
||||
stats = _build_report_stats_payload(report_id, view_key=view)
|
||||
summary = stats.get("summary") or {}
|
||||
charts = stats.get("charts") or {}
|
||||
trends = charts.get("trends") or []
|
||||
|
||||
@ -264,6 +264,14 @@
|
||||
- Fixed “Total runs” to only sum the selected status counters (e.g. excluding missed when it’s not selected), instead of using the raw total that included missed runs.
|
||||
- Removed the duplicate “Text” column from the Jobs report view by excluding `object_name` from the Jobs column set and Jobs defaults.
|
||||
|
||||
---
|
||||
|
||||
## v20260104-10-reports-html-export-fix-stats-view-and-total-runs
|
||||
|
||||
### Changed
|
||||
- Fixed an internal server error when downloading HTML reports by correctly passing the selected view to the stats builder and stats API endpoint.
|
||||
- Updated the Total runs calculation in the HTML summary to only count run statuses that are selected in the active view.
|
||||
- Prevented non-selected statuses (such as missed) from being included in the Total runs calculation.
|
||||
|
||||
================================================================================================================================================
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user