Repository navigation
ci(auto-approve): retry the approval on GitHub API errors - #74
Conversation
One GitHub API error (HTTP 502, 2026-10-12) silently dropped bridge approvals. Retry up to 4 times; each attempt re-reads head + dedupe, so a retry never double-approves. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR Summary by QodoRetry auto-approval after transient GitHub API failures
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Retries can approve unreviewed commits
|
| # so each head commit is approved once. | ||
| approve_once() { | ||
| local head_sha dup | ||
| head_sha=$(gh api "repos/$REPO/pulls/$NUM" --jq .head.sha) || return 1 |
There was a problem hiding this comment.
1. Retries can approve unreviewed commits 🐞 Bug ≡ Correctness
approve_once fetches the current PR head on every attempt rather than pinning the approval to the head from the initial attempt. If an API call fails and a new commit is pushed during a retry delay, the next attempt can approve that new head while quoting the earlier Qodo comment's verdict and URL.
Agent Prompt
## Issue description
A failed attempt can be retried after the PR head changes, causing an approval for a commit that was not present when the Qodo comment triggered the run.
## Fix Focus Areas
- .github/workflows/auto-approve.yml[59-71]
- .github/workflows/auto-approve.yml[73-84]
## Recommended Fix
Capture the intended head before entering the retry loop. On each attempt, abort rather than approve if the current head differs; submit the approval against the captured commit ID so a push between the check and submission cannot redirect it to a newer head.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Auto-approved: Qodo review completed — 🐞 Bugs (1),📘 Rule violations (0) 📜 Skill insights (0). Findings are advisory per team policy; verdict source: #74 (comment) [auto-approve.yml]
|
/agentic_review |
Makes the approval bridge survive transient GitHub API errors.
ghharness covered two 502s then success (exactly one approval), approval already present (no duplicate) and a persistent failure (exit 1 after 4 attempts).🤖 Generated with Claude Code