diff --git a/lib/galaxy/tool_util/xsd/galaxy.xsd b/lib/galaxy/tool_util/xsd/galaxy.xsd index c8f67bd61c2f..a8898d2b8ec3 100644 --- a/lib/galaxy/tool_util/xsd/galaxy.xsd +++ b/lib/galaxy/tool_util/xsd/galaxy.xsd @@ -4123,7 +4123,8 @@ dataset for the contained input of the type specified using the ``type`` tag. - + + @@ -4135,21 +4136,52 @@ collection types (the most common types are ``list``, ``paired``, ]]> - + + - - - - - + + + + + + + + + + + + + + + + + + + + Name (and element identifier) for this element + + + + + + + + diff --git a/lib/galaxy/workflow/modules.py b/lib/galaxy/workflow/modules.py index ce599ba6ec4c..fd6f7baa5c61 100644 --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -99,6 +99,8 @@ if TYPE_CHECKING: from galaxy.schema.invocation import InvocationMessageUnion + from galaxy.workflow.run import WorkflowProgress + log = logging.getLogger(__name__) @@ -176,7 +178,7 @@ def to_cwl(value, hda_references, step): return value -def from_cwl(value, hda_references, progress): +def from_cwl(value, hda_references, progress: WorkflowProgress): # TODO: turn actual files into HDAs here ... somehow I suppose. Things with # file:// locations for instance. if isinstance(value, dict) and "class" in value and "location" in value: diff --git a/lib/galaxy/workflow/run.py b/lib/galaxy/workflow/run.py index 3cb73768e997..322a8800b616 100644 --- a/lib/galaxy/workflow/run.py +++ b/lib/galaxy/workflow/run.py @@ -328,6 +328,8 @@ def _invoke_step(self, invocation_step: WorkflowInvocationStep) -> Optional[bool class ModuleInjector(Protocol): + trans: "WorkRequestContext" + def inject(self, step, step_args=None, steps=None, **kwargs): pass @@ -699,6 +701,9 @@ def subworkflow_progress( when_values=when_values, ) + def raw_to_galaxy(self, value: dict): + return raw_to_galaxy(self.module_injector.trans, value) + def _recover_mapping(self, step_invocation: WorkflowInvocationStep) -> None: try: step_invocation.workflow_step.module.recover_mapping(step_invocation, self) diff --git a/test/unit/workflows/test_workflow_progress.py b/test/unit/workflows/test_workflow_progress.py index 5abe1013f106..1a899ce93583 100644 --- a/test/unit/workflows/test_workflow_progress.py +++ b/test/unit/workflows/test_workflow_progress.py @@ -1,9 +1,15 @@ +from typing import cast + from galaxy import model from galaxy.model.base import transaction from galaxy.util.unittest import TestCase -from galaxy.workflow.run import WorkflowProgress +from galaxy.workflow.run import ( + ModuleInjector, + WorkflowProgress, +) from .workflow_support import ( MockApp, + MockTrans, yaml_to_model, ) @@ -76,7 +82,8 @@ def _setup_workflow(self, workflow_yaml): self.invocation.workflow = workflow def _new_workflow_progress(self): - return WorkflowProgress(self.invocation, self.inputs_by_step_id, MockModuleInjector(self.progress), {}) + mock_injector: ModuleInjector = cast(ModuleInjector, MockModuleInjector(self.progress)) + return WorkflowProgress(self.invocation, self.inputs_by_step_id, mock_injector, {}) def _set_previous_progress(self, outputs): for i, (step_id, step_value) in enumerate(outputs): @@ -242,6 +249,7 @@ def compute_runtime_state(self, step, step_args=None): class MockModule: def __init__(self, progress): self.progress = progress + self.trans = MockTrans() def decode_runtime_state(self, step, runtime_state): return True