Skip to content

Commit edaa754

Browse files
fix(skills): harden CodeRabbit polling with --paginate and timeout
Add --paginate to gh api call to fetch all comment pages on busy PRs, null-safe body access, and explicit timeout exit on polling failure.
1 parent dce92e4 commit edaa754

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.claude/skills/pull-request/references/monitoring.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,19 @@ When you post `@coderabbitai full review`, CodeRabbit replies "Full review trigg
116116

117117
```bash
118118
# Poll until CodeRabbit posts its new review summary (contains "Actionable comments")
119+
FOUND=0
119120
for i in $(seq 1 20); do
120-
LATEST=$(gh api repos/$OWNER/$REPO/issues/$PR/comments \
121-
--jq '[.[] | select(.user.login=="coderabbitai")] | sort_by(.created_at) | last | .body[0:200]')
121+
LATEST=$(gh api repos/$OWNER/$REPO/issues/$PR/comments --paginate \
122+
--jq '[.[] | select(.user.login=="coderabbitai")] | sort_by(.created_at) | last | (.body // "")[0:200]')
122123
if echo "$LATEST" | grep -qiE "actionable|no issues found|walkthrough"; then
123-
echo "CodeRabbit review posted" && break
124+
echo "CodeRabbit review posted"
125+
FOUND=1
126+
break
124127
fi
125128
sleep 30
126129
done
130+
131+
[ "$FOUND" -eq 1 ] || { echo "Timed out waiting for new CodeRabbit summary" >&2; exit 1; }
127132
```
128133

129134
Only after this should you check for unresolved threads and declare clean.

0 commit comments

Comments
 (0)