diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index 7404c78854a7..b54afd169066 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -1413,7 +1413,7 @@ def _workflow_to_dict_export(self, trans, stored=None, workflow=None, internal=F If `allow_upgrade`, the workflow and sub-workflows might use updated tool versions when refactoring. """ annotation_str = "" - tag_str = "" + tags_list = [] annotation_owner = None if stored is not None: if stored.id: @@ -1424,7 +1424,7 @@ def _workflow_to_dict_export(self, trans, stored=None, workflow=None, internal=F or self.get_item_annotation_str(trans.sa_session, annotation_owner, stored) or "" ) - tag_str = stored.make_tag_string_list() + tags_list = stored.make_tag_string_list() else: # dry run with flushed workflow objects, just use the annotation annotations = stored.annotations @@ -1437,7 +1437,7 @@ def _workflow_to_dict_export(self, trans, stored=None, workflow=None, internal=F data["format-version"] = "0.1" data["name"] = workflow.name data["annotation"] = annotation_str - data["tags"] = tag_str + data["tags"] = tags_list if workflow.uuid is not None: data["uuid"] = str(workflow.uuid) steps: Dict[int, Dict[str, Any]] = {} diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index 852f9bc806a2..81d52c6fcd50 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -7621,6 +7621,13 @@ def _all_user_invocation_ids(self): invocation_ids = [i["id"] for i in all_invocations_for_user.json()] return invocation_ids + def test_subworkflow_tags(self): + workflow = self.workflow_populator.load_workflow_from_resource("test_subworkflow_with_tags") + workflow_id = self.workflow_populator.create_workflow(workflow) + downloaded_workflow = self._download_workflow(workflow_id) + subworkflow = downloaded_workflow["steps"]["1"]["subworkflow"] + assert subworkflow["tags"] == [] + class TestAdminWorkflowsApi(BaseWorkflowsApiTestCase): require_admin_user = True diff --git a/lib/galaxy_test/base/data/test_subworkflow_with_tags.ga b/lib/galaxy_test/base/data/test_subworkflow_with_tags.ga new file mode 100644 index 000000000000..9b5fb172320a --- /dev/null +++ b/lib/galaxy_test/base/data/test_subworkflow_with_tags.ga @@ -0,0 +1,134 @@ +{ + "a_galaxy_workflow": "true", + "annotation": "Test main ", + "comments": [], + "format-version": "0.1", + "name": "Unnamed Workflow", + "report": { + "markdown": "\n# Workflow Execution Report\n\n## Workflow Inputs\n```galaxy\ninvocation_inputs()\n```\n\n## Workflow Outputs\n```galaxy\ninvocation_outputs()\n```\n\n## Workflow\n```galaxy\nworkflow_display()\n```\n" + }, + "steps": { + "0": { + "annotation": "", + "content_id": null, + "errors": null, + "id": 0, + "input_connections": {}, + "inputs": [], + "label": null, + "name": "Input dataset", + "outputs": [], + "position": { + "left": 0, + "top": 0 + }, + "tool_id": null, + "tool_state": "{\"optional\": false, \"tag\": null}", + "tool_version": null, + "type": "data_input", + "uuid": "967583e9-d2a6-444a-ba31-6fb749d03f9e", + "when": null, + "workflow_outputs": [] + }, + "1": { + "annotation": "", + "id": 1, + "input_connections": { + "0:Input dataset": { + "id": 0, + "input_subworkflow_step_id": 0, + "output_name": "output" + } + }, + "inputs": [], + "label": null, + "name": "Workflow with tags", + "outputs": [], + "position": { + "left": 249, + "top": 51 + }, + "subworkflow": { + "a_galaxy_workflow": "true", + "annotation": "", + "comments": [], + "format-version": "0.1", + "name": "Workflow with tags", + "report": { + "markdown": "\n# Workflow Execution Report\n\n## Workflow Inputs\n```galaxy\ninvocation_inputs()\n```\n\n## Workflow Outputs\n```galaxy\ninvocation_outputs()\n```\n\n## Workflow\n```galaxy\nworkflow_display()\n```\n" + }, + "steps": { + "0": { + "annotation": "", + "content_id": null, + "errors": null, + "id": 0, + "input_connections": {}, + "inputs": [], + "label": null, + "name": "Input dataset", + "outputs": [], + "position": { + "left": 0, + "top": 0.0 + }, + "tool_id": null, + "tool_state": "{\"optional\": false, \"tag\": null}", + "tool_version": null, + "type": "data_input", + "uuid": "eca9b088-ff50-4253-8387-01512f03ff2f", + "when": null, + "workflow_outputs": [] + }, + "1": { + "annotation": "", + "content_id": "addValue", + "errors": null, + "id": 1, + "input_connections": { + "input": { + "id": 0, + "output_name": "output" + } + }, + "inputs": [ + { + "description": "runtime parameter for tool Add column", + "name": "input" + } + ], + "label": null, + "name": "Add column", + "outputs": [ + { + "name": "out_file1", + "type": "input" + } + ], + "position": { + "left": 123, + "top": 112.0 + }, + "post_job_actions": {}, + "tool_id": "addValue", + "tool_state": "{\"exp\": \"1\", \"input\": {\"__class__\": \"RuntimeValue\"}, \"iterate\": \"no\", \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_version": "1.0.0", + "type": "tool", + "uuid": "7016e754-149b-402a-bb17-eb6cd4b1ab0a", + "when": null, + "workflow_outputs": [] + } + }, + "uuid": "c33370a9-188f-4af8-bfcc-137c577c79ba" + }, + "tool_id": null, + "type": "subworkflow", + "uuid": "90bdcd13-418a-49da-847e-02926942bf4b", + "when": null, + "workflow_outputs": [] + } + }, + "tags": [], + "uuid": "64d7fac3-6402-412b-9db6-490ffc18e129", + "version": 1 +} \ No newline at end of file