Skip to content

fix(ci): keep package backups when rollback fails - #1052

Merged
LunaStev merged 4 commits into
wavefnd:masterfrom
hiyouwhatsapp:fix/retain-package-backups-1001
Oct 29, 2026
Merged

LunaStev merged 4 commits into
wavefnd:masterfrom
hiyouwhatsapp:fix/retain-package-backups-1001

Conversation

@hiyouwhatsapp

Copy link
Copy Markdown
Contributor

Fixes #1001

replace_set() could delete the only old copy when activation failed and restoring the backup failed too

I kept the backup directory in that case and included the recovery path in the error
The other restores still run even if one of them fails

Added cases for failed restore and cleanup alongside the existing replacement tests

Testing: eight isolated fault-injection scenarios pass, haven't run the full repository suite locally

LunaStev
LunaStev previously approved these changes Oct 27, 2026
@LunaStev

Copy link
Copy Markdown
Member

In replace_set(), shutil.rmtree(directory) is called after all packages have been successfully activated.

If this cleanup fails, the function raises an exception even though the new packages have already been published. This could cause callers to interpret a successful deployment as a failed one.

Could we handle backup-directory cleanup failures separately from package replacement failures and add a regression test for this scenario?

LunaStev
LunaStev previously approved these changes Oct 27, 2026
@LunaStev
LunaStev dismissed stale reviews from themself October 27, 2026 15:23

Approval dismissed at my request pending further review of package cleanup failure handling.

@LunaStev
LunaStev merged commit 933ec43 into wavefnd:master Oct 29, 2026
49 of 50 checks passed
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.

Retain package backups when artifact activation and restoration both fail

2 participants