Repository navigation
feat: add per-release continue-on-error support - #2804
Conversation
Work in progress for discussion helmfile#2799. This introduces the initial release-level configuration needed to continue processing independent releases after a deployment failure. The DAG execution and failure propagation behavior are still being implemented. Refs helmfile#2799 Signed-off-by: Axel Delille <[email protected]>
Review fixes for the per-release continueOnError feature: 1. Regenerate values-file ID hashes in pkg/state/temp_test.go — adding ContinueOnError to ReleaseSpec shifts generateValuesID hashes, which broke TestGenerateID (the test file notes these must be regenerated whenever ReleaseSpec changes). 2. Remove the dead skippedErrors variable in withBatches and instead log each skipped release with logger.Warnf at decision time, so users see why a release never ran instead of only learning from the final error list. 3. Aggregate all errors from a state file instead of returning only errs[0] in visitStatesWithContext/processStateFileParallel. With continueOnError, multiple releases can fail or be skipped in one run; reporting only the first error hid the skip errors (and other failures), contradicting the feature's contract. Single-error rendering is unchanged. 4. Gate tolerated errors on ReleaseErrorCodeFailure so that non-failure release errors (e.g. helm-diff's "changes detected" exit code 2 can never enable continuation or block dependents. 5. Report skipped-release messages with the dependency's plain release name instead of its kubeContext/namespace-qualified needs id (e.g. dependency database instead of default/default/database), matching the documented message format. 6. Restructure the withBatches helpers into guard-clause style (filterBlockedReleases, toleratesBatchErrors) and drop the test-only logger nil-guards in favor of a nop logger in tests. 7. Add end-to-end coverage through App.Sync with the exectest fake helm: independent releases continue after a tolerated failure, dependents are skipped with an explicit error, the exit code stays non-zero, and fail-fast remains the default without continueOnError. Also cover the non-failure error code case at the withBatches level. 8. Use new(true) instead of a boolPtr helper (CI-enforced check-modernize) and document the failure-handling interaction in docs/releases.md. Signed-off-by: yxxhero <[email protected]> EOF ) Signed-off-by: yxxhero <[email protected]>
yxxhero
left a comment
There was a problem hiding this comment.
Thanks for the PR! I did a deep review and pushed a fixup commit (47094e4) addressing the findings below. All ./pkg/... tests, golangci-lint, and make check-modernize pass.
Findings & fixes
1. CI-breaking: TestGenerateID failed 🔴
Adding ContinueOnError to ReleaseSpec shifts the spew-based hash computed by generateValuesID (the whole struct is hashed for temp values-file names). The golden values in pkg/state/temp_test.go weren't regenerated — the file even carries a NOTE warning about this. → Regenerated all 6 hashes.
2. Dead code: skippedErrors was collected but never read 🔴
As a result, a release skipped due to a failed dependency produced no output at decision time — it silently vanished from the group logs, and users only saw (part of) the error at the very end. → Removed the dead variable; each skip is now logged via logger.Warnf immediately.
3. Only the first error was reported, breaking the feature's contract 🔴
visitStatesWithContext / processStateFileParallel returned errs[0]. With continueOnError, multiple releases can fail or be skipped in one run, but users would only ever see the first error — the skip messages (this PR's own headline UX) were invisible in helmfile sync output. → Added aggregateErrors that wraps all errors into one *Error; rendering for the single-error case is byte-identical, so no behavior change for existing scenarios.
4. Skip message printed the qualified needs id instead of the release name 🟡
E2E testing showed dependency "default/default/error-database" instead of dependency "error-database" (needs are normalized to KUBECONTEXT/NS/NAME ids). → Track the failed release's spec alongside its error (blockedRelease) and print release.Name, matching the documented message format.
5. Tolerance wasn't gated on the error code 🟡
Any *ReleaseError enabled continuation. A non-failure code (e.g. helm-diff's "changes detected" exit code 2) must never be treated as a release failure that blocks dependents. → releaseErrorForContinueOnError now only tolerates ReleaseErrorCodeFailure.
6. Missing end-to-end coverage 🟡
The unit tests only exercised withBatches with a fake converge. → Added TestSync_ContinueOnError through App.Sync + exectest.Helm, verifying: independent release still deployed, dependent skipped with explicit error, exit code stays non-zero (1), and fail-fast remains the default. Also added a withBatches-level test for the non-failure error code case.
7. Style/CI details 🟢
- Replaced the
boolPtrhelper withnew(true)—make check-modernize(CI-enforced) rejects the former. - Dropped the
logger != nilguards added for tests; tests now pass a nop logger. - Restructured the batch loop into guard-clause helpers (
filterBlockedReleases,toleratesBatchErrors) with docs. - Added a "Failure handling and
continueOnError" section todocs/releases.mdnext to theneedsdocs.
Design notes (no action needed)
- With
--sequential-helmfiles(or nested helmfiles), tolerated errors still halt subsequent state files — the aggregation fix above applies within a single state file. Happy to revisit if needed. continueOnErrordeliberately only affects the DAG paths that produce*ReleaseErrorfailures (sync/apply sync phase, including deletions-for-sync); diff, chart-preparation, template, and destroy failures keep failing fast, consistent with the PR description.
Overall the approach (block-by-needs map + per-release opt-in in withBatches) is sound and well-scoped — nice work!
|
@Tsukoyachi WDYT of the neweast changes? |
|
@yxxhero Thanks for the review and for the fixup commit. I missed the I agree with the other fixes you point out for the error aggregation, skip logging, dependency-name formatting, error-code gating, and the added coverage, I’m happy with those. Thanks again for the careful review, nice work. |
…#829) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [aqua:helmfile/helmfile](https://github.com/helmfile/helmfile) | tools | patch | `1.8.0` → `1.8.1` | --- ### Release Notes <details> <summary>helmfile/helmfile (aqua:helmfile/helmfile)</summary> ### [`v1.8.1`](https://github.com/helmfile/helmfile/releases/tag/v1.8.1) [Compare Source](helmfile/helmfile@v1.8.0...v1.8.1) #### What's Changed - feat: add HELMFILE\_DISABLE\_VALS env var to skip vals processing by [@​jimmyR](https://github.com/jimmyR) in [#​2471](helmfile/helmfile#2471) - build(deps): bump github.com/mattn/go-runewidth from 0.0.29 to 0.0.30 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2796](helmfile/helmfile#2796) - build(deps): bump golang.org/x/term from 0.45.0 to 0.46.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2795](helmfile/helmfile#2795) - build(deps): bump github.com/sashabaranov/go-openai from 1.42.0 to 1.42.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2792](helmfile/helmfile#2792) - fix: cancel kubedog-tracked helm subprocesses on SIGINT/SIGTERM by [@​vulragrag-star](https://github.com/vulragrag-star) in [#​2791](helmfile/helmfile#2791) - build(deps): bump github.com/hashicorp/go-getter/v2 from 2.2.3 to 2.2.4 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2793](helmfile/helmfile#2793) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.3 to 1.33.4 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2794](helmfile/helmfile#2794) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.111.0 to 1.113.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2797](helmfile/helmfile#2797) - build: update Go to 1.27.1 and modernize the codebase by [@​yxxhero](https://github.com/yxxhero) in [#​2798](helmfile/helmfile#2798) - build(deps): bump github.com/helmfile/chartify from 0.28.2 to 0.29.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2803](helmfile/helmfile#2803) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.4 to 1.33.5 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2801](helmfile/helmfile#2801) - build(deps): bump github.com/hashicorp/hcl/v2 from 2.24.0 to 2.25.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2802](helmfile/helmfile#2802) - feat: add per-release continue-on-error support by [@​Tsukoyachi](https://github.com/Tsukoyachi) in [#​2804](helmfile/helmfile#2804) - fix: remove partially extracted chart when helm pull fails by [@​schmidtjohannes](https://github.com/schmidtjohannes) in [#​2805](helmfile/helmfile#2805) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.113.1 to 1.113.2 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2808](helmfile/helmfile#2808) - build(deps): bump github.com/helmfile/vals from 0.46.1 to 0.47.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2806](helmfile/helmfile#2806) - ci: publish a signed packslip with each release by [@​jdx](https://github.com/jdx) in [#​2809](helmfile/helmfile#2809) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.113.2 to 1.113.4 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2811](helmfile/helmfile#2811) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.5 to 1.33.6 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2810](helmfile/helmfile#2810) - add --track-logs-interval flag by [@​pznamensky](https://github.com/pznamensky) in [#​2807](helmfile/helmfile#2807) - fix: drop leading dot from release condition error message by [@​Cayan](https://github.com/Cayan) in [#​2812](helmfile/helmfile#2812) #### New Contributors - [@​jimmyR](https://github.com/jimmyR) made their first contribution in [#​2471](helmfile/helmfile#2471) - [@​vulragrag-star](https://github.com/vulragrag-star) made their first contribution in [#​2791](helmfile/helmfile#2791) - [@​Tsukoyachi](https://github.com/Tsukoyachi) made their first contribution in [#​2804](helmfile/helmfile#2804) - [@​schmidtjohannes](https://github.com/schmidtjohannes) made their first contribution in [#​2805](helmfile/helmfile#2805) - [@​jdx](https://github.com/jdx) made their first contribution in [#​2809](helmfile/helmfile#2809) - [@​pznamensky](https://github.com/pznamensky) made their first contribution in [#​2807](helmfile/helmfile#2807) - [@​Cayan](https://github.com/Cayan) made their first contribution in [#​2812](helmfile/helmfile#2812) **Full Changelog**: <helmfile/helmfile@v1.8.0...v1.8.1> </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/London) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzMuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjEzMy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.hayden.moe/hayden/phoebe/pulls/829
Summary
This pull request implements the feature discussed in discussion #2799.
It adds per-release control over fail-fast behavior, allowing independent releases to continue being deployed when another release fails.
Example:
Behavior
continueOnError: trueallows independent releases to continue after this release fails.atomicrollbackOnFailurecleanupOnFailwaitcontinueOnErroronly affects Helmfile orchestration. It does not disable Helm rollback behavior and does not turn a failed deployment into a successful command.Testing
The implementation includes repository tests covering:
continueOnErrorparsing and release configuration;atomicandrollbackOnFailure.The relevant Go tests were run locally, including race-detector coverage.
Additional tests cover release dependencies and preservation of the default fail-fast behavior.
Documentation
The release configuration documentation was updated to describe
continueOnError, its default behavior, and its interaction with release dependencies and Helm rollback options.AI Assistance
AI tools were used during the development of this feature to:
continueOnErrorbehavior;All generated suggestions were reviewed, adapted, and validated against the repository code and test suite.
Related to discussion #2799.