Restrict update --sync pruning to entries missing on disk#3165
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChanges ChangesSync pruning fix
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Code Review
This pull request refactors the --sync update behavior to only prune archive entries that no longer exist on disk, preventing entries filtered out by exclusions or time filters from being deleted. A helper function exists_on_disk is introduced along with corresponding integration tests. Feedback highlights a potential cross-platform data loss issue and MSRV compilation risk caused by matching io::ErrorKind::InvalidFilename in the exists_on_disk function, suggesting its removal.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Previously any archive entry absent from the collected set was pruned, so entries excluded by --exclude/--include or time filters were deleted even though their files still exist. --sync now realigns the archive to the disk state only: an entry is pruned solely when its path no longer exists on disk.
7e4a946 to
5bc874d
Compare
Summary
update --syncnow prunes an archive entry only when its path no longer exists on disk. Previously any entry absent from the collected set was pruned, so entries filtered out by--exclude/--includeor time filters were deleted even though their files still exist.Notes
--syncis a stable option, so this changes stable-surface behavior.PermissionDenied) keep the entry to avoid data loss; onlyNotFound/NotADirectory/InvalidFilenameprune.-s/--transform/--strip-componentsdo not correspond to filesystem paths and are still pruned, as before.Summary by CodeRabbit
--syncnow avoids removing archive entries just because they were skipped by filters, as long as the source files still exist on disk.--syncwith excluded files and time-based filters to confirm existing files remain in the archive.