From e6d158f72c57ef2f27580fabd528a86e80681fb1 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:32:07 +0200 Subject: [PATCH 1/7] Fix incorrect request host in ASGI --- lib/galaxy/webapps/galaxy/api/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/__init__.py b/lib/galaxy/webapps/galaxy/api/__init__.py index c31b2175c090..b2dce8d7a876 100644 --- a/lib/galaxy/webapps/galaxy/api/__init__.py +++ b/lib/galaxy/webapps/galaxy/api/__init__.py @@ -183,9 +183,7 @@ def base(self) -> str: @property def host(self) -> str: - client = self.__request.client - assert client is not None - return str(client.host) + return self.__request.base_url.netloc class GalaxyASGIResponse(GalaxyAbstractResponse): From e412b5db8b3b42923508aa93a91525f16635de4b Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Fri, 25 Aug 2023 14:17:06 -0400 Subject: [PATCH 2/7] passing identifier for div to write the chart panel to --- config/plugins/visualizations/jqplot/jqplot_bar/src/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugins/visualizations/jqplot/jqplot_bar/src/script.js b/config/plugins/visualizations/jqplot/jqplot_bar/src/script.js index bec0b8b510a8..89063ee29a35 100644 --- a/config/plugins/visualizations/jqplot/jqplot_bar/src/script.js +++ b/config/plugins/visualizations/jqplot/jqplot_bar/src/script.js @@ -261,7 +261,7 @@ window.bundleEntries.jqplot_box = function (options) { chart : options.chart, dataset_id : dataset.id, dataset_groups : dataset_groups, - targets : options.targets, + target : options.target, makeConfig : function( groups, plot_config ){ var boundary = getDomains( groups, 'x' ); $.extend( true, plot_config, { From 56882f98af3478c109f94293ec0a9fe4309fabe6 Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Thu, 24 Aug 2023 19:35:35 -0400 Subject: [PATCH 3/7] changing type and default of history_id for legacy update and delete endpoints --- lib/galaxy/webapps/galaxy/api/history_contents.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/history_contents.py b/lib/galaxy/webapps/galaxy/api/history_contents.py index 6deec3f66493..2aafe380b79d 100644 --- a/lib/galaxy/webapps/galaxy/api/history_contents.py +++ b/lib/galaxy/webapps/galaxy/api/history_contents.py @@ -787,7 +787,7 @@ def validate( def update_typed( self, trans: ProvidesHistoryContext = DependsOnTrans, - history_id: DecodedDatabaseIdField = HistoryIDPathParam, + history_id: str = "", id: DecodedDatabaseIdField = HistoryItemIDPathParam, type: HistoryContentType = ContentTypePathParam, serialization_params: SerializationParams = Depends(query_serialization_params), @@ -824,7 +824,7 @@ def delete_typed( self, response: Response, trans: ProvidesHistoryContext = DependsOnTrans, - history_id: DecodedDatabaseIdField = HistoryIDPathParam, + history_id: str = "", id: DecodedDatabaseIdField = HistoryItemIDPathParam, type: HistoryContentType = ContentTypePathParam, serialization_params: SerializationParams = Depends(query_serialization_params), From a6327a528575795ceec581b8bd069f1d0b5c8c7d Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Thu, 24 Aug 2023 20:02:09 -0400 Subject: [PATCH 4/7] changeing put type and default back, since it is not the problem once visualization PR gets merged --- lib/galaxy/webapps/galaxy/api/history_contents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/api/history_contents.py b/lib/galaxy/webapps/galaxy/api/history_contents.py index 2aafe380b79d..798be47b0cd3 100644 --- a/lib/galaxy/webapps/galaxy/api/history_contents.py +++ b/lib/galaxy/webapps/galaxy/api/history_contents.py @@ -787,7 +787,7 @@ def validate( def update_typed( self, trans: ProvidesHistoryContext = DependsOnTrans, - history_id: str = "", + history_id: DecodedDatabaseIdField = HistoryIDPathParam, id: DecodedDatabaseIdField = HistoryItemIDPathParam, type: HistoryContentType = ContentTypePathParam, serialization_params: SerializationParams = Depends(query_serialization_params), From 7bdae4d68c39c11cf13b501c12beee8a18a2e6ec Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Fri, 25 Aug 2023 10:56:43 -0400 Subject: [PATCH 5/7] Annotate the history_id paramter --- client/src/schema/schema.ts | 2 +- lib/galaxy/webapps/galaxy/api/history_contents.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/schema/schema.ts b/client/src/schema/schema.ts index 1f9989c5deee..a2e73ca439cf 100644 --- a/client/src/schema/schema.ts +++ b/client/src/schema/schema.ts @@ -10621,7 +10621,7 @@ export interface operations { header?: { "run-as"?: string; }; - /** @description The ID of the History. */ + /** @description History ID or any string. */ /** @description The ID of the item (`HDA`/`HDCA`) contained in the history. */ path: { history_id: string; diff --git a/lib/galaxy/webapps/galaxy/api/history_contents.py b/lib/galaxy/webapps/galaxy/api/history_contents.py index 798be47b0cd3..22ef957997fe 100644 --- a/lib/galaxy/webapps/galaxy/api/history_contents.py +++ b/lib/galaxy/webapps/galaxy/api/history_contents.py @@ -824,7 +824,7 @@ def delete_typed( self, response: Response, trans: ProvidesHistoryContext = DependsOnTrans, - history_id: str = "", + history_id: str = Path(..., description="History ID or any string."), id: DecodedDatabaseIdField = HistoryItemIDPathParam, type: HistoryContentType = ContentTypePathParam, serialization_params: SerializationParams = Depends(query_serialization_params), From 2dc9f01378111d520d19020741211138f5c4c228 Mon Sep 17 00:00:00 2001 From: Assunta DeSanto Date: Mon, 28 Aug 2023 14:56:37 -0400 Subject: [PATCH 6/7] running openapi schema update --- client/src/schema/schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/schema/schema.ts b/client/src/schema/schema.ts index a2e73ca439cf..a508b702b9f0 100644 --- a/client/src/schema/schema.ts +++ b/client/src/schema/schema.ts @@ -10621,7 +10621,7 @@ export interface operations { header?: { "run-as"?: string; }; - /** @description History ID or any string. */ + /** @description The ID of the History. */ /** @description The ID of the item (`HDA`/`HDCA`) contained in the history. */ path: { history_id: string; @@ -10979,7 +10979,7 @@ export interface operations { header?: { "run-as"?: string; }; - /** @description The ID of the History. */ + /** @description History ID or any string. */ /** @description The ID of the item (`HDA`/`HDCA`) contained in the history. */ /** * @description The type of the target history element. From 099e7e5752fe81091841f500890847d33d1388fe Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 31 Aug 2023 11:07:47 +0200 Subject: [PATCH 7/7] Don't fail invocation message without dependent_workflow_step_id We don't always have a dependent workflow step id for certain errors, this is fine. Fixes https://github.com/galaxyproject/galaxy/issues/16626#issuecomment-1700638448: ``` AttributeError: 'NoneType' object has no attribute 'order_index' File "galaxy/web/framework/decorators.py", line 337, in decorator rval = func(self, trans, *args, **kwargs) File "galaxy/webapps/galaxy/api/workflows.py", line 827, in index_invocations invocations, total_matches = self.invocations_service.index(trans, invocation_payload, serialization_params) File "galaxy/webapps/galaxy/services/invocations.py", line 146, in index invocation_dict = self.serialize_workflow_invocations(invocations, serialization_params) File "galaxy/webapps/galaxy/services/invocations.py", line 215, in serialize_workflow_invocations return list( File "galaxy/webapps/galaxy/services/invocations.py", line 216, in map(lambda i: self.serialize_workflow_invocation(i, params, default_view=default_view), invocations) File "galaxy/webapps/galaxy/services/invocations.py", line 204, in serialize_workflow_invocation as_dict["messages"] = [ File "galaxy/webapps/galaxy/services/invocations.py", line 205, in InvocationMessageResponseModel.parse_obj(message).__root__.dict() for message in invocation.messages File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__ File "pydantic/main.py", line 1076, in pydantic.main.validate_model File "pydantic/fields.py", line 884, in pydantic.fields.ModelField.validate File "pydantic/fields.py", line 1061, in pydantic.fields.ModelField._validate_singleton File "pydantic/fields.py", line 1150, in pydantic.fields.ModelField._validate_discriminated_union File "pydantic/fields.py", line 884, in pydantic.fields.ModelField.validate File "pydantic/fields.py", line 1101, in pydantic.fields.ModelField._validate_singleton File "pydantic/fields.py", line 1157, in pydantic.fields.ModelField._apply_validators File "pydantic/class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13 File "pydantic/main.py", line 713, in pydantic.main.BaseModel.validate File "pydantic/main.py", line 577, in pydantic.main.BaseModel.from_orm File "pydantic/main.py", line 1055, in pydantic.main.validate_model File "galaxy/schema/invocation.py", line 56, in get return self._obj.dependent_workflow_step.order_index ``` from https://sentry.galaxyproject.org/share/issue/021a1833a4744783a9922ed37b0278c2/ --- lib/galaxy/schema/invocation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/schema/invocation.py b/lib/galaxy/schema/invocation.py index b1a6c132662c..8b66724ca1d9 100644 --- a/lib/galaxy/schema/invocation.py +++ b/lib/galaxy/schema/invocation.py @@ -53,7 +53,10 @@ def get(self, key: Any, default: Any = None) -> Any: if key == "workflow_step_id": return self._obj.workflow_step.order_index elif key == "dependent_workflow_step_id": - return self._obj.dependent_workflow_step.order_index + if self._obj.dependent_workflow_step_id: + return self._obj.dependent_workflow_step.order_index + else: + return default return super().get(key, default)