Commit ed12de0
committed
fix(workflows): fail command-step before dispatch on non-mapping options
Address Copilot review on #3496. The prior guard silently skipped the
merge for a non-mapping ``options`` and still called ``_try_dispatch``,
so with an installed CLI a malformed step could return ``COMPLETED``
instead of the clean field-specific failure the PR claimed. The
regression test also masked this by forcing ``shutil.which`` to ``None``,
which made the observed ``FAILED`` unrelated to ``options``.
Changes:
- ``execute()`` returns a field-named ``FAILED`` result *before*
dispatch when ``options`` is not a mapping. Workflow-level defaults
are preserved in ``output.options`` and ``dispatched`` is ``False``.
- ``test_execute_non_mapping_options_fails_before_dispatch`` (renamed)
now mocks ``_try_dispatch`` to a *success* result so an accidental
dispatch would surface as ``COMPLETED``, and asserts the dispatch
mock is never called and the error string names ``'options'``.
- ``test_validate_rejects_non_mapping_options`` covers ``None`` (a
bare YAML ``options:``), matching the documented behavior.
Refs #3493.1 parent 3c9aa1f commit ed12de0
2 files changed
Lines changed: 53 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
| 963 | + | |
963 | 964 | | |
964 | 965 | | |
965 | 966 | | |
966 | | - | |
967 | | - | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
968 | 970 | | |
969 | 971 | | |
970 | 972 | | |
| |||
980 | 982 | | |
981 | 983 | | |
982 | 984 | | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
983 | 1020 | | |
984 | 1021 | | |
985 | 1022 | | |
| |||
0 commit comments