From 6be9f23517a647a4590231ed9ab1d86d7739abe3 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 10 Jul 2024 13:50:11 +0200 Subject: [PATCH 1/6] Use action_tag instead of default --- lib/galaxy/web/framework/base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/web/framework/base.py b/lib/galaxy/web/framework/base.py index ec4536862332..79a36c57724f 100644 --- a/lib/galaxy/web/framework/base.py +++ b/lib/galaxy/web/framework/base.py @@ -251,8 +251,13 @@ def handle_request(self, request_id, path_info, environ, start_response, body_re raise trans.controller = controller_name trans.action = action + + # Action can still refer to invalid and/or inaccurate paths here, so we use the actual + # controller and method names to set the timing key. + + action_tag = getattr(method, "__name__", "default") environ["controller_action_key"] = ( - f"{'api' if environ['is_api_request'] else 'web'}.{controller_name}.{action or 'default'}" + f"{'api' if environ['is_api_request'] else 'web'}.{controller_name}.{action_tag}" ) # Combine mapper args and query string / form args and call kwargs = trans.request.params.mixed() From 46aa4c02019c25441d3788599d422daae43ba18b Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 19 Jul 2024 12:00:19 +0200 Subject: [PATCH 2/6] Raise appropriate exception if ldda not found Fixes https://sentry.galaxyproject.org/share/issue/db137d5e4eae40eea9b0fe85ffac4b19/: ``` AssertionError: null File "galaxy/web/framework/decorators.py", line 346, in decorator rval = func(self, trans, *args, **kwargs) File "galaxy/webapps/galaxy/api/tools.py", line 593, in create return self.service._create(trans, payload, **kwd) File "galaxy/webapps/galaxy/services/tools.py", line 155, in _create self._patch_library_inputs(trans, inputs, target_history) File "galaxy/webapps/galaxy/services/tools.py", line 276, in _patch_library_inputs patched = self._patch_library_dataset(trans, value, target_history) File "galaxy/webapps/galaxy/services/tools.py", line 284, in _patch_library_dataset assert ldda ``` --- lib/galaxy/webapps/galaxy/services/tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/services/tools.py b/lib/galaxy/webapps/galaxy/services/tools.py index 1af3f95aba6e..9e2298eae134 100644 --- a/lib/galaxy/webapps/galaxy/services/tools.py +++ b/lib/galaxy/webapps/galaxy/services/tools.py @@ -281,7 +281,8 @@ def _patch_library_inputs(self, trans: ProvidesHistoryContext, inputs, target_hi def _patch_library_dataset(self, trans: ProvidesHistoryContext, v, target_history): if isinstance(v, dict) and "id" in v and v.get("src") == "ldda": ldda = trans.sa_session.get(LibraryDatasetDatasetAssociation, self.decode_id(v["id"])) - assert ldda + if not ldda: + raise exceptions.ObjectNotFound("Could not find library dataset dataset association.") if trans.user_is_admin or trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), ldda.dataset ): From 314e20c0054f362fa2067a27d9dda3daea5cae12 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Fri, 19 Jul 2024 15:53:02 +0200 Subject: [PATCH 3/6] fix history changes switch to simple form --- .../components/Workflow/Run/WorkflowRun.vue | 93 +++++++++++-------- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/client/src/components/Workflow/Run/WorkflowRun.vue b/client/src/components/Workflow/Run/WorkflowRun.vue index fbf47ec93a9d..5f3a97e7dad0 100644 --- a/client/src/components/Workflow/Run/WorkflowRun.vue +++ b/client/src/components/Workflow/Run/WorkflowRun.vue @@ -77,46 +77,46 @@ function handleSubmissionError(error: string) { submissionError.value = errorMessageAsString(error); } -function loadRun() { - getRunData(props.workflowId, props.version || undefined) - .then((runData) => { - const incomingModel = new WorkflowRunModel(runData); - simpleForm.value = props.preferSimpleForm; - if (simpleForm.value) { - // These only work with PJA - the API doesn't evaluate them at - // all outside that context currently. The main workflow form renders - // these dynamically and takes care of all the validation and setup details - // on the frontend. If these are implemented on the backend at some - // point this restriction can be lifted. - if (incomingModel.hasReplacementParametersInToolForm) { - console.log("cannot render simple workflow form - has ${} values in tool steps"); - simpleForm.value = false; - } - // If there are required parameters in a tool form (a disconnected runtime - // input), we have to render the tool form steps and cannot use the - // simplified tool form. - if (incomingModel.hasOpenToolSteps) { - console.log( - "cannot render simple workflow form - one or more tools have disconnected runtime inputs" - ); - simpleForm.value = false; - } - // Just render the whole form for resource request parameters (kind of - // niche - I'm not sure anyone is using these currently anyway). - if (incomingModel.hasWorkflowResourceParameters) { - console.log(`Cannot render simple workflow form - workflow resource parameters are configured`); - simpleForm.value = false; - } +async function loadRun() { + try { + const runData = await getRunData(props.workflowId, props.version || undefined); + const incomingModel = new WorkflowRunModel(runData); + + simpleForm.value = props.preferSimpleForm; + + if (simpleForm.value) { + // These only work with PJA - the API doesn't evaluate them at + // all outside that context currently. The main workflow form renders + // these dynamically and takes care of all the validation and setup details + // on the frontend. If these are implemented on the backend at some + // point this restriction can be lifted. + if (incomingModel.hasReplacementParametersInToolForm) { + console.log("cannot render simple workflow form - has ${} values in tool steps"); + simpleForm.value = false; } - hasUpgradeMessages.value = incomingModel.hasUpgradeMessages; - hasStepVersionChanges.value = incomingModel.hasStepVersionChanges; - workflowName.value = incomingModel.name; - workflowModel.value = incomingModel; - loading.value = false; - }) - .catch((response) => { - workflowError.value = errorMessageAsString(response); - }); + // If there are required parameters in a tool form (a disconnected runtime + // input), we have to render the tool form steps and cannot use the + // simplified tool form. + if (incomingModel.hasOpenToolSteps) { + console.log("cannot render simple workflow form - one or more tools have disconnected runtime inputs"); + simpleForm.value = false; + } + // Just render the whole form for resource request parameters (kind of + // niche - I'm not sure anyone is using these currently anyway). + if (incomingModel.hasWorkflowResourceParameters) { + console.log(`Cannot render simple workflow form - workflow resource parameters are configured`); + simpleForm.value = false; + } + } + + hasUpgradeMessages.value = incomingModel.hasUpgradeMessages; + hasStepVersionChanges.value = incomingModel.hasStepVersionChanges; + workflowName.value = incomingModel.name; + workflowModel.value = incomingModel; + loading.value = false; + } catch (e) { + workflowError.value = errorMessageAsString(e); + } } async function onImport() { @@ -124,8 +124,19 @@ async function onImport() { router.push(`/workflows/edit?id=${response.id}`); } +const advancedForm = ref(false); +const fromVariant = computed<"simple" | "advanced">(() => { + if (advancedForm.value) { + return "advanced"; + } else if (simpleForm.value) { + return "simple"; + } else { + return "advanced"; + } +}); + function showAdvanced() { - simpleForm.value = false; + advancedForm.value = true; } onMounted(() => { @@ -185,7 +196,7 @@ defineExpose({ Workflow submission failed: {{ submissionError }} Date: Mon, 22 Jul 2024 18:07:01 +0200 Subject: [PATCH 4/6] Fix encoding issue in ZipstreamWrapper --- lib/galaxy/util/zipstream.py | 3 ++- lib/galaxy_test/api/test_dataset_collections.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/util/zipstream.py b/lib/galaxy/util/zipstream.py index 0b23796482be..1cd1c77649e7 100644 --- a/lib/galaxy/util/zipstream.py +++ b/lib/galaxy/util/zipstream.py @@ -41,7 +41,8 @@ def response(self) -> Iterator[bytes]: def get_headers(self) -> Dict[str, str]: headers = {} if self.archive_name: - headers["Content-Disposition"] = f'attachment; filename="{self.archive_name}.zip"' + archive_name = self.archive_name.encode("latin-1", "replace").decode("latin-1") + headers["Content-Disposition"] = f'attachment; filename="{archive_name}.zip"' if self.upstream_mod_zip: headers["X-Archive-Files"] = "zip" else: diff --git a/lib/galaxy_test/api/test_dataset_collections.py b/lib/galaxy_test/api/test_dataset_collections.py index 85b0652c0259..c9428ad84ffe 100644 --- a/lib/galaxy_test/api/test_dataset_collections.py +++ b/lib/galaxy_test/api/test_dataset_collections.py @@ -182,6 +182,14 @@ def test_list_list_list_download(self): namelist = archive.namelist() assert len(namelist) == 3, f"Expected 3 elements in [{namelist}]" + def test_download_non_english_characters(self): + with self.dataset_populator.test_history() as history_id: + name = "دیتاست" + payload = self.dataset_collection_populator.create_list_payload(history_id, name=name) + hdca_id = self.dataset_populator.fetch(payload, wait=True).json()["outputs"][0]["id"] + create_response = self._download_dataset_collection(history_id=history_id, hdca_id=hdca_id) + self._assert_status_code_is(create_response, 200) + @requires_new_user def test_hda_security(self): with self.dataset_populator.test_history(require_new=False) as history_id: From f745aa7906fc404c7eed9d2c486b99ef2724add9 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 24 Jul 2024 11:29:40 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=E2=9C=A8:=20add=20eye=20icon=20to=20reveal?= =?UTF-8?q?=20API=20key=20and=20remove=20mouse=20over=20in=20`APIKeyItem`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/User/APIKey/APIKeyItem.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/client/src/components/User/APIKey/APIKeyItem.vue b/client/src/components/User/APIKey/APIKeyItem.vue index dd398af9b979..0ad915b730d0 100644 --- a/client/src/components/User/APIKey/APIKeyItem.vue +++ b/client/src/components/User/APIKey/APIKeyItem.vue @@ -1,10 +1,15 @@