Skip to content

Conversation

@JoanFo1456
Copy link
Contributor

pelican-dev/wings#155
Using Quinten's wings pull request, this fixes the servers not transfering their backups.

@coderabbitai
Copy link

coderabbitai bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Admin UI Form
app/Filament/Admin/Resources/Servers/Pages/EditServer.php
Added a searchable multi-select backups field (label, placeholder select_backups, helper warning_backups, icon) that is disabled when no backups exist and passes selected backup IDs to the transfer action.
Server Transfer Service
app/Services/Servers/TransferServerService.php
handle() signature now accepts optional backup_ids and forwards them to notify(); notify() gained an optional backup_ids parameter, filters server backups by those IDs and includes them in the Wings HTTP payload when backups.default is wings. Docblocks updated.
Localization
lang/en/admin/server.php
Added select_backups => 'Select Backups' and warning_backups => 'Be aware, not transferred backups will be deleted.'

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
Loading

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Allow backup transfers' clearly and concisely describes the main change: enabling backup transfers for servers.
Description check ✅ Passed The description is related to the changeset, referencing the wings pull request that motivated the backup transfer feature implementation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10c110f and 7f5de26.

📒 Files selected for processing (1)
  • app/Filament/Admin/Resources/Servers/Pages/EditServer.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/Filament/Admin/Resources/Servers/Pages/EditServer.php

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3141fe6 and f45da27.

📒 Files selected for processing (3)
  • app/Filament/Admin/Resources/Servers/Pages/EditServer.php
  • app/Services/Servers/TransferServerService.php
  • lang/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() or notify() method (see my comments on that file).

app/Services/Servers/TransferServerService.php (1)

32-32: No action needed. The configuration key config('backups.default') is correct and 'wings' is a valid backup driver value defined in config/backups.php. The code properly checks the backup driver configuration to include backups during the server transfer operation.

Copy link
Contributor

@QuintenQVD0 QuintenQVD0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants