Skip to content

Commit

Permalink
Record and list reference bundle inputs in job
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Feb 9, 2024
1 parent d53a14e commit f2dfe2f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lib/galaxy/managers/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,23 +901,24 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None)

for input in input_params.values():
if input.name in param_values:
input_value = param_values[input.name]
if input.type == "repeat":
for i in range(len(param_values[input.name])):
rval.extend(inputs_recursive(input.inputs, param_values[input.name][i], depth=depth + 1))
for i in range(len(input_value)):
rval.extend(inputs_recursive(input.inputs, input_value[i], depth=depth + 1))
elif input.type == "section":
# Get the value of the current Section parameter
rval.append(dict(text=input.name, depth=depth))
rval.extend(
inputs_recursive(
input.inputs,
param_values[input.name],
input_value,
depth=depth + 1,
upgrade_messages=upgrade_messages.get(input.name),
)
)
elif input.type == "conditional":
try:
current_case = param_values[input.name]["__current_case__"]
current_case = input_value["__current_case__"]
is_valid = True
except Exception:
current_case = None
Expand All @@ -929,7 +930,7 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None)
rval.extend(
inputs_recursive(
input.cases[current_case].inputs,
param_values[input.name],
input_value,
depth=depth + 1,
upgrade_messages=upgrade_messages.get(input.name),
)
Expand All @@ -948,12 +949,16 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None)
dict(
text=input.group_title(param_values),
depth=depth,
value=f"{len(param_values[input.name])} uploaded datasets",
value=f"{len(input_value)} uploaded datasets",
)
)
elif input.type == "data" or input.type == "data_collection":
elif (
input.type == "data"
or input.type == "data_collection"
or isinstance(input_value, model.HistoryDatasetAssociation)
):
value = []
for element in listify(param_values[input.name]):
for element in listify(input_value):
element_id = element.id
if isinstance(element, model.HistoryDatasetAssociation):
hda = element
Expand All @@ -977,7 +982,7 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None)
dict(
text=label,
depth=depth,
value=input.value_to_display_text(param_values[input.name]),
value=input.value_to_display_text(input_value),
notes=upgrade_messages.get(input.name, ""),
)
)
Expand Down
3 changes: 3 additions & 0 deletions lib/galaxy/tools/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
DataCollectionToolParameter,
DataToolParameter,
RuntimeValue,
SelectToolParameter,
)
from galaxy.tools.parameters.wrapped import (
LegacyUnprefixedDict,
Expand Down Expand Up @@ -283,6 +284,8 @@ def process_dataset(data, formats=None):
value.child_collection = new_collection
else:
value.collection = new_collection
elif isinstance(input, SelectToolParameter) and isinstance(value, HistoryDatasetAssociation):
input_datasets[prefixed_name] = value

tool.visit_inputs(param_values, visitor)
return input_datasets, all_permissions
Expand Down

0 comments on commit f2dfe2f

Please sign in to comment.