Skip to content

Commit 870d33e

Browse files
authored
Handle empty target groups and improve dashboard deployment (#2)
* dashboard: handle empty target groups in plots Avoid failing dashboard generation when a target group has no data. If plot_cumulative_state() receives an empty DataFrame, write a small placeholder HTML page and return before computing timestamp ranges. This fixes Deploy-Dashboard failures such as: ValueError: max() iterable argument is empty for empty groups like gcv_zve. * ci: serialize dashboard deployments Add per-ref concurrency to Deploy-Dashboard and ignore dashboard-only pushes so dashboard auto-commits do not retrigger the workflow. This reduces non-fast-forward push races when multiple dashboard runs try to update main at the same time.
1 parent 5a985a4 commit 870d33e

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/deploy-dashboard.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ name: Deploy-Dashboard
33
on:
44
push:
55
branches: ["main"]
6+
paths-ignore:
7+
- "dashboard/**"
68
schedule:
79
- cron: 0 0,8,16 * * *
810
workflow_dispatch:
911

10-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
11-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
12+
# Serialize dashboard deployments on the same ref to reduce auto-commit push races.
13+
# Dashboard-only auto-commits are ignored by the push trigger below, so they do not
14+
# immediately retrigger this workflow.
1215
concurrency:
13-
group: "pages"
16+
group: deploy-dashboard-${{ github.ref }}
1417
cancel-in-progress: false
1518

1619
jobs:

dashboard/plot.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ def plot_cumulative_state(
6262
df: pd.DataFrame, outfile: str, wrap: int = 3, filtered: bool = False
6363
):
6464
suffix = " execution" if filtered else ""
65+
if df.empty:
66+
print(f"No data available for {outfile}; writing placeholder page")
67+
os.makedirs(os.path.dirname(outfile) or ".", exist_ok=True)
68+
with open(outfile, "w", encoding="utf-8") as f:
69+
f.write(
70+
"<!doctype html>\n"
71+
'<html><head><meta charset="utf-8">'
72+
"<title>No dashboard data</title></head>\n"
73+
"<body><h1>No dashboard data</h1>\n"
74+
"<p>No data is available for this target group.</p></body></html>\n"
75+
)
76+
return
77+
6578
range_max = max(df["hash_timestamp"]) + datetime.timedelta(hours=6)
6679

6780
range_min = max(df["hash_timestamp"]) - datetime.timedelta(days=9)

0 commit comments

Comments
 (0)