From cde757589f7453394878f2b22fd913073c5d9c69 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 4 Jul 2024 13:16:05 +0200 Subject: [PATCH 1/8] Don't call job_runner.stop_job on jobs in new state These aren't submitted yet, no point in doing that. Fixes https://sentry.galaxyproject.org/share/issue/ea06518238f1409eb22a8f502f9db557/: ``` AssertionError: External job id is None File "galaxy/jobs/runners/drmaa.py", line 375, in stop_job assert ext_id not in (None, "None"), "External job id is None" ``` --- lib/galaxy/jobs/handler.py | 3 ++- lib/galaxy/jobs/runners/__init__.py | 3 ++- lib/galaxy/jobs/runners/aws.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/jobs/handler.py b/lib/galaxy/jobs/handler.py index 0213a797aab4..9fe6f3c9ed96 100644 --- a/lib/galaxy/jobs/handler.py +++ b/lib/galaxy/jobs/handler.py @@ -1260,7 +1260,8 @@ def stop(self, job, job_wrapper): runner_name = job_runner_name.split(":", 1)[0] log.debug(f"Stopping job {job_wrapper.get_id_tag()} in {runner_name} runner") try: - self.job_runners[runner_name].stop_job(job_wrapper) + if job.state != model.Job.states.NEW: + self.job_runners[runner_name].stop_job(job_wrapper) except KeyError: log.error(f"stop(): ({job_wrapper.get_id_tag()}) Invalid job runner: {runner_name}") # Job and output dataset states have already been updated, so nothing is done here. diff --git a/lib/galaxy/jobs/runners/__init__.py b/lib/galaxy/jobs/runners/__init__.py index bde5baedeb08..640372e7d290 100644 --- a/lib/galaxy/jobs/runners/__init__.py +++ b/lib/galaxy/jobs/runners/__init__.py @@ -581,7 +581,8 @@ def _handle_runner_state(self, runner_state, job_state: "JobState"): log.exception("Caught exception in runner state handler") def fail_job(self, job_state: "JobState", exception=False, message="Job failed", full_status=None): - if getattr(job_state, "stop_job", True): + job = job_state.job_wrapper.get_job() + if getattr(job_state, "stop_job", True) and job.state != model.Job.states.NEW: self.stop_job(job_state.job_wrapper) job_state.job_wrapper.reclaim_ownership() self._handle_runner_state("failure", job_state) diff --git a/lib/galaxy/jobs/runners/aws.py b/lib/galaxy/jobs/runners/aws.py index 5f301b078975..bd512f401a9d 100644 --- a/lib/galaxy/jobs/runners/aws.py +++ b/lib/galaxy/jobs/runners/aws.py @@ -418,7 +418,8 @@ def recover(self, job, job_wrapper): self.monitor_queue.put(ajs) def fail_job(self, job_state, exception=False): - if getattr(job_state, "stop_job", True): + job = job_state.job_wrapper.get_job() + if getattr(job_state, "stop_job", True) and job.state != model.Job.states.NEW: self.stop_job(job_state.job_wrapper) job_state.job_wrapper.reclaim_ownership() self._handle_runner_state("failure", job_state) From 3e30f2773d488347935ab5c1c4bb8068e8beb78c Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Wed, 30 Oct 2024 12:45:04 -0500 Subject: [PATCH 2/8] [24.1] Persist uploaded data between Regular and Collection upload Uses a singular `DefaultBox` component so that both the Regular and Collection tabs in the `UploadContainer` (modal) have the same files. Fixes https://github.com/galaxyproject/galaxy/issues/19081 --- .../src/components/Upload/UploadContainer.vue | 68 ++++++++++--------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/client/src/components/Upload/UploadContainer.vue b/client/src/components/Upload/UploadContainer.vue index 329e9b92315f..fac6c8ba3171 100644 --- a/client/src/components/Upload/UploadContainer.vue +++ b/client/src/components/Upload/UploadContainer.vue @@ -74,6 +74,7 @@ const props = defineProps({ }, }); +const collectionTabActive = ref(null); const extensionsSet = ref(false); const datatypesMapper = ref(null); const datatypesMapperReady = ref(false); @@ -81,6 +82,7 @@ const dbKeysSet = ref(false); const listExtensions = ref([]); const listDbKeys = ref([]); const regular = ref(null); +const regularTabActive = ref(null); const { percentage, status } = storeToRefs(useUploadStore()); @@ -112,12 +114,15 @@ const ready = computed( ); const canUploadToHistory = computed(() => currentHistory.value && canMutateHistory(currentHistory.value)); const showCollection = computed(() => !props.formats && props.multiple); -const showComposite = computed(() => !props.formats || hasCompositeExtension); -const showRegular = computed(() => !props.formats || hasRegularExtension); +const showComposite = computed(() => !props.formats || hasCompositeExtension.value); +const showRegular = computed(() => !props.formats || hasRegularExtension.value); const showRules = computed(() => !props.formats || props.multiple); function immediateUpload(files) { - regular.value?.addFiles(files, true); + if (showRegular.value) { + regularTabActive.value = true; + regular.value?.addFiles(files, true); + } } function toData(items, history_id, composite = false) { @@ -172,21 +177,12 @@ defineExpose({ - - + - - + +
From 6364764c33e559b43c911847f90bc5658757c768 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Wed, 6 Nov 2024 17:19:02 -0600 Subject: [PATCH 3/8] fix `_perform_upload` method to use proper selector --- client/src/components/Upload/UploadContainer.vue | 9 ++------- lib/galaxy/selenium/navigates_galaxy.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/client/src/components/Upload/UploadContainer.vue b/client/src/components/Upload/UploadContainer.vue index fac6c8ba3171..7b918c349545 100644 --- a/client/src/components/Upload/UploadContainer.vue +++ b/client/src/components/Upload/UploadContainer.vue @@ -177,12 +177,7 @@ defineExpose({ - + @@ -213,6 +207,7 @@ defineExpose({ Date: Thu, 7 Nov 2024 15:00:27 -0600 Subject: [PATCH 4/8] fix selectors unable to find upload start or close buttons --- client/src/utils/navigation/navigation.yml | 2 +- lib/galaxy_test/selenium/test_uploads.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/utils/navigation/navigation.yml b/client/src/utils/navigation/navigation.yml index 7ff2b7b344e7..1ced690c1267 100644 --- a/client/src/utils/navigation/navigation.yml +++ b/client/src/utils/navigation/navigation.yml @@ -1127,7 +1127,7 @@ upload: setting_space_to_tab: '.upload-space-to-tab' source_button: '#upload-row-${n} .upload-source' start: '#activity-upload' - start_button: '#btn-start' + start_button: '#regular #btn-start' new_user_welcome: selectors: diff --git a/lib/galaxy_test/selenium/test_uploads.py b/lib/galaxy_test/selenium/test_uploads.py index 6ce9607ea02e..aa8065af60de 100644 --- a/lib/galaxy_test/selenium/test_uploads.py +++ b/lib/galaxy_test/selenium/test_uploads.py @@ -182,7 +182,7 @@ def test_upload_modal_retains_content(self): self.upload_start_click() self.upload_queue_local_file(self.get_filename("1.sam")) self.upload_paste_data("some pasted data") - self.wait_for_and_click_selector("button#btn-close") + self.components.upload.close_button.wait_for_and_click() # reopen modal and check that the files are still there self.upload_start_click() @@ -191,12 +191,12 @@ def test_upload_modal_retains_content(self): # perform upload and close modal self.upload_start() - self.wait_for_and_click_selector("button#btn-close") + self.components.upload.close_button.wait_for_and_click() # add another pasted file, but don't upload it self.upload_start_click() self.upload_paste_data("some more pasted data") - self.wait_for_and_click_selector("button#btn-close") + self.components.upload.close_button.wait_for_and_click() # reopen modal and see 2 uploaded, 1 yet to upload self.upload_start_click() From d6a5f99cc186d7a3a10599900d6febc1882bbf37 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 7 Nov 2024 17:22:12 -0600 Subject: [PATCH 5/8] use explicit selector for regular tab start button (upload tour) --- config/plugins/tours/core.history.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/plugins/tours/core.history.yaml b/config/plugins/tours/core.history.yaml index d0c1ecce2f54..5f8401e0c2a0 100644 --- a/config/plugins/tours/core.history.yaml +++ b/config/plugins/tours/core.history.yaml @@ -28,11 +28,11 @@ steps: https://raw.githubusercontent.com/bgruening/galaxytools/adf077b912ddebd97b07b947b855cdd2862ed8ef/tools/statistics/test-data/anderson.tabular - title: "Start the upload" - element: "#btn-start" + element: "#regular #btn-start" intro: "Upload the data into your Galaxy History." postclick: - - "#btn-start" - - "#btn-close" + - "#regular #btn-start" + - "#regular #btn-close" - title: "History" element: "#current-history-panel" From d088fe764b9cca64780970d62a37e091954177db Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:52:31 +0100 Subject: [PATCH 6/8] Add buffer as a devDependency in phylocanvas package.json --- config/plugins/visualizations/phylocanvas/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config/plugins/visualizations/phylocanvas/package.json b/config/plugins/visualizations/phylocanvas/package.json index 24d6e23f0fb5..efee4654d8d6 100644 --- a/config/plugins/visualizations/phylocanvas/package.json +++ b/config/plugins/visualizations/phylocanvas/package.json @@ -15,6 +15,7 @@ "build": "parcel build src/script.js --dist-dir static" }, "devDependencies": { + "buffer": "^6.0.3", "parcel": "^2.12.0", "process": "^0.11.10" } From f559ced17d3019cc7915dfbba4ba4d72e80630c8 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 19 Nov 2024 16:54:13 +0100 Subject: [PATCH 7/8] Prefer auto-decompressed datatype when picking conversion target Fixes https://github.com/galaxyproject/galaxy/issues/18709 --- lib/galaxy/datatypes/registry.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/datatypes/registry.py b/lib/galaxy/datatypes/registry.py index 671f30d82e16..a717dad0098f 100644 --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -881,7 +881,16 @@ def find_conversion_destination_for_dataset_by_extensions( if datatype and datatype.matches_any(accepted_datatypes): return True, None, None - for convert_ext in self.get_converters_by_datatype(ext): + converter_extensions = self.get_converters_by_datatype(ext) + uncompressed_instance = getattr(datatype, "uncompressed_datatype_instance", None) + if uncompressed_instance and uncompressed_instance.file_ext in converter_extensions: + # sort uncompressed instance ahead of other possible conversions + converter_extensions = [ + uncompressed_instance.file_ext, + *(ext for ext in converter_extensions if ext != uncompressed_instance.file_ext), + ] + + for convert_ext in converter_extensions: convert_ext_datatype = self.get_datatype_by_extension(convert_ext) if convert_ext_datatype is None: self.log.warning( From 974d7e58bf56522175120c619e047cfd423374d2 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 19 Nov 2024 17:21:45 +0100 Subject: [PATCH 8/8] Tighten conversion target input This way we test that conversion to txt occurs via fasta, not the fasta to tabular converter. --- test/functional/tools/implicit_conversion_format_input.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/tools/implicit_conversion_format_input.xml b/test/functional/tools/implicit_conversion_format_input.xml index e93f54095592..090aa474f0fc 100644 --- a/test/functional/tools/implicit_conversion_format_input.xml +++ b/test/functional/tools/implicit_conversion_format_input.xml @@ -3,7 +3,7 @@ cut -f 1 '$input1' > '$output1' - +