Skip to content

Keep application labels when restoring from a backup - #7680

Open
bhavishyajain545 wants to merge 1 commit into
pipe-cd:masterfrom
bhavishyajain545:fix/pipectl-restore-application-labels
Open

bhavishyajain545 wants to merge 1 commit into
pipe-cd:masterfrom
bhavishyajain545:fix/pipectl-restore-application-labels

Conversation

@bhavishyajain545

Copy link
Copy Markdown
Contributor

What this PR does:

Restores application labels from the backup and adds a unit test.

Why we need it:

Labels were being dropped during restore, making applications harder to filter.

Which issue(s) this PR fixes:

Fixes #7622

Does this PR introduce a user-facing change?:

Restored applications now keep their labels. No breaking change or migration.

Tested:

go test ./pkg/app/pipectl/cmd/transfer/

AI assistance was used.

Screenshots/Videos (for documentation or website changes):

N/A

restoreApplications built the AddApplicationRequest without Labels, so an
application restored by 'pipectl transfer restore application' lost the
labels that the backup carried and that the command itself uses to select
applications. Pass the backed-up labels through and cover the function
with a test using a fake API client.

Fixes pipe-cd#7622

Signed-off-by: Bhavishya Jain <65864699+bhavishyajain545@users.noreply.github.com>
@bhavishyajain545
bhavishyajain545 requested a review from a team as a code owner November 28, 2026 08:32
@bhavishyajain545
bhavishyajain545 requested review from Warashi, armistcxy and ffjlabo and a balanced review from Copilot November 28, 2026 08:32
@netlify

netlify Bot commented Nov 28, 2026

Copy link
Copy Markdown

👷 Deploy request for pipecd-site pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 08d7cca

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block this change to preserve backed-up application labels during restore.

No open issues 🎉

What changed in this PR

Fixes #7622 by preserving backed-up application labels during pipectl transfer restore application, so restored applications remain filterable by their original labels.

Changes:

  • Pass application labels to AddApplicationRequest during restore.
  • Add unit tests for label preservation, disabled applications, missing Piped mappings, and creation failures.
File Description
pkg/​app/​pipectl/​cmd/​transfer/​restore_application.go Include backed-up labels in the restore request.
pkg/​app/​pipectl/​cmd/​transfer/​restore_application_test.go Add regression coverage for labels and existing restore behavior.

Review effort: Balanced

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pipectl transfer restore application drops backed-up labels

2 participants