fix: disable unsafe CAS garbage collection - #312
Conversation
|
Warning Review limit reached
Next review available in: 24 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: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughCAS garbage collection now fails closed with an explicit disabled result and zero deletion statistics. Lifecycle, reconciliation, maintenance, and Settings flows propagate or display the disabled state, with tests covering the updated behavior. ChangesCAS garbage collection disablement
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant SettingsViewModel
participant CasLifecycleManager
participant CasService
participant CASStorage
SettingsViewModel->>CasLifecycleManager: Request CAS cleanup
CasLifecycleManager->>CasService: RunGarbageCollectionAsync(force)
CasService-->>CasLifecycleManager: Disabled result with zero deletions
CasLifecycleManager-->>SettingsViewModel: Failed result with disabled stats
SettingsViewModel-->>SettingsViewModel: Show CAS Cleanup Disabled
Note over CasService,CASStorage: No storage scan or deletion occurs
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Incremental Review: All issues from the previous review have been addressed:
All changes are minimal, focused, and address the previous code review findings without introducing new issues. Previous Review Summary (commit 4977fba)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 4977fba)Status: No Issues Found | Recommendation: Merge Files Reviewed (17 files)
Reviewed by glm-4.7 · Input: 44.4K · Output: 3K · Cached: 121.2K |
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 `@GenHub/GenHub/Features/Settings/ViewModels/SettingsViewModel.cs`:
- Around line 1118-1125: Update the notification calls in the SettingsViewModel
cleanup result handling, including the branch around result.Disabled, to pass
the full NotificationHideDelay duration rather than its Milliseconds component.
Convert the TimeSpan using TotalMilliseconds so the configured 3000 ms delay is
preserved.
🪄 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: ASSERTIVE
Plan: Pro Plus
Run ID: 828d7d05-8545-4c08-a0d6-145d0ce33552
📒 Files selected for processing (17)
GenHub/GenHub.Core/Constants/CasDefaults.csGenHub/GenHub.Core/Interfaces/Storage/ICasLifecycleManager.csGenHub/GenHub.Core/Interfaces/Storage/ICasService.csGenHub/GenHub.Core/Models/Content/ContentRemovalResult.csGenHub/GenHub.Core/Models/Results/CAS/CasGarbageCollectionResult.csGenHub/GenHub.Core/Models/Storage/GarbageCollectionStats.csGenHub/GenHub.Tests/GenHub.Tests.Core/Features/GameProfiles/ViewModels/SettingsViewModelTests.csGenHub/GenHub.Tests/GenHub.Tests.Core/Features/Reconciliation/ContentReconciliationOrchestratorGarbageCollectionTests.csGenHub/GenHub.Tests/GenHub.Tests.Core/Features/Storage/CasGarbageCollectionDisabledTests.csGenHub/GenHub.Tests/GenHub.Tests.Core/Features/Storage/CasGarbageCollectionResultTests.csGenHub/GenHub.Tests/GenHub.Tests.Core/Integration/ContentReconciliationServiceTests.csGenHub/GenHub/Features/Content/Services/ContentReconciliationService.csGenHub/GenHub/Features/Content/Services/Reconciliation/ContentReconciliationOrchestrator.csGenHub/GenHub/Features/Settings/ViewModels/SettingsViewModel.csGenHub/GenHub/Features/Storage/Services/CasLifecycleManager.csGenHub/GenHub/Features/Storage/Services/CasMaintenanceService.csGenHub/GenHub/Features/Storage/Services/CasService.cs
Summary
Disables the destructive CAS garbage collection path fail-closed until reference tracking is provably complete.
Changes
CasService.RunGarbageCollectionAsyncno longer deletes objects; it returns an explicitCasGarbageCollectionResult.CreateDisabled()and logs why.CasLifecycleManagerpropagates the disabled/failed state instead of reporting a successful run.Disabledflag.CasGarbageCollectionDisabledTests, orchestrator GC tests).Why
The reference tracker does not cover every live reference source (persisted manifests, existing workspaces, user-data links, CAS pools), so live blobs can be classified unreachable and permanently deleted — surfacing later as failed or silently incomplete workspace preparation. Re-enable criteria are listed in #310.
Testing
Splitoverload disambiguation inGitHubTopicsDiscoverer.cs(not included here) becausedevelopmentdoes not compile on .NET SDK 8.0.129; CI SDKs are unaffected.Risks and rollback
Low risk: no behavior removed except deletion itself; revert restores previous GC.
Fixes #310
Greptile Summary
This PR disables destructive CAS garbage collection until reachability tracking is complete.
Confidence Score: 4/5
The destructive collection path appears safely disabled, but completion-event reporting remains incomplete and should be reconciled with the existing operation-status contract.
Audit records now preserve disabled-GC warnings, while successful replacement events still omit them and successful removal operations publish no completion event; no current recipient of these events was found, limiting the present impact.
Files Needing Attention: GenHub/GenHub/Features/Content/Services/Reconciliation/ContentReconciliationOrchestrator.cs; GenHub/GenHub.Core/Models/Content/ReconciliationCompletedEvent.cs
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD Caller["Settings, maintenance, or reconciliation flow"] --> Lifecycle["CasLifecycleManager"] Lifecycle --> Service["CasService.RunGarbageCollectionAsync"] Service --> Disabled["CreateDisabled result"] Disabled --> NoAccess["No CAS scan or deletion"] Disabled --> Propagate["Disabled stats and warning propagated"] Propagate --> UI["Settings notification"] Propagate --> Result["Reconciliation result and audit metadata"]Reviews (2): Last reviewed commit: "fix: record reconciliation warnings in a..." | Re-trigger Greptile
Context used: