v20260104-14-reports-stats-total-runs-success-rate-fix #28

Merged
ivooskamp merged 22 commits from v20260104-14-reports-stats-total-runs-success-rate-fix into main 2026-01-13 10:59:39 +01:00
3 changed files with 17 additions and 5 deletions
Showing only changes of commit 985397afa1 - Show all commits

View File

@ -1 +1 @@
v20260104-02-reports-html-content-and-success-rate-basis
v20260104-03-reports-html-view-selection-fix

View File

@ -1092,18 +1092,21 @@ def _export_html_response(report: ReportDefinition, report_id: int, view: str):
html_content = (pres.get("html_content") or "").strip().lower() or None
# Default behavior:
# - single customer: jobs (snapshot preview) is more useful
# - multiple/all: customers table is useful
# - honor selected view: Summary should not show Snapshot rows unless explicitly requested
# - when html_content is not set, pick a sensible default based on scope + view
scope = (getattr(report, "customer_scope", None) or "all").strip().lower()
if not html_content:
html_content = "jobs" if scope == "single" else "customers"
if scope == "single" and (view or "summary").strip().lower() == "summary":
html_content = "customers"
else:
html_content = "jobs" if scope == "single" else "customers"
include_customers = html_content in ("customers", "both")
include_jobs = html_content in ("jobs", "both")
# Snapshot preview table can be requested either explicitly via view=snapshot
# or via the report config (include_jobs).
want_snapshot_table = (view or "summary").strip().lower() == "snapshot" or include_jobs
want_snapshot_table = (view or "summary").strip().lower() == "snapshot"
snapshot_table_html = ""
if want_snapshot_table:

View File

@ -200,6 +200,15 @@
- Excluded non-selected statuses (such as Missed runs) from success rate calculations to avoid distorted results.
- Aligned success rate logic consistently across HTML output, PDF summaries, and report statistics.
---
## v20260104-03-reports-html-view-selection-fix
- Fixed HTML report generation to correctly respect the selected report view.
- When "Summary" is selected, the HTML output now renders the summary content instead of the snapshot with individual runs.
- Prevented unintended fallback to Snapshot view when generating HTML reports.
- Improved default behavior for single-customer summary reports to ensure a meaningful summary is displayed.
================================================================================================================================================
## v0.1.15