fix(reboot): preserve ai triage blocker signal
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m17s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m17s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -202,15 +202,20 @@ probe_public_routes() {
|
||||
|
||||
run_ai_log_triage() {
|
||||
local triage_dir="${ARTIFACT_DIR}/ai-log-triage"
|
||||
local rc=0
|
||||
if [[ ! -x "${SCRIPT_DIR}/ai-log-triage-auto-recovery.sh" ]]; then
|
||||
finding "P0" "recovery" "AI_LOG_TRIAGE_SCRIPT_MISSING" "${SCRIPT_DIR}/ai-log-triage-auto-recovery.sh"
|
||||
return 1
|
||||
fi
|
||||
action "$MODE" "ai-log-triage" "RUN_AI_LOG_TRIAGE" "artifact_dir=${triage_dir}"
|
||||
"${SCRIPT_DIR}/ai-log-triage-auto-recovery.sh" "--${MODE}" --artifact-dir "$triage_dir" || {
|
||||
"${SCRIPT_DIR}/ai-log-triage-auto-recovery.sh" "--${MODE}" --artifact-dir "$triage_dir" || rc=$?
|
||||
if [[ "$rc" -ne 0 && "$rc" -ne 2 ]]; then
|
||||
finding "P0" "ai-log-triage" "AI_LOG_TRIAGE_FAILED" "see ${triage_dir}"
|
||||
return 1
|
||||
}
|
||||
fi
|
||||
if [[ "$rc" -eq 2 ]]; then
|
||||
event "INFO" "ai-log-triage" "AI_LOG_TRIAGE_REPORTED_FINDINGS rc=2"
|
||||
fi
|
||||
if [[ -s "${triage_dir}/findings.tsv" ]]; then
|
||||
awk -v now="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -F '\t' \
|
||||
'{print now "\t" $2 "\tai-log-triage\t" $1 "\thost=" $3 " evidence=" $4 " next_action=" $5}' \
|
||||
|
||||
@@ -194,6 +194,9 @@ def test_reboot_p0_contract_has_ai_log_triage_controlled_apply() -> None:
|
||||
assert "run_scorecard" in full_host_orchestrator
|
||||
assert "run_stock_upstream_gate_hint" in full_host_orchestrator
|
||||
assert "TELEGRAM_NOTIFY_SCRIPT" in full_host_orchestrator
|
||||
assert 'rc=$?' in full_host_orchestrator
|
||||
assert '"$rc" -ne 2' in full_host_orchestrator
|
||||
assert "AI_LOG_TRIAGE_REPORTED_FINDINGS" in full_host_orchestrator
|
||||
assert 'host=" $3 " evidence=" $4 " next_action=" $5' in full_host_orchestrator
|
||||
assert "/Users/ogt/" not in full_host_service
|
||||
assert "WorkingDirectory=/opt/awoooi/reboot-recovery" in full_host_service
|
||||
|
||||
Reference in New Issue
Block a user