Repository navigation
fix: report failed !Desired() sync uninstalls as deletions and lock exectest Deleted - #2853
Merged
Merged
Conversation
…xectest Deleted SyncReleases' defensive !Desired() uninstall branch accumulated failures in AffectedReleases.Failed, rendering them under the Failed Releases table instead of Failed to Delete Releases, unlike DeleteReleases and DeleteReleasesForSync. Accumulate them in DeleteFailed for consistency. Also add exectest.Helm.DeletedMutex guarding the Deleted append in DeleteRelease (mirroring DiffMutex/ReleasesMutex), so concurrent successful-deletion tests can run under -race; add TestHelmState_DeleteReleasesConcurrently as the successful-deletion counterpart of TestHelmState_DeleteFailedReleasesConcurrently. Closes helmfile#2849 (part 1 and part 2) Signed-off-by: yxxhero <[email protected]>
yxxhero
requested review from
aditmeno,
itscaro,
mumoshu,
xiaomudk and
zhaque44
as code owners
October 24, 2026 02:41
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fixes match the acceptance criteria and existing patterns, with regression coverage and no identified blocking issues.
No open issues 🎉
What changed in this PR
Addresses the follow-ups from #2843 tracked in #2849 by aligning failed-uninstall reporting and supporting concurrency-safe deletion recording in the Helm test double.
Changes:
- Report all three failure paths in
SyncReleases’ undesired-release uninstall branch throughDeleteFailed. - Add
DeletedMutexand use the existing synchronization helper for deletion recording. - Add regression tests for failed undesired-release uninstalls and successful concurrent deletions.
| File | Description |
|---|---|
pkg/state/state.go |
Classifies undesired-release uninstall failures as failed deletions. |
pkg/state/state_test.go |
Tests deletion failure reporting and successful concurrent deletion recording. |
pkg/exectest/helm.go |
Adds mutex-backed synchronization for the Deleted append. |
Review effort: Balanced
xiaomudk
approved these changes
Oct 27, 2026
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.
Closes #2849
Problem
Two leftovers from the #2843 review round:
SyncReleases' defensive!Desired()uninstall branch accumulated failures inAffectedReleases.Failed, rendering them under the Failed Releases table instead of Failed to Delete Releases — inconsistent withDeleteReleasesandDeleteReleasesForSync.exectest.Helm.Deletedwas appended without a mutex (unlikeDiffMutex/ReleasesMutex), making concurrent successful-deletion tests unsafe under-race.Solution
!Desired()branch toaffectedReleases.DeleteFailed.exectest.Helm.DeletedMutexand guard theDeleteReleaseappend via the existinghelm.synchelper.TestHelmState_SyncReleasesUndesiredDeleteFailureReportsDeleteFailed(1 and 2 failinginstalled: falsereleases) andTestHelmState_DeleteReleasesConcurrently(5 releases, concurrency 3, successful-deletion counterpart of the existing failed-deletion test).Verification
-racego test ./pkg/state/ -run 'SyncReleases' -raceandgo test ./pkg/app/ -run 'Sync|Apply|Destroy'— greengofmtclean