fix: ci_passed() still lives in dev/dev-poll.sh, not lib/ (#70)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-18 02:05:54 +00:00
parent 87f5fb0390
commit 8e600787c1
6 changed files with 31 additions and 31 deletions

View file

@ -10,6 +10,7 @@ set -euo pipefail
# Usage: review-poll.sh [projects/harb.toml]
export PROJECT_TOML="${1:-}"
source "$(dirname "$0")/../lib/env.sh"
source "$(dirname "$0")/../lib/ci-helpers.sh"
# shellcheck disable=SC2034
@ -167,15 +168,10 @@ while IFS= read -r line; do
"${API_BASE}/commits/${PR_SHA}/status" | jq -r '.state // "unknown"')
# Skip if CI is running/failed. Allow "success" or no CI configured (empty/pending with no pipelines)
if [ "$CI_STATE" != "success" ]; then
# Projects without CI (woodpecker_repo_id=0) treat empty/pending as pass
if [ "${WOODPECKER_REPO_ID:-2}" = "0" ] && { [ "$CI_STATE" = "" ] || [ "$CI_STATE" = "pending" ]; }; then
: # no CI configured, proceed to review
else
log " #${PR_NUM} CI=${CI_STATE}, skip"
SKIPPED=$((SKIPPED + 1))
continue
fi
if ! ci_passed "$CI_STATE"; then
log " #${PR_NUM} CI=${CI_STATE}, skip"
SKIPPED=$((SKIPPED + 1))
continue
fi
# Check formal Codeberg reviews (not comment markers)

View file

@ -23,6 +23,7 @@ set -euo pipefail
# Load shared environment
source "$(dirname "$0")/../lib/env.sh"
source "$(dirname "$0")/../lib/ci-helpers.sh"
# Auto-pull factory code to pick up merged fixes before any logic runs
git -C "$FACTORY_ROOT" pull --ff-only origin main 2>/dev/null || true
@ -179,14 +180,9 @@ status "checking CI"
CI_STATE=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
"${API_BASE}/commits/${PR_SHA}/status" | jq -r '.state // "unknown"')
if [ "$CI_STATE" != "success" ]; then
# Projects without CI (woodpecker_repo_id=0) treat empty/pending as pass
if [ "${WOODPECKER_REPO_ID:-2}" = "0" ] && { [ -z "$CI_STATE" ] || [ "$CI_STATE" = "pending" ] || [ "$CI_STATE" = "unknown" ]; }; then
log "no CI configured, proceeding without CI gate"
else
log "SKIP: CI=${CI_STATE}"
exit 0
fi
if ! ci_passed "$CI_STATE"; then
log "SKIP: CI=${CI_STATE}"
exit 0
fi
# --- Check for existing reviews ---