fix(flywheel): Phase 1 — 部署 8be87b0 + debounce 30min + alertname NULL 修復
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 2m29s

ADR-073 Phase 1 三項修復:

1. k8s/kustomization.yaml: newTag a86ecf38be87b0
   - 解封 _collect_mcp_context + auto_approve + DESTRUCTIVE_PATTERNS
   - 這是飛輪解封的關鍵

2. webhooks.py: DEBOUNCE_WINDOW_MINUTES 5 → 30
   - 防止同一問題每 5 分鐘重建 Incident,改為 30 分鐘收斂窗口

3. incident_repository.py: signals JSONB 補充 alertname key
   - signal.model_dump() 只有 alert_name,DB query 用 signals->0->>'alertname'
   - 補充 alertname alias,修復 132 筆 incidents.alertname = NULL 根因

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-12 13:41:22 +08:00
parent a67a27f780
commit 7c4b36c2cd
3 changed files with 11 additions and 5 deletions

View File

@@ -462,8 +462,8 @@ async def verify_webhook_signature(
# generate_alert_fingerprint 已封裝為 AlertAnalyzer.generate_fingerprint (首席架構師 v1.2 2026-04-01 Asia/Taipei) # generate_alert_fingerprint 已封裝為 AlertAnalyzer.generate_fingerprint (首席架構師 v1.2 2026-04-01 Asia/Taipei)
# 戰略 B: 滑動時間窗 (5 分鐘) # 戰略 B: 滑動時間窗 (ADR-073: 5 分鐘改 30 分鐘,防同一問題反覆重建 Incident2026-04-12 ogt)
DEBOUNCE_WINDOW_MINUTES = 5 DEBOUNCE_WINDOW_MINUTES = 30
# ============================================================================= # =============================================================================

View File

@@ -65,7 +65,13 @@ def _incident_to_record_data(incident: Incident) -> dict[str, Any]:
"incident_id": incident.incident_id, "incident_id": incident.incident_id,
"status": incident.status.value, "status": incident.status.value,
"severity": incident.severity.value, "severity": incident.severity.value,
"signals": [s.model_dump() for s in incident.signals], "signals": [
{
**s.model_dump(),
"alertname": s.alert_name, # ADR-073: DB query 用 signals->0->>'alertname',補充 alias
}
for s in incident.signals
],
"affected_services": incident.affected_services, "affected_services": incident.affected_services,
"proposal_ids": incident.proposal_ids, "proposal_ids": incident.proposal_ids,
"created_at": incident.created_at, "created_at": incident.created_at,

View File

@@ -38,7 +38,7 @@ resources:
images: images:
- name: 192.168.0.110:5000/library/api:IMAGE_TAG_PLACEHOLDER - name: 192.168.0.110:5000/library/api:IMAGE_TAG_PLACEHOLDER
newName: 192.168.0.110:5000/awoooi/api newName: 192.168.0.110:5000/awoooi/api
newTag: a86ecf32a2e7be70b2d130fbadd9e9ad655ea5e1 newTag: 8be87b0f32a7430d86e93b9be63677c0e498bb79
- name: 192.168.0.110:5000/library/web:IMAGE_TAG_PLACEHOLDER - name: 192.168.0.110:5000/library/web:IMAGE_TAG_PLACEHOLDER
newName: 192.168.0.110:5000/awoooi/web newName: 192.168.0.110:5000/awoooi/web
newTag: a86ecf32a2e7be70b2d130fbadd9e9ad655ea5e1 newTag: 8be87b0f32a7430d86e93b9be63677c0e498bb79