fix(ops): classify cold-start warning-only quick checks [skip ci]

This commit is contained in:
ogt
2026-06-25 15:07:47 +08:00
parent bde6d83da5
commit 4abd654e52
5 changed files with 81 additions and 15 deletions

View File

@@ -181,17 +181,39 @@ done
if [[ "$RUN_COLD_START" -eq 1 ]]; then
section "Cold-start scorecard"
cold_tmp="$(mktemp -t post-start-cold-start.XXXXXX)"
cold_rc=0
if bash "$ROOT_DIR/scripts/reboot-recovery/full-stack-cold-start-check.sh" --monitor-read-only --no-color --watch --interval 1 --max-attempts 1 >"$cold_tmp" 2>&1; then
ok "cold-start command exited 0"
cold_rc=0
else
blocked "cold-start command returned non-zero"
cold_rc=$?
fi
cat "$cold_tmp"
cold_summary="$(grep -E 'PASS=[0-9]+ WARN=[0-9]+ BLOCKED=[0-9]+' "$cold_tmp" | tail -n 1 || true)"
if [[ -n "$cold_summary" ]]; then
ok "cold-start summary: $cold_summary"
cold_warn=0
cold_blocked=0
if [[ "$cold_summary" =~ WARN=([0-9]+) ]]; then
cold_warn="${BASH_REMATCH[1]}"
fi
if [[ "$cold_summary" =~ BLOCKED=([0-9]+) ]]; then
cold_blocked="${BASH_REMATCH[1]}"
fi
if [[ "$cold_blocked" -gt 0 ]]; then
blocked "cold-start has blockers: $cold_summary"
elif [[ "$cold_warn" -gt 0 ]]; then
service_warn "cold-start is warning-only, not blocked: $cold_summary"
elif [[ "$cold_rc" -eq 0 ]]; then
ok "cold-start command exited 0"
else
evidence_warn "cold-start exited $cold_rc but summary has no blockers: $cold_summary"
fi
else
service_warn "cold-start summary not found"
if [[ "$cold_rc" -eq 0 ]]; then
service_warn "cold-start summary not found"
else
blocked "cold-start command returned $cold_rc without summary"
fi
fi
rm -f "$cold_tmp"
fi