fix(cr): 首席架構師 CR P0/P1/P2 全修補
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled

P0-1: incident_service.py — 刪除 classify_alert_early 死碼 L131-132
P0-2: cron_backup_restore_test.sh — date +%s%3N→+%s,修正毫秒時間戳
P1-2: gitea_webhook.py — fingerprint 移除 sha_short,收斂同 branch 失敗
heartbeat: 還原原始空格對齊格式(統帥要求原本怎樣就怎樣)

P1-1(積木化)/P1-3(TYPE-4)/P2-1(timeZone)/P2-2(IP)/P2-3(WS重連) 待後續處理

2026-04-12 ogt
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-12 16:10:46 +08:00
parent d72c7d5ac4
commit a28625f088
4 changed files with 20 additions and 22 deletions

View File

@@ -30,7 +30,9 @@ velero restore create \
2>&1 || EXIT_CODE=$?
# --- 寫入 textfile metric ---
TS=$(date +%s%3N)
# 注意Prometheus textfile collector 不接受毫秒時間戳13位只接受秒10位
# 直接省略 timestamp由 node-exporter scrape 時自動補上
TS=$(date +%s)
mkdir -p "$(dirname "${TEXTFILE}")"
if [ "${EXIT_CODE}" -eq 0 ]; then
@@ -38,10 +40,10 @@ if [ "${EXIT_CODE}" -eq 0 ]; then
cat > "${TEXTFILE}" <<PROM
# HELP awoooi_backup_restore_test_success 1 = last backup restore dry-run succeeded
# TYPE awoooi_backup_restore_test_success gauge
awoooi_backup_restore_test_success 1 ${TS}
awoooi_backup_restore_test_success 1
# HELP awoooi_backup_restore_test_timestamp_seconds Unix timestamp of last test run
# TYPE awoooi_backup_restore_test_timestamp_seconds gauge
awoooi_backup_restore_test_timestamp_seconds $(date +%s) ${TS}
awoooi_backup_restore_test_timestamp_seconds ${TS}
PROM
echo "Textfile written: success"
exit 0
@@ -50,10 +52,10 @@ else
cat > "${TEXTFILE}" <<PROM
# HELP awoooi_backup_restore_test_success 1 = last backup restore dry-run succeeded
# TYPE awoooi_backup_restore_test_success gauge
awoooi_backup_restore_test_success 0 ${TS}
awoooi_backup_restore_test_success 0
# HELP awoooi_backup_restore_test_timestamp_seconds Unix timestamp of last test run
# TYPE awoooi_backup_restore_test_timestamp_seconds gauge
awoooi_backup_restore_test_timestamp_seconds $(date +%s) ${TS}
awoooi_backup_restore_test_timestamp_seconds ${TS}
PROM
echo "Textfile written: failure"
exit 1