Merged
Conversation
リポ追加直後にデータが表示されるよう、該当 repo 限定の crawl を
fire-and-forget で trigger する。concurrencyKey は per-repo
(`crawl:${orgId}:${repoId}`) + coalesce: 'skip' で、連続追加時に
異なる repo の crawl が drop されないようにする。
併せて crawl.server.ts の repositoryId 不一致時を throw → warn + 早期
return に緩和。追加直後に削除された場合の race でジョブが失敗しない。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughリポジトリ追加時に初回の自動crawlをトリガーする機能を追加しました。リポジトリID取得の仕様強化、crawlトリガーロジック、並行性キー生成、エラーハンドリングの緩和を実装しています。 Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Action as Repository Add Action
participant DB as Database
participant JobSystem as Job System
participant CrawlJob as Crawl Job
participant Sentry as Sentry (Error Tracking)
User->>Action: Add new repository
Action->>DB: Insert/Update repository
DB-->>Action: Return repository (with id)
Action->>JobSystem: Trigger crawl job<br/>(fire-and-forget)
JobSystem-->>Action: Job queued
Action-->>User: Success response
par Background Processing
JobSystem->>CrawlJob: Execute crawl<br/>(concurrencyKey: per-repo)
CrawlJob->>DB: Fetch repository by id
alt Repository exists
CrawlJob->>DB: Fetch PRs and metadata
DB-->>CrawlJob: Data
CrawlJob-->>JobSystem: Success
else Repository not found
CrawlJob->>CrawlJob: Log warning (transient)
CrawlJob-->>JobSystem: Success (early exit)
end
and Error Path
JobSystem->>Sentry: If crawl trigger fails
Sentry-->>JobSystem: Error recorded
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 docstrings
🧪 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crawl:${orgId}:${repoId}) +coalesce: 'skip'。連続追加時に異なる repo の crawl が drop されず、同一 repo の重複クリックは安全に skiprepositoryId不一致時を throw →step.log.warn+ 早期 return に緩和。追加直後に削除された race でジョブが失敗しないCloses #274
変更点
app/services/jobs/concurrency-keys.server.ts:crawlRepoConcurrencyKey(orgId, repoId)を追加app/services/jobs/crawl.server.ts:repositoryId不一致を warn + 早期 returnapp/routes/$orgSlug/settings/repositories.add/+functions/mutations.server.ts:addRepositoryが.returning('id')で挿入 id を返すapp/routes/$orgSlug/settings/repositories.add/index.tsx: add 成功後に crawl trigger(fire-and-forget、失敗は Sentry へ)Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
新機能
バグ修正