fix(ci): CD 修復 — shared-types 型別同步 + 測試冷啟動衝突
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:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user