fix: address review feedback on escalation triage (#185)
- supervisor-poll.sh: check PR state before retrigger; discard stale escalations for closed/merged PRs instead of pushing to their branches - supervisor-poll.sh: bump escalation ts to now on failed retrigger push, so the 30-min cooldown resets and alert flooding is avoided on persistent failures - ci-helpers.sh: require at least one confirmed infra step before returning "infra"; prevents false-positive when all step names are empty strings - ci-helpers.sh: clarify header comment to distinguish per-function requirements - AGENTS.md: document classify_pipeline_failure() in ci-helpers.sh table row Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
47eccdb8ae
commit
97ffdca95c
3 changed files with 19 additions and 6 deletions
|
|
@ -2,7 +2,8 @@
|
|||
# ci-helpers.sh — Shared CI helper functions
|
||||
#
|
||||
# Source from any script: source "$(dirname "$0")/../lib/ci-helpers.sh"
|
||||
# Requires: WOODPECKER_REPO_ID (from env.sh / project config)
|
||||
# ci_passed() requires: WOODPECKER_REPO_ID (from env.sh / project config)
|
||||
# classify_pipeline_failure() requires: woodpecker_api() (defined in env.sh)
|
||||
|
||||
# ci_passed <state> — check if CI is passing (or no CI configured)
|
||||
# Returns 0 if state is "success", or if no CI is configured and
|
||||
|
|
@ -39,18 +40,20 @@ classify_pipeline_failure() {
|
|||
fi
|
||||
|
||||
all_infra=true
|
||||
_infra_count=0
|
||||
while IFS=$'\t' read -r _sname _ecode; do
|
||||
[ -z "$_sname" ] && continue
|
||||
# git step with exit 128 (connection/rate-limit) or 137 (OOM) → infra
|
||||
if [[ "$_sname" == git* ]] && { [ "$_ecode" = "128" ] || [ "$_ecode" = "137" ]; }; then
|
||||
: # infra step — continue checking remaining steps
|
||||
_infra_count=$(( _infra_count + 1 ))
|
||||
else
|
||||
all_infra=false
|
||||
break
|
||||
fi
|
||||
done <<< "$failed_steps"
|
||||
|
||||
if [ "$all_infra" = true ]; then
|
||||
# Require at least one confirmed infra step (guards against all-empty-name steps)
|
||||
if [ "$all_infra" = true ] && [ "$_infra_count" -gt 0 ]; then
|
||||
echo "infra"
|
||||
return 0
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue