feat: add register, changed_when, failed_when, and ignore_errors#230
Merged
josegonzalez merged 1 commit intomainfrom Apr 29, 2026
Merged
Conversation
Activates the four envelope keys reserved by #205. After each task runs, `failed_when` overrides the failure verdict (clearing both the error and any state-mismatch when falsy, matching Ansible), then `changed_when` overrides the changed flag, then `register` snapshots the post-override result for later tasks to read at `.registered.<name>`. `ignore_errors: true` keeps the run going past an erroring task on the apply path; the error event still emits with `(ignored)` in human output and `ignored: true` in JSON. Loop expansions accumulate per-iteration states under `Results` and roll up the embedded `Changed` / `Error` fields Ansible-style. The registered map is shared across plays in one docket invocation; duplicate `register:` names surface as a parse-time `register_duplicate` problem in `validate`. Probe-error stderr is plumbed through a new `*subprocess.ExecError` wrapper so `failed_when: 'result.Stderr contains ...'` works on the plan-probe path too without changing every probe helper signature.
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.
Summary
Activates the four envelope keys reserved by #205. After each task runs,
failed_whenoverrides the failure verdict (clearing both the error and any state-mismatch when falsy, matching Ansible), thenchanged_whenoverrides the changed flag, thenregistersnapshots the post-override result for later tasks to read at.registered.<name>.ignore_errors: truekeeps the run going past an erroring task on the apply path; the error event still emits with(ignored)in human output andignored: truein JSON.Loop expansions accumulate per-iteration states under
Resultsand roll up the embeddedChanged/Errorfields Ansible-style:registered.foo.Changedis true if any iteration changed, whileregistered.foo.Results[i]carries the per-iteration state. The registered map is shared across plays in one docket invocation; duplicateregister:names surface as a parse-timeregister_duplicateproblem invalidate.Probe-error stderr is plumbed through a new
*subprocess.ExecErrorwrapper sofailed_when: 'result.Stderr contains ...'works on the plan-probe path too without changing every probe helper signature.Closes #210.