fix(auto): use action parser for repair gates
Some checks failed
CD Pipeline / tests (push) Failing after 1m2s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Code Review / ai-code-review (push) Successful in 24s

This commit is contained in:
Your Name
2026-04-30 14:06:09 +08:00
parent 9ee3cc6242
commit ed2a4838f2
11 changed files with 279 additions and 60 deletions

View File

@@ -62,18 +62,18 @@ class TestValidKubectlCommands:
"""常見合法 kubectl 指令應通過"""
assert validate_kubectl_command(cmd) is True
def test_kubectl_exec_with_psql(self):
"""kubectl exec 查詢(含 SQL SELECT→ 通過"""
def test_kubectl_exec_with_psql_is_not_auto_executable(self):
"""kubectl exec 可執行任意 shell必須降級人工"""
cmd = (
"kubectl exec -n awoooi-prod deployment/postgresql -- "
"psql -U postgres -c 'SELECT pg_terminate_backend(pid) FROM pg_stat_activity;'"
)
assert validate_kubectl_command(cmd) is True
assert validate_kubectl_command(cmd) is False
def test_kubectl_get_with_jq(self):
"""kubectl get + pipe → 通過"""
def test_compound_kubectl_get_is_not_auto_executable(self):
"""compound shell 指令必須降級人工"""
cmd = "kubectl get pods -n monitoring && curl -s http://192.168.0.120:9093/api/v1/status"
assert validate_kubectl_command(cmd) is True
assert validate_kubectl_command(cmd) is False
# =============================================================================