fix(worker): reindex repos with missing zoekt shards#1350
Conversation
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds a startup reconciliation step to ChangesShard-Missing Startup Reconciliation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/repoIndexManager.ts`:
- Around line 769-786: The startup reconciliation query in the findMany call on
this.db.repo is excluding repos with PENDING or IN_PROGRESS INDEX jobs without
checking if those jobs are actually stale. Modify the NOT.jobs.some condition to
additionally check if the job's createdAt or updatedAt timestamp is older than
repoIndexTimeoutMs by adding a time-based filter (e.g., createdAt greater than
current time minus repoIndexTimeoutMs). This ensures that only active, non-stale
jobs prevent the repo from being included in the startup reconciliation,
allowing stale jobs to be properly recovered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2bd2948c-857a-438a-8c6f-f20a93b745aa
📒 Files selected for processing (3)
CHANGELOG.mdpackages/backend/src/repoIndexManager.test.tspackages/backend/src/repoIndexManager.ts
Fixes #1210
Summary
Verification
Summary by CodeRabbit