Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions plugins/tend-ci-runner/skills/running-in-ci/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ After pushing, decide based on whether a concrete follow-up is gated on the CI r
# tend-mention's `tend-mention-handle-{PR#}` group), the sibling's handle job
# queues behind the current one — its CheckRun shows PENDING in the rollup
# but it can't start until the current run exits. Polling for it deadlocks
# until the 15-min cap breaks it. For workflows
# until the loop cap breaks it. For workflows
# with `cancel-in-progress: true`, the older sibling is cancelled and
# wouldn't gate polling anyway, so this filter is a no-op there.
#
Expand All @@ -238,19 +238,21 @@ pending() {
| select(. == "IN_PROGRESS" or . == "QUEUED" or . == "PENDING" or . == "WAITING" or . == "REQUESTED" or . == "EXPECTED")
] | length'
}
for i in $(seq 1 15); do
for i in $(seq 1 9); do
sleep 60
[ "$(pending)" -gt 0 ] && continue
sleep 30
[ "$(pending)" -eq 0 ] || continue
gh pr checks <number>
exit 0
done
echo "CI still running after 15 minutes"
echo "CI still running after 9 minutes"
exit 1
```

1. Poll every 60 seconds (up to ~15 minutes) until all non-own check-runs on the commit are terminal. **Filter out the current run's URL (`/runs/$GITHUB_RUN_ID/`)** — the current workflow's own check is always pending while polling and must be excluded to avoid a deadlock. **Also filter same-workflow check runs (`$GITHUB_WORKFLOW`)** — sibling runs of the same workflow on the same PR are subject to concurrency rules (queueing or cancel-in-progress) and don't represent independent CI signals. The 30s grace re-check catches late-registering omnibus checks.
Invoke this Bash call with `timeout: 600000` (10 min). The default 2-min Bash timeout would kill the loop early; the 9-iteration cap is sized to fit inside the harness's 10-min Bash maximum, so a longer loop would auto-background and the gated follow-up wouldn't fire.

1. Poll every 60 seconds (up to ~9 minutes) until all non-own check-runs on the commit are terminal. **Filter out the current run's URL (`/runs/$GITHUB_RUN_ID/`)** — the current workflow's own check is always pending while polling and must be excluded to avoid a deadlock. **Also filter same-workflow check runs (`$GITHUB_WORKFLOW`)** — sibling runs of the same workflow on the same PR are subject to concurrency rules (queueing or cancel-in-progress) and don't represent independent CI signals. The 30s grace re-check catches late-registering omnibus checks.
2. If a required check fails, diagnose with `gh run view <run-id> --log-failed`, fix, commit, push, repeat.
3. Once checks are terminal, perform the gated follow-up.

Expand Down Expand Up @@ -288,12 +290,14 @@ pending_jobs() {
done
echo "$n"
}
for i in $(seq 1 15); do
for i in $(seq 1 9); do
Comment thread
tend-agent marked this conversation as resolved.
[ "$(pending_jobs)" -eq 0 ] && break
sleep 60
done
```

As with the CI Monitoring loop above, invoke this Bash call with `timeout: 600000` (10 min) — the default 2-min Bash timeout would kill the loop early, and the 9-iteration cap is sized to fit inside the harness's 10-min Bash maximum.

## Replying to Comments

Reply in context rather than creating new top-level comments:
Expand Down
Loading