fix: crawl の shouldStop 境界条件を修正し毎時の無駄な再フェッチを解消#276
Conversation
pullrequestList の shouldStop が `<` (strictly less than) だったため、 updatedAt == lastFetchedAt の PR が毎回フィルタを通過し、全 repo の最新 PR が 毎時再フェッチされていた。`<=` に修正して既にフェッチ済みの PR を除外する。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 21 minutes and 8 seconds. ⌛ 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 (1)
📝 WalkthroughWalkthroughGraphQL ページネーション補助関数 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 分 Possibly related issues
Possibly related PRs
詩
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
pullrequestListのshouldStop比較が<(strictly less than) だったため、updatedAt == lastFetchedAtの PR が毎回フィルタを通過し、全 repo の最新 PR が毎時再フェッチされていた<=に修正して既にフェッチ済みの PR を除外paginateGraphQLの shouldStop 境界条件のテストを追加Background
本番 DB を調査したところ、深夜・休日など稼働がない時間帯でも全 org で毎時一定数の PR が更新されていた。原因は各 repo の最新 PR(
updatedAt == MAX(github_raw_data.updated_at))が off-by-one で毎回再フェッチされていたため。repo 数 × 6 API calls/PR の無駄が毎時発生していた。Test plan
paginateGraphQLの shouldStop テスト追加(updatedAt == stopBeforeで除外されること)pnpm vitest run batch/github/fetcher.test.ts全パスpnpm typecheck && pnpm build && pnpm test全パスpullCount: 0が出ることを確認🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
バグ修正
テスト