fix(ci): CD 修復 — shared-types 型別同步 + 測試冷啟動衝突
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
Type Sync Check / check-type-sync (push) Successful in 1m2s

1. pnpm shared-types generate — 同步 Sprint 4 新增的 Pydantic model
2. test_evaluate_not_high_quality 修復 — 加 MEDIUM risk step 避免
   意外走冷啟動路徑 (Redis 未初始化 → COLD_START_DAILY_LIMIT)

11/11 auto_repair 測試通過

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-07 13:09:17 +08:00
parent 3a3f9cf70c
commit b20a619a3d
3 changed files with 58 additions and 2 deletions

View File

@@ -178,7 +178,7 @@ class TestAutoRepairService:
@pytest.mark.asyncio
async def test_evaluate_not_high_quality(self, service, mock_playbook_service):
"""Test when playbook is not high quality"""
"""Test when playbook is not high quality and not cold-start eligible (MEDIUM risk)"""
playbook = Playbook(
playbook_id="PB-LOW-QUALITY",
name="Low quality playbook",
@@ -188,7 +188,15 @@ class TestAutoRepairService:
alert_names=["HighCPU"],
affected_services=["test-service"],
),
repair_steps=[],
repair_steps=[
RepairStep(
step_number=1,
action_type=ActionType.KUBECTL,
command="kubectl rollout restart",
risk_level=RiskLevel.MEDIUM, # MEDIUM → 不符合冷啟動 (需 LOW)
description="restart deployment",
),
],
success_count=2, # < 3 (冷啟動門檻 2026-04-05)
failure_count=0,
)