-
-
Notifications
You must be signed in to change notification settings - Fork 254
Allow backup transfers #2068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Allow backup transfers #2068
Conversation
📝 WalkthroughWalkthroughAdds a selectable backups multi-select to the server transfer UI, threads selected backup IDs through TransferServerService::handle and notify, and adds two localization keys for the backups UI. Changes
Sequence Diagram(s)sequenceDiagram
participant AdminUI as Admin UI (Filament)
participant App as Laravel App (TransferServerService)
participant Wings as Wings API
AdminUI->>App: Submit transfer form (node_id, allocation_id, additional_allocations, backup_ids)
Note over App: TransferServerService::handle creates ServerTransfer and generates token
App->>Wings: POST /api/servers/{id}/transfer with token + payload (node_id, allocations, backups?)
alt Wings accepts
Wings-->>App: 200 OK (transfer accepted)
App-->>AdminUI: Success notification (transfer started)
else Wings rejects
Wings-->>App: error response
App-->>AdminUI: Error notification (transfer failed)
end
Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/Filament/Admin/Resources/Servers/Pages/EditServer.phpapp/Services/Servers/TransferServerService.phplang/en/admin/server.php
🧰 Additional context used
🧬 Code graph analysis (2)
app/Filament/Admin/Resources/Servers/Pages/EditServer.php (2)
app/Models/Server.php (3)
transfer(386-389)Server(135-552)backups(394-397)app/Services/Servers/TransferServerService.php (1)
handle(54-109)
app/Services/Servers/TransferServerService.php (1)
app/Models/Server.php (2)
backups(394-397)Server(135-552)
🔇 Additional comments (3)
app/Filament/Admin/Resources/Servers/Pages/EditServer.php (2)
1056-1063: LGTM! Well-implemented backup selection field.The multi-select field for backups is properly configured:
- Disabled when no backups exist
- Maps backup IDs correctly for form submission
- Includes helpful warning text for users
- Uses appropriate icon and placeholder
966-966: Verify backup ID validation in service layer.The backup IDs are passed directly from form data to the service. While the form field is constrained to the server's backups, ensure the service layer also validates that the provided backup IDs actually belong to the server to prevent potential security issues.
This validation should happen in
TransferServerService::handle()ornotify()method (see my comments on that file).app/Services/Servers/TransferServerService.php (1)
32-32: No action needed. The configuration keyconfig('backups.default')is correct and'wings'is a valid backup driver value defined inconfig/backups.php. The code properly checks the backup driver configuration to include backups during the server transfer operation.
QuintenQVD0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
pelican-dev/wings#155
Using Quinten's wings pull request, this fixes the servers not transfering their backups.