fix: feat: gardener recycles stale failed PRs back to backlog (#626)
Add stale-pr-recycle step to the gardener formula that detects open PRs with failed CI older than 24 hours and no active tmux session. Stale PRs are closed with a comment, and the linked issue is relabeled from in-progress to backlog so dev-poll picks it up for a fresh attempt. Also adds close_pr manifest action to the gardener executor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9a9b82eea5
commit
a5c141ce92
2 changed files with 80 additions and 4 deletions
|
|
@ -86,6 +86,7 @@ Supported actions:
|
|||
{\"action\":\"comment\", \"issue\":NNN, \"body\":\"Relates to issue 1031\"}
|
||||
{\"action\":\"create_issue\", \"title\":\"...\", \"body\":\"...\", \"labels\":[\"backlog\"]}
|
||||
{\"action\":\"edit_body\", \"issue\":NNN, \"body\":\"new body\"}
|
||||
{\"action\":\"close_pr\", \"pr\":NNN}
|
||||
|
||||
The commit-and-pr step converts JSONL to JSON array. The orchestrator executes
|
||||
actions after the PR merges. Do NOT call mutation APIs directly during the run."
|
||||
|
|
@ -274,6 +275,19 @@ _gardener_execute_manifest() {
|
|||
fi
|
||||
;;
|
||||
|
||||
close_pr)
|
||||
local pr
|
||||
pr=$(jq -r ".[$i].pr" "$manifest_file")
|
||||
if curl -sf -X PATCH -H "Authorization: token ${FORGE_TOKEN}" \
|
||||
-H 'Content-Type: application/json' \
|
||||
"${FORGE_API}/pulls/${pr}" \
|
||||
-d '{"state":"closed"}' >/dev/null 2>&1; then
|
||||
log "manifest: closed PR #${pr}"
|
||||
else
|
||||
log "manifest: FAILED close_pr #${pr}"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
log "manifest: unknown action '${action}' — skipping"
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue