fix: fix: dev-poll does not recover stale in-progress issues — pipeline stays blocked (#224)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
Agent 2026-04-05 15:26:13 +00:00
parent e887663d8c
commit a2bfe1aa82
2 changed files with 113 additions and 8 deletions

View file

@ -161,6 +161,27 @@ issue_release() {
_ilc_log "released issue #${issue}"
}
# ---------------------------------------------------------------------------
# _ilc_post_comment — Post a comment to an issue (internal helper)
# Args: issue_number body_text
# Uses a temp file to avoid large inline strings.
# ---------------------------------------------------------------------------
_ilc_post_comment() {
local issue="$1" body="$2"
local tmpfile tmpjson
tmpfile=$(mktemp /tmp/ilc-comment-XXXXXX.md)
tmpjson="${tmpfile}.json"
printf '%s' "$body" > "$tmpfile"
jq -Rs '{body:.}' < "$tmpfile" > "$tmpjson"
curl -sf -o /dev/null -X POST \
-H "Authorization: token ${FORGE_TOKEN}" \
-H "Content-Type: application/json" \
"${FORGE_API}/issues/${issue}/comments" \
--data-binary @"$tmpjson" 2>/dev/null || true
rm -f "$tmpfile" "$tmpjson"
}
# ---------------------------------------------------------------------------
# issue_block — add "blocked" label, post diagnostic comment, remove in-progress.
# Args: issue_number reason [result_text]
@ -187,14 +208,9 @@ issue_block() {
fi
} > "$tmpfile"
# Post comment
jq -Rs '{body:.}' < "$tmpfile" > "${tmpfile}.json"
curl -sf -o /dev/null -X POST \
-H "Authorization: token ${FORGE_TOKEN}" \
-H "Content-Type: application/json" \
"${FORGE_API}/issues/${issue}/comments" \
--data-binary @"${tmpfile}.json" 2>/dev/null || true
rm -f "$tmpfile" "${tmpfile}.json"
# Post comment using shared helper
_ilc_post_comment "$issue" "$(cat "$tmpfile")"
rm -f "$tmpfile"
# Remove in-progress, add blocked
local ip_id bk_id