Repository navigation
Keep application labels when restoring from a backup - #7680
Open
bhavishyajain545 wants to merge 1 commit into
Open
bhavishyajain545 wants to merge 1 commit into
bhavishyajain545 wants to merge 1 commit into
Conversation
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
requested review from
Warashi,
armistcxy and
ffjlabo
and
a balanced review from Copilot
November 28, 2026 08:32
👷 Deploy request for pipecd-site pending review.Visit the deploys page to approve it
|
Contributor
There was a problem hiding this comment.
🟢 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
AddApplicationRequestduring 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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