Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- ▶️ Resume reviews
- 🔍 Trigger review
📝 Summary
Summary by CodeRabbit
New Features
- Added a Copies view for volumes, showing copy status and freshness, mirror details, and available restore actions.
- Added controls to add, promote, remove, or delete eligible copies, with progress and outcome notifications when deleting a copy.
- Added a copy-safety indicator and mount information to volume details.
Updates
- Volume details now open on Copies. Storage, mounts, and danger controls are grouped under Settings.
- Mirror links open the relevant volume on Copies. Restore instructions now direct you to restore points on mirrors or old copies.
- Removed the Backups and Placement views.
The volume resource interface now centers on Copies and Settings. It adds copy listing, mirror actions, restore staging, and deletion of eligible old copies. Server-side checks guard run creation, and the client tracks run outcomes. Mirror resources open in Copies, and the restore guides describe the updated workflow.
Changes: Volume copies
Layer / File(s) Summary Guarded deletion and run tracking
dashboard/src/modules/volume-placement/*,dashboard/src/modules/volume-run/*The server validates old-copy deletion and guards run insertion against an active Deploy. The client watches accepted runs and reports completion or failure. Tests cover eligibility, Deploy conflicts, race conditions, and run-watch outcomes. Copies panel and actions
dashboard/src/routes/_protected/cloud/.../-components/StoreVolumeCopies*,dashboard/src/modules/volume-placement/volume-placement.ts,dashboard/src/collections/data-boundaries.static.test.tsThe Copies panel displays copies and mirror details and supports placement edits, restore staging, and eligible old-copy deletion. Detached-copy filtering excludes copies assigned to the target placement. Tests cover panel actions and safety indicators. Drawer routing and volume pages
dashboard/src/routes/_protected/cloud/.../resources/$resourceId/-components/*,dashboard/src/routes/_protected/cloud/.../_canvas/resources/$resourceId.tsx,dashboard/src/routes/_protected/cloud/.../-components/canvas/MirrorNode.tsx,docs/user/services/*-a-volume.mdThe drawer uses Copies and Settings, and mirror routes select a copy in Copies. The Backups page and previous mirror and placement components are removed. The guides describe restore points on mirrors and old copies. Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant VolumeCopiesPanel 3 participant useDeleteCopy 4 participant deleteCopyServerFn 5 participant deleteOldCopy 6 participant requestUnclaimedRun 7 participant PlacementDatabase 8 participant useWatchVolumeRun 9 participant getVolumeRunServerFn 10 VolumeCopiesPanel->>useDeleteCopy: Request deletion of an old copy 11 useDeleteCopy->>deleteCopyServerFn: Submit volume and server 12 deleteCopyServerFn->>deleteOldCopy: Validate and process request 13 deleteOldCopy->>requestUnclaimedRun: Request delete_mirror run 14 requestUnclaimedRun->>PlacementDatabase: Lock placement and insert run if unclaimed 15 useDeleteCopy->>useWatchVolumeRun: Watch accepted run 16 useWatchVolumeRun->>getVolumeRunServerFn: Poll run status
Merge Risk: 🟡 Moderate · up to 61e59
A deletion requested during a volume move could target the volume’s new primary. Guard that transition before merging.
Security architecture risk: 🟡 Moderate · up to 61e59
Deletion retains organization access checks and protects current and staged placement copies. However, it does not account for restore operations that already depend on the copy’s snapshots, so deleting an old copy can undermine a pending recovery operation. The assessed exposure remains within the authorized organization.
Retained concerns
- Medium · reliability · inferred: Immediate old-copy deletion does not honor pending restore dependencies. A staged restore records its source volume and snapshot on a separate placement row, but deletion checks only the source volume’s current and staged placement. The deletion worker removes the selected slot and cleans snapshots on the writer, potentially invalidating the restore point before the pending restore seeds its new volume. Unlike the previous staged workflow, immediate deletion can execute outside Deploy’s seed-first ordering. This threatens recovery integrity rather than expanding tenant privileges.
Security review details
Security Blast Radius
- inferred — The inspected request path confines authority to volumes resolved within an organization for which the actor has operate access. A deletion affects the selected old slot and snapshot cleanup on the volume’s writer; dependent staged restores can extend the recovery impact beyond that slot. No cross-organization reachability was substantiated.
Security Findings and Attack Paths
- inferred — An authorized operator can stage a restore and subsequently request deletion of an old source copy before the restore executes. Neither deletion admission nor the UI deletion lock checks the separate staged seed dependency. This creates a plausible recovery-integrity failure without requiring an authentication bypass or additional privileges; the exact snapshot-loss outcome was not demonstrated on real machines.
Trust Boundaries and Controls
- observed — The server derives the actor from request authentication, validates inputs, requires organization operate access, and resolves the volume and namespace within that organization. Machine observations and commands use the organization session rather than a caller-supplied organization ID or arbitrary machine endpoint.
Resilience and Maintainability Implications
- observed — Machine mutations require the active worker’s ownership of the run, and terminal updates are conditional on that ownership. Busy copy operations retry with the same expected state. These controls limit stale-worker execution but do not reserve snapshots for independently staged restores.
Hardening Proposals
- proposed — Treat a staged restore’s source snapshot as a retention reservation, and serialize deletion admission with creation and release of that reservation. Include writer snapshot cleanup, not only the selected old slot, in the reservation’s protected scope.
Pre-merge checks · Passed 4 · Failed 1
Failed Failed checks (1 warning)
Check name Status Explanation Resolution Docstring Coverage Warning Docstring coverage is 44.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 17 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold. Passed Passed checks (4 passed)
Check name Status Explanation Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Title check Passed The title clearly summarizes the main changes: the volume drawer now has Copies and Settings, supports mirror details, and can delete old copies. Description check Passed The description directly explains the drawer redesign, copy management, deletion flow, restore changes, removed components, documentation updates, and verification results.
Full details: Docstring Coverage
Explanation
Docstring coverage is 44.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 17 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 2
-
📝 Generate docstrings 💡
- Commit to this branch
- Create a new PR
🛠️ Fix failing CI checks 💡
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.