fix: dev-poll.sh: redundant manual state exclusions alongside ci_passed (#113)

Add ci_failed() helper to lib/ci-helpers.sh and replace three compound
`! ci_passed && CI_STATE != "" && != "pending" && != "unknown"` patterns
in dev/dev-poll.sh with the cleaner ci_failed() call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-21 06:10:39 +00:00
parent 4dc29d2393
commit d29c6ad1c9
2 changed files with 17 additions and 3 deletions

View file

@ -66,6 +66,20 @@ ci_passed() {
return 1
}
# ci_failed <state> — check if CI has definitively failed
# Returns 0 if state indicates a real failure (not success, not pending,
# not unknown, not empty).
ci_failed() {
local state="$1"
if [ -z "$state" ] || [ "$state" = "pending" ] || [ "$state" = "unknown" ]; then
return 1
fi
if ci_passed "$state"; then
return 1
fi
return 0
}
# is_infra_step <step_name> <exit_code> [log_data]
# Checks whether a single CI step failure matches infra heuristics.
# Returns 0 (infra) with reason on stdout, or 1 (not infra).