Skip to content

Commit

Permalink
Fix dropped when_expression on workflow/tool_upgrade
Browse files Browse the repository at this point in the history
Fixes #18441
  • Loading branch information
mvdbeek committed Jun 27, 2024
1 parent 5050ccd commit ed8dc4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/galaxy/workflow/refactor/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ def _patch_step(self, execution, step, step_def):
if upgrade_input["name"] == input_name:
matching_input = upgrade_input
break
elif step.when_expression and f"inputs.{input_name}" in step.when_expression:
# TODO: eventually track step inputs more formally
matching_input = upgrade_input

# In the future check parameter type, format, mapping status...
if matching_input is None:
Expand Down
4 changes: 3 additions & 1 deletion test/integration/test_workflow_refactoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,11 @@ def test_tool_version_upgrade_keeps_when_expression(self):
the_step:
tool_id: multiple_versions
tool_version: '0.1'
in:
when: the_bool
state:
inttest: 0
when: $inputs.the_bool
when: $(inputs.when)
"""
)
assert self._latest_workflow.step_by_label("the_step").tool_version == "0.1"
Expand Down

0 comments on commit ed8dc4b

Please sign in to comment.