Skip to content

Commit

Permalink
Fix extract workflow from history with empty mapped over collections
Browse files Browse the repository at this point in the history
Fixes #18484.

It's not ideal on the one hand, but better to have a workflow with gaps
than an internal server error IMO. We do the same for datasets in some
non-terminal states.
  • Loading branch information
mvdbeek committed Aug 7, 2024
1 parent 5ae1363 commit 0f77df7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/galaxy/webapps/galaxy/controllers/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ def build_from_current_history(
# Optionally target a different history than the current one.
history = self.history_manager.get_owned(self.decode_id(history_id), trans.user, current_history=history)
if not user:
trans.response.status = 403
return trans.show_error_message("Must be logged in to create workflows")
if (job_ids is None and dataset_ids is None) or workflow_name is None:
jobs, warnings = summarize(trans, history)
Expand Down
10 changes: 9 additions & 1 deletion lib/galaxy/workflow/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,15 @@ def __summarize_dataset_collection(self, dataset_collection):
# tracking with creating_job_associations. Will delete at some point.
elif dataset_collection.implicit_output_name:
# TODO: Optimize db call
dataset_instance = dataset_collection.collection.dataset_instances[0]
element = dataset_collection.collection.first_dataset_element
if not element:
# Got no dataset instance to walk back up to creating job.
# TODO track this via tool request model
job = DatasetCollectionCreationJob(dataset_collection)
self.jobs[job] = [(None, dataset_collection)]
return
else:
dataset_instance = element.hda
if not self.__check_state(dataset_instance):
# Just checking the state of one instance, don't need more but
# makes me wonder if even need this check at all?
Expand Down

0 comments on commit 0f77df7

Please sign in to comment.