From 4e2db1e2e0b1c90e93a7f72c68109c6dc63f3e0c Mon Sep 17 00:00:00 2001 From: Kit OC5 Date: Wed, 23 Sep 2026 13:06:20 -0400 Subject: [PATCH] push velocity: isolate its query so a failure never costs ci.run rows Co-Authored-By: Claude Opus 5.5 --- scripts/telemetry_emit.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/telemetry_emit.py b/scripts/telemetry_emit.py index c7998a9..0db5857 100644 --- a/scripts/telemetry_emit.py +++ b/scripts/telemetry_emit.py @@ -277,8 +277,14 @@ def main() -> int: } ) - pv_rows = sql(PV_QUERY.format(h1=int(now) - 3600, h24=int(now) - 86400)) - pv_events, pv_alerted = push_velocity_events(pv_rows, now, state.get("pv_alerted", {})) + # Isolated: a failing push-velocity query must never cost the ci.run rows. + pv_alerted = state.get("pv_alerted", {}) + try: + pv_rows = sql(PV_QUERY.format(h1=int(now) - 3600, h24=int(now) - 86400)) + pv_events, pv_alerted = push_velocity_events(pv_rows, now, pv_alerted) + except (subprocess.CalledProcessError, ValueError, KeyError) as e: + print(f"[telemetry] push velocity check FAILED (non-fatal): {type(e).__name__}") + pv_events = [] for e in pv_events: m = e["metadata"] print(f"[telemetry] WARNING push velocity: gitea user {m['gitea_user_id']} "