Conversation
- paginateGraphQL に isResourceMissing オプションを追加し、repository null をページサイズ縮小ループに入れずに即座に GraphQLResourceMissingError として throw - ラベルに owner/repo を含めてエラー特定を容易に - crawl ジョブの per-repo ループを try/catch で囲み、失敗リポはスキップ して他のリポの処理を継続。失敗情報は output.failedRepos に格納 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 1 minutes and 22 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 (4)
📝 WalkthroughWalkthroughクローラーのリポジトリ単位処理で例外を局所化し継続処理するようにし、GraphQL のリソース不在( Changes
Sequence Diagram(s)sequenceDiagram
participant Job as CrawlJob
participant RepoLoop as Per-Repo Loop
participant Fetcher as GitHub Fetcher
participant API as GitHub GraphQL API
participant Output as Job Output
Job->>RepoLoop: Iterate repositories
activate RepoLoop
RepoLoop->>Fetcher: Start crawl for owner/repo
activate Fetcher
Fetcher->>API: GraphQL query (pulls connection)
alt repository exists
API-->>Fetcher: repository != null (connection present)
Fetcher->>Fetcher: paginateGraphQL normal flow
Fetcher-->>RepoLoop: success
else repository missing
API-->>Fetcher: repository == null
Fetcher->>Fetcher: isResourceMissing -> true
Fetcher-->>RepoLoop: throw GraphQLResourceMissingError
end
deactivate Fetcher
RepoLoop->>RepoLoop: catch error, append to failedRepos
RepoLoop->>Job: continue next repository
deactivate RepoLoop
Job->>Output: return results (including failedRepos)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
app/services/jobs/crawl.server.ts (2)
191-196:getErrorMessage()の使用を検討してくださいコーディングガイドラインでは
app/libs/error-message.tsのgetErrorMessage()を使用することが推奨されています。現在のパターンe instanceof Error ? e.message : String(e)は動作しますが、プロジェクト全体の一貫性のためにgetErrorMessage()の使用を検討してください。同様のパターンが Line 164 にもあります。
♻️ 提案される修正
+import { getErrorMessage } from '~/app/libs/error-message' // Line 164 - step.log.warn( - `Failed to fetch ${repoLabel}#${pr.number}: ${e instanceof Error ? e.message : e}`, - ) + step.log.warn( + `Failed to fetch ${repoLabel}#${pr.number}: ${getErrorMessage(e)}`, + ) // Line 192 - const message = e instanceof Error ? e.message : String(e) + const message = getErrorMessage(e)As per coding guidelines: "Use
getErrorMessage()fromapp/libs/error-message.tsto extract error messages".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/services/jobs/crawl.server.ts` around lines 191 - 196, Replace the manual error-extraction pattern (e instanceof Error ? e.message : String(e)) with the shared helper getErrorMessage() from app/libs/error-message.ts; specifically, import getErrorMessage and use it to produce the message passed into step.log.error and the error value pushed into failedRepos in the catch block around the crawl logic (and the similar catch at the earlier occurrence near line 164), so both step.log.error(...) and failedRepos.push({ repoLabel, error: message }) use message = getErrorMessage(e).
251-251:batch/commands/crawl.tsでfailedReposを CLI 出力に含めることを検討してください
app/services/jobs/crawl.server.tsからfailedReposがジョブ出力に含まれるようになりましたが、batch/commands/crawl.tsの CLI 出力(85行目)ではfetchedReposとpullCountのみをログ出力しており、失敗したリポジトリの情報は報告されていません。ユーザーに対してクロール失敗の詳細を伝えるべきか検討してください。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/services/jobs/crawl.server.ts` at line 251, The CLI output in batch/commands/crawl.ts currently logs only fetchedRepos and pullCount while app/services/jobs/crawl.server.ts now returns failedRepos; update the logging in the command handler (the spot that logs fetchedRepos and pullCount) to also include failedRepos when present—format the message to list the count and/or identifiers from failedRepos and handle the case where it's empty or undefined so the CLI prints a clear summary of failed repositories alongside fetchedRepos and pullCount.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/services/jobs/crawl.server.ts`:
- Around line 191-196: Replace the manual error-extraction pattern (e instanceof
Error ? e.message : String(e)) with the shared helper getErrorMessage() from
app/libs/error-message.ts; specifically, import getErrorMessage and use it to
produce the message passed into step.log.error and the error value pushed into
failedRepos in the catch block around the crawl logic (and the similar catch at
the earlier occurrence near line 164), so both step.log.error(...) and
failedRepos.push({ repoLabel, error: message }) use message =
getErrorMessage(e).
- Line 251: The CLI output in batch/commands/crawl.ts currently logs only
fetchedRepos and pullCount while app/services/jobs/crawl.server.ts now returns
failedRepos; update the logging in the command handler (the spot that logs
fetchedRepos and pullCount) to also include failedRepos when present—format the
message to list the count and/or identifiers from failedRepos and handle the
case where it's empty or undefined so the CLI prints a clear summary of failed
repositories alongside fetchedRepos and pullCount.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bbdd1f27-9827-4575-b197-c7912b8e684c
📒 Files selected for processing (2)
app/services/jobs/crawl.server.tsbatch/github/fetcher.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- crawl の per-repo ハンドリングで getErrorMessageForLog を使用 - GraphQLResourceMissingError は step.run 内で sentinel として返し、 外で再 throw する。durably による無駄なリトライを防ぐ - fetcher.ts の repositoryMissing 述語を共通化(4 箇所の重複削減) - テストの inline 型定義を共通化 - 不要なコメントを削除 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Closes #275
Summary
paginateGraphQLにisResourceMissingオプションを追加。repository === nullを検出したらGraphQLResourceMissingErrorを即座に throw し、無駄なページサイズ縮小リトライを回避owner/repoを含めて、どのリポで失敗したか特定可能にoutput.failedReposに格納Test plan
pnpm typecheckpnpm lintpnpm vitest run batch/github🤖 Generated with Claude Code
Summary by CodeRabbit
新機能
バグ修正