fix(verification): align playbook and mcp evidence for canary alerts
All checks were successful
Code Review / ai-code-review (push) Successful in 18s
CD Pipeline / tests (push) Successful in 1m2s
CD Pipeline / build-and-deploy (push) Successful in 3m31s
CD Pipeline / post-deploy-checks (push) Successful in 1m39s

This commit is contained in:
Your Name
2026-05-14 00:21:39 +08:00
parent 42d0d076d6
commit b1ecb55bd6
3 changed files with 22 additions and 5 deletions

View File

@@ -21,7 +21,6 @@ import pytest
from src.plugins.mcp.interfaces import MCPTool, MCPToolProvider, MCPToolResult
from src.services.mcp_tool_registry import (
MCPToolRegistry,
RegisteredTool,
SensorDimension,
_classify_tool,
)
@@ -267,6 +266,16 @@ class TestSuggestTools:
assert "kubectl_describe" not in names
assert "prometheus_query" in names
def test_custom_alert_with_deployment_label_gets_k8s_tool(self):
registry = self._registry_with_tools()
tools = registry.suggest_tools(
alertname="AwoooPT16Canary",
incident_labels={"deployment": "awoooi-auto-repair-canary", "namespace": "awoooi-prod"},
)
names = [t.tool.name for t in tools]
assert "kubectl_describe" in names
assert "prometheus_query" in names
def test_empty_alertname_gets_generic_only(self):
registry = self._registry_with_tools()
tools = registry.suggest_tools(alertname="")