You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(ansible): the check-mode query guard trusts a self-declared verify-after-install marker, and the marker+check_mode:false rejection has no fixture #19883
Found in the review of PR #19814 (#19663) at head 024ffbd. Neither finding blocks the PR.
repo_tests/_ansible_query_tasks.pyis_verify_after_install accepts any task that carries when: not ansible_check_mode. A probe whose registered result a later task reads could be marked that way, and the guard would accept it, so under --check the reader would see a skipped result.
The guard rejects a task that carries both the marker and check_mode: false (is_check_safe), but no fixture pins that rejection.
The guard fails when a task carrying the marker registers a name that another task reads without | default(...) or is defined.
A fixture pins that the marker plus check_mode: false plus changed_when: false is rejected.
Correction to this issue's wording, from the review of #20433: is defined on the bare registered name is not a guard. Under --check a skipped task registers {"skipped": true}, so v is defined is true and v is defined and v.rc == 0 still fails. A real --check run printed v is defined true, v.rc is defined false, v is skipped true. The guard accepts | default(...), v is [not] skipped, v.skipped is not defined and v.<attr> is [not] defined.
Landed through the merge train (PR #20458) as #20433, main 0dbb02f. Each symbol below was confirmed on main.
AC
Evidence
Guard fails when a marked task's result is read unguarded
repo_tests/_ansible_query_tasks.py::marked_verify_read_unguarded, run on the tree by test_no_marked_verify_has_a_reader_that_breaks_under_check. Differs from the wording: bare is defined is not accepted as a guard, because a skipped task's result is defined; see the correction above.
Marker plus check_mode: false plus changed_when: false is rejected
::test_the_marker_with_check_mode_off_is_rejected
Both covered by a passing contrast
::test_contrast_the_marker_alone_passes and the accepted cases in test_a_marked_verify_may_not_decide_a_later_task
Activity
mrveiss commentedon Nov 1, 2026
Correction to this issue's wording, from the review of #20433:
is definedon the bare registered name is not a guard. Under--checka skipped task registers{"skipped": true}, sov is definedis true andv is defined and v.rc == 0still fails. A real--checkrun printedv is definedtrue,v.rc is definedfalse,v is skippedtrue. The guard accepts| default(...),v is [not] skipped,v.skipped is not definedandv.<attr> is [not] defined.fix(guard): bare is-defined guards nothing against a skipped task, an…
mrveiss commentedon Nov 1, 2026
Landed through the merge train (PR #20458) as #20433, main 0dbb02f. Each symbol below was confirmed on
main.repo_tests/_ansible_query_tasks.py::marked_verify_read_unguarded, run on the tree bytest_no_marked_verify_has_a_reader_that_breaks_under_check. Differs from the wording: bareis definedis not accepted as a guard, because a skipped task's result is defined; see the correction above.check_mode: falsepluschanged_when: falseis rejected::test_the_marker_with_check_mode_off_is_rejected::test_contrast_the_marker_alone_passesand the accepted cases intest_a_marked_verify_may_not_decide_a_later_taskReaders in other files of a role are not seen.