Closed fdaguin closed 1 year ago
Hi @fdaguin, thanks for the feedback! Nice to see someone using the new feature already.
This is an interesting problem actually... what exactly should happen when running a switch task as a dry run? Normally dry run means no tasks are actually executed, but if the control task is not executed then we can't know which case would be executed...
My feeling is that the in this case we should make an exception and execute the control task, with the assumption that it isn't meant to have any side effects.
Alternatively it could result in something like:
Poe <= check_number[control]
Poe => <unresolved case>
What do you think?
Thanks a lot for this neat feature! ✌️ I will use it to launch different commands between a dev workstation and a CI system!
As for your suggestions, both points are completely valid and I'm also in favor for the control task being executed. What about a boolean option like control.check_mode
to switch between the two, like Ansible check mode?
This issue is fixed in v0.18.1. I went with not running the control task in the end because I figured running any tasks in dry-mode could be surprising, and for consistency with handling the similar issue with tasks that define the "uses" option to depend on the output of other tasks.
Thanks @nat-n!
Expected Behavior
When invoking a task of type
switch
in--dry-run
mode, no error is thrown.Actual Behavior
A
KeyError: ('task_name[control]',)
is thrown.Steps to Reproduce the Problem
Define the following tasks:
BEST_NUMBER=12 poe check_number
and expect no error:BEST_NUMBER=12 poe --dry-run check_number
and expect an error:Specifications