fix(P0): classify_alert_early 參數名稱修正 _labels→labels
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled

webhooks.py 呼叫傳 labels= 但函數定義用 _labels,導致所有
Alertmanager webhook 500,告警鏈路完全中斷。

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:02:25 +08:00
parent 36f285fb85
commit d72c7d5ac4

View File

@@ -101,7 +101,7 @@ def extract_affected_services(labels: dict, target_resource: str) -> list[str]:
return []
def classify_alert_early(alertname: str, severity: str, _labels: dict) -> tuple[str, str]:
def classify_alert_early(alertname: str, severity: str, labels: dict | None = None) -> tuple[str, str]:
"""
ADR-073 Phase 2-2: 早期分診,在 LLM 分析前決定 alert_category + notification_type。
防止 HostBackupFailed 等告警被誤路由到 K8s executor。