From 94a12eee30418ded45a34cd9e5f1d3a9beceb171 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 17 Oct 2023 16:32:58 +0200 Subject: [PATCH] Copy ``tool_version`` on workflow steps when copying workflows This is a problem when importing a shared workflow. --- lib/galaxy/model/__init__.py | 1 + lib/galaxy_test/api/test_workflows.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 6652ff72814d..6ca9445c5666 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -7765,6 +7765,7 @@ def copy_to(self, copied_step, step_mapping, user=None): copied_step.order_index = self.order_index copied_step.type = self.type copied_step.tool_id = self.tool_id + copied_step.tool_version = self.tool_version copied_step.tool_inputs = self.tool_inputs copied_step.tool_errors = self.tool_errors copied_step.position = self.position diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index f4fcd72dab21..af7633fb1882 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -1161,6 +1161,14 @@ def test_import_published(self): self._assert_status_code_is(other_import_response, 200) self._assert_user_has_workflow_with_name("imported: test_import_published") + def test_import_published_api(self): + workflow_id = self.workflow_populator.simple_workflow("test_import_published", publish=True) + with self._different_user(): + other_import_response = self.__import_workflow(workflow_id, deprecated_route=False) + self._assert_status_code_is(other_import_response, 200) + workflow = self._download_workflow(other_import_response.json()["id"]) + assert workflow["steps"]["2"]["tool_version"] == "1.0.0" + def test_export(self): uploaded_workflow_id = self.workflow_populator.simple_workflow("test_for_export") downloaded_workflow = self._download_workflow(uploaded_workflow_id)