Skip to content

feat: add per-release continue-on-error support - #2804

Merged
yxxhero merged 2 commits into
helmfile:mainfrom
Tsukoyachi:feat/add-fail-fast-deactivation
Sep 20, 2026
Merged

yxxhero merged 2 commits into
helmfile:mainfrom
Tsukoyachi:feat/add-fail-fast-deactivation

Conversation

@Tsukoyachi

Copy link
Copy Markdown
Contributor

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:

releases:
  - name: app-a
    chart: ./charts/app-a
    continueOnError: true

  - name: app-b
    chart: ./charts/app-b
    continueOnError: true

Behavior

  • Releases keep the existing fail-fast behavior by default.
  • continueOnError: true allows independent releases to continue after this release fails.
  • Failed releases are still reported at the end of the command.
  • Helmfile still exits with a non-zero status when one or more releases fail.
  • Releases depending on a failed release are not deployed.
  • Independent branches of the release DAG can continue processing.
  • Existing Helm behavior is preserved, including:
    • atomic
    • rollbackOnFailure
    • cleanupOnFail
    • wait
    • release hooks
    • release tracking
    • concurrency limits

continueOnError only 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:

  • continueOnError parsing and release configuration;
  • continuation of independent releases after a failure;
  • blocking releases whose dependencies failed;
  • preservation of the default fail-fast behavior;
  • aggregation of release errors and non-zero command status;
  • compatibility with Helm rollback options such as atomic and rollbackOnFailure.

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:

  • explore the Helmfile repository and identify the release execution, DAG planning, and error-handling paths;
  • help design the per-release continueOnError behavior;
  • suggest relevant test scenarios and documentation updates;
  • review the implementation approach and identify edge cases involving dependencies, concurrency, and Helm rollback behavior.

All generated suggestions were reviewed, adapted, and validated against the repository code and test suite.

Related to discussion #2799.

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 yxxhero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 boolPtr helper with new(true) — make check-modernize (CI-enforced) rejects the former.
  • Dropped the logger != nil guards 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 to docs/releases.md next to the needs docs.

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.
  • continueOnError deliberately only affects the DAG paths that produce *ReleaseError failures (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!

@yxxhero

yxxhero commented Sep 20, 2026

Copy link
Copy Markdown
Member

@Tsukoyachi WDYT of the neweast changes?

@Tsukoyachi

Tsukoyachi commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

@yxxhero Thanks for the review and for the fixup commit. I missed the generateValuesID regen in temp_test.go, sorry about that.

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.

@yxxhero
yxxhero merged commit ca58090 into helmfile:main Sep 20, 2026
16 checks passed
hbjydev pushed a commit to hbjydev/phoebe that referenced this pull request Oct 5, 2026
…#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 [@&#8203;jimmyR](https://github.com/jimmyR) in [#&#8203;2471](helmfile/helmfile#2471)
- build(deps): bump github.com/mattn/go-runewidth from 0.0.29 to 0.0.30 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2796](helmfile/helmfile#2796)
- build(deps): bump golang.org/x/term from 0.45.0 to 0.46.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2795](helmfile/helmfile#2795)
- build(deps): bump github.com/sashabaranov/go-openai from 1.42.0 to 1.42.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2792](helmfile/helmfile#2792)
- fix: cancel kubedog-tracked helm subprocesses on SIGINT/SIGTERM by [@&#8203;vulragrag-star](https://github.com/vulragrag-star) in [#&#8203;2791](helmfile/helmfile#2791)
- build(deps): bump github.com/hashicorp/go-getter/v2 from 2.2.3 to 2.2.4 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2793](helmfile/helmfile#2793)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.3 to 1.33.4 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;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 [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2797](helmfile/helmfile#2797)
- build: update Go to 1.27.1 and modernize the codebase by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2798](helmfile/helmfile#2798)
- build(deps): bump github.com/helmfile/chartify from 0.28.2 to 0.29.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2803](helmfile/helmfile#2803)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.4 to 1.33.5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2801](helmfile/helmfile#2801)
- build(deps): bump github.com/hashicorp/hcl/v2 from 2.24.0 to 2.25.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2802](helmfile/helmfile#2802)
- feat: add per-release continue-on-error support by [@&#8203;Tsukoyachi](https://github.com/Tsukoyachi) in [#&#8203;2804](helmfile/helmfile#2804)
- fix: remove partially extracted chart when helm pull fails by [@&#8203;schmidtjohannes](https://github.com/schmidtjohannes) in [#&#8203;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 [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2808](helmfile/helmfile#2808)
- build(deps): bump github.com/helmfile/vals from 0.46.1 to 0.47.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2806](helmfile/helmfile#2806)
- ci: publish a signed packslip with each release by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;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 [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2811](helmfile/helmfile#2811)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.5 to 1.33.6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2810](helmfile/helmfile#2810)
- add --track-logs-interval flag by [@&#8203;pznamensky](https://github.com/pznamensky) in [#&#8203;2807](helmfile/helmfile#2807)
- fix: drop leading dot from release condition error message by [@&#8203;Cayan](https://github.com/Cayan) in [#&#8203;2812](helmfile/helmfile#2812)

#### New Contributors

- [@&#8203;jimmyR](https://github.com/jimmyR) made their first contribution in [#&#8203;2471](helmfile/helmfile#2471)
- [@&#8203;vulragrag-star](https://github.com/vulragrag-star) made their first contribution in [#&#8203;2791](helmfile/helmfile#2791)
- [@&#8203;Tsukoyachi](https://github.com/Tsukoyachi) made their first contribution in [#&#8203;2804](helmfile/helmfile#2804)
- [@&#8203;schmidtjohannes](https://github.com/schmidtjohannes) made their first contribution in [#&#8203;2805](helmfile/helmfile#2805)
- [@&#8203;jdx](https://github.com/jdx) made their first contribution in [#&#8203;2809](helmfile/helmfile#2809)
- [@&#8203;pznamensky](https://github.com/pznamensky) made their first contribution in [#&#8203;2807](helmfile/helmfile#2807)
- [@&#8203;Cayan](https://github.com/Cayan) made their first contribution in [#&#8203;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
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.

2 participants