fix: remove ghost reviewer records when reviewers are removed#211
Conversation
When all reviewers were removed from a PR (e.g. after approving), buildPullRequests did not emit a reviewers entry for that PR, so batchReplacePullRequestReviewers never ran DELETE and stale records remained in the database. Always emit a reviewers entry regardless of reviewer count so the replace function properly cleans up removed reviewers. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
reviewRequestsから外れた場合、pull_request_reviewersテーブルの古いレコードが削除されずに残り続けるバグを修正buildPullRequestsで reviewer が 0 人でも常にエントリを emit し、batchReplacePullRequestReviewersの DELETE が走るようにしたBackground
全員 APPROVED 済みで GitHub API の
reviewRequestsが空なのに、DB にゴーストレコードが残っているケースを発見。表示上はrequested_at IS NOT NULLフィルタで影響なかったが、データの正確性を担保するために修正。Test plan
recalculate実行後にゴーストレコードが消えることを確認🤖 Generated with Claude Code