Persist metadata for NoUsableRelease repos in backfill#11
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 19 minutes and 48 seconds.Comment |
Summary
Real bug exposed by running the first /v1/internal/backfill-stale on prod: most curated rows return `RefreshResult.NoUsableRelease` from `searchClient.refreshRepo` (libraries, dotfiles, repos that release via tags-only, etc. -- anything without a non-draft / non-prerelease release on GitHub). The previous backfill loop only persisted on `Ok`, so those repos:
After 5 minutes of the initial run, only +3 rows had populated -- consistent with the no-release-detected ratio.
Fix
On the `NoUsableRelease` branch in `runBackfill`, do a metadata-only UPDATE on the existing row. The new helper `upsertMetadataOnly(GitHubRepo)` writes:
Release-related columns are NOT touched -- they're either correct from the last successful Ok-path refresh, or they're at schema defaults because the repo has never had a release. Both cases are correct.
The final log line now distinguishes `ok` (full Ok-path persist) from `metadata-only` (NoUsableRelease but metadata written) so an operator can see the ratio.
Test plan