From 4588977a82db7a40c0f94a1b2236539af887e902 Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 14 Oct 2020 18:07:23 +0200 Subject: [PATCH 1/2] Fix handling of collection element identifiers in history panel --- client/galaxy/scripts/mvc/dataset/dataset-li-edit.js | 3 ++- client/galaxy/scripts/mvc/dataset/dataset-li.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js index 742b2f33170..2367ba5910b 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js @@ -66,8 +66,9 @@ var DatasetListItemEdit = _super.extend( const Galaxy = getGalaxyInstance(); if (Galaxy.router) { ev.preventDefault(); + const identifier = self.model.get("element_id") || self.model.get("id"); Galaxy.router.push("datasets/edit", { - dataset_id: self.model.attributes.id + dataset_id: identifier }); } } diff --git a/client/galaxy/scripts/mvc/dataset/dataset-li.js b/client/galaxy/scripts/mvc/dataset/dataset-li.js index 17f2701edbd..efdb5353809 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-li.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-li.js @@ -184,7 +184,8 @@ export var DatasetListItemView = _super.extend( const Galaxy = getGalaxyInstance(); if (Galaxy.frame && Galaxy.frame.active) { // Add dataset to frames. - Galaxy.frame.addDataset(self.model.get("id")); + const identifier = self.model.get("element_id") || self.model.get("id"); + Galaxy.frame.addDataset(identifier); ev.preventDefault(); } }; From 6500e32f371a39d2e7d6ff05109418b478f2c74a Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 26 Oct 2020 14:46:27 +0100 Subject: [PATCH 2/2] Fix get_output_path when HDA identity changes @RJMW reported this on gitter: ``` galaxy.jobs.runners ERROR 2020-10-13 09:34:24,937 [p:23472,w:1,m:0] [SlurmRunner.monitor_thread] (442471) Failure preparing job Traceback (most recent call last): File "lib/galaxy/jobs/runners/__init__.py", line 236, in prepare_job job_wrapper.prepare() File "lib/galaxy/jobs/__init__.py", line 1077, in prepare tool_evaluator.set_compute_environment(compute_environment, get_special=get_special) File "lib/galaxy/tools/evaluation.py", line 110, in set_compute_environment output_collections=out_collections, File "lib/galaxy/tools/evaluation.py", line 149, in build_param_dict self.__populate_output_dataset_wrappers(param_dict, output_datasets, job_working_directory) File "lib/galaxy/tools/evaluation.py", line 341, in __populate_output_dataset_wrappers param_dict[name] = DatasetFilenameWrapper(hda, compute_environment=self.compute_environment, io_type="output") File "lib/galaxy/tools/wrappers.py", line 289, in __init__ path_rewrite = compute_environment and compute_environment.output_path_rewrite(dataset) File "lib/galaxy/jobs/__init__.py", line 2546, in output_path_rewrite dataset_path = self.job_wrapper.get_output_path(dataset) File "lib/galaxy/jobs/__init__.py", line 1912, in get_output_path raise KeyError("Couldn't find job output for [%s] in [%s]" % (dataset, self.output_hdas_and_paths.values())) KeyError: "Couldn't find job output for [] in [dict_values([(, )])]" ``` The HDA with the id 714739 is present in the outputs, but the identity is not the same. I don't know why that happened (maybe a flush?) but in this case it should be safe to compare HDAs by database id. --- lib/galaxy/jobs/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index cde61b8df24..10c3de9c91b 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -1910,13 +1910,14 @@ class JobWrapper(HasResourceParameters): return self.output_paths def get_output_path(self, dataset): + if getattr(dataset, "fake_dataset_association", False): + return dataset.file_name + assert dataset.id is not None, "{} needs to be flushed to find output path".format(dataset) if self.output_paths is None: self.compute_outputs() for (hda, dataset_path) in self.output_hdas_and_paths.values(): - if hda == dataset: + if hda.id == dataset.id: return dataset_path - if getattr(dataset, "fake_dataset_association", False): - return dataset.file_name raise KeyError("Couldn't find job output for [%s] in [%s]" % (dataset, self.output_hdas_and_paths.values())) def get_mutable_output_fnames(self):