Skip to content

Conversation

@QuintenQVD0
Copy link
Contributor

@QuintenQVD0 QuintenQVD0 commented Jan 4, 2026

Changes

  • The logic for transferring backups was already in place but the panel still needs to send the back uuid's
  • On the panel side a change is still needed here: https://github.com/pelican-dev/panel/blob/main/app/Services/Servers/TransferServerService.php#L30 as it must return an array of backup uuid that have to be transferd
  • Please also add a note on the panel that backups that aren't transferd will be removed
  • Only local backups work
  • If no backups should be transferd an empty array must be returned

Summary by CodeRabbit

  • New Features

    • Server transfers now support including a list of backups with each transfer, allowing selected backups to be sent alongside the main archive to preserve auxiliary data during migrations.
  • Documentation

    • Updated in-line notes clarify behavior when no backups are specified.

✏️ Tip: You can customize this high-level summary in your review settings.

@QuintenQVD0 QuintenQVD0 requested a review from a team as a code owner January 4, 2026 12:35
@coderabbitai
Copy link

coderabbitai bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

Adds backup support to server transfer: request payload now includes Backups, PushArchiveToTarget accepts backups and stores them on the transfer, and conditional backup streaming is invoked when backups are provided.

Changes

Cohort / File(s) Summary
Router / Request
router/router_server_transfer.go
Added Backups []string to serverTransferRequest; updated call to PushArchiveToTarget(url, token, backups).
Transfer / Source
server/transfer/source.go
Changed PushArchiveToTarget signature to accept backups []string; assigns t.BackupUUIDs = backups and conditionally streams backups (invokes archive streaming when backups present).
Transfer / Archive
server/transfer/archive.go
Added comment documenting zero-backups edge case; no functional change.

Sequence Diagram

sequenceDiagram
    participant Client
    participant Router
    participant Transfer
    participant Archive

    Client->>Router: POST /server/transfer { url, token, backups }
    Router->>Transfer: PushArchiveToTarget(url, token, backups)
    Transfer->>Transfer: set BackupUUIDs = backups

    alt backups provided
        Transfer->>Transfer: emit streaming message
        Transfer->>Archive: StreamBackups(ctx, mp)
        Archive-->>Transfer: streaming completed
    else no backups
        Transfer->>Transfer: log "no backups specified"
    end

    Transfer-->>Router: return archive response
    Router-->>Client: 200 OK (transfer complete)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • parkervcp

Poem

🐰 I hopped along the transfer trail,
Carried UUIDs inside my tail,
When backups came I gave a cheer,
Streamed them safe from far to near,
A tiny rabbit, proud and hale.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Make backups transfer with servers' directly describes the main objective of the PR - enabling backups to be transferred during server transfers, which aligns with the primary code changes that add backup transfer functionality.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a544583 and 2ebd691.

📒 Files selected for processing (2)
  • server/transfer/archive.go
  • server/transfer/source.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • server/transfer/archive.go
  • server/transfer/source.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build and Test (ubuntu-22.04, 1.24.7, linux, amd64)
  • GitHub Check: Build and Test (ubuntu-22.04, 1.25.1, linux, amd64)
  • GitHub Check: Analyze (go)

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: 0

🧹 Nitpick comments (1)
server/transfer/archive.go (1)

38-38: Minor grammar issue in comment.

The comment reads "if there at least is 1 backup" but should be "if there is at least 1 backup".

🔎 Suggested fix
-	// In theory this can't happen as this function is only called if there at least is 1 backup but just to be sure
+	// In theory this can't happen as this function is only called if there is at least 1 backup but just to be sure
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4161a2 and a544583.

📒 Files selected for processing (3)
  • router/router_server_transfer.go
  • server/transfer/archive.go
  • server/transfer/source.go
🧰 Additional context used
🧬 Code graph analysis (2)
server/transfer/source.go (1)
server/transfer/transfer.go (1)
  • Transfer (43-60)
router/router_server_transfer.go (2)
config/config.go (2)
  • Token (305-308)
  • Backups (257-279)
server/installer/installer.go (1)
  • ServerDetails (17-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build and Test (ubuntu-22.04, 1.25.1, linux, amd64)
  • GitHub Check: Build and Test (ubuntu-22.04, 1.24.7, linux, amd64)
  • GitHub Check: Analyze (go)
🔇 Additional comments (5)
server/transfer/archive.go (1)

37-133: LGTM! Backup streaming implementation is solid.

The defensive zero-backups check is appropriate, and the implementation correctly handles:

  • File discovery and filtering by UUID
  • Individual backup checksums for integrity verification
  • Progress tracking with detailed logging
  • Proper resource cleanup (file handles closed)
router/router_server_transfer.go (2)

21-24: LGTM! Backups field correctly added.

The Backups field is appropriately optional (no binding:"required" tag), allowing the panel to send an empty array when no backups should be transferred, as documented in the PR description.


84-84: LGTM! Call site updated correctly.

The call to PushArchiveToTarget now passes the backups array as expected by the updated method signature.

server/transfer/source.go (2)

17-17: LGTM! Method signature updated to support backups.

The addition of the backups []string parameter enables backup transfer functionality. As noted in the PR description, this requires a coordinated change in the panel repository (app/Services/Servers/TransferServerService.php) to return backup UUIDs.

Confirm that the corresponding panel changes have been implemented or are being coordinated to return the backup UUIDs array.


127-137: LGTM! Backup streaming logic is well-implemented.

The implementation correctly:

  • Stores backup UUIDs in the Transfer struct before use
  • Provides user-friendly progress messages with backup counts
  • Conditionally streams backups only when provided
  • Logs appropriately when no backups are specified
  • Properly propagates errors from the streaming operation

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.

2 participants