From a9f13520abea708d62a2211dd7aa8a539d929255 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 26 Feb 2024 19:31:00 +0100 Subject: [PATCH 01/73] Add set_workflow_menu method to service layer of the Workflows API --- lib/galaxy/webapps/galaxy/api/workflows.py | 62 ++++++++-------------- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 05a475d430e6..ad2513bb25c4 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -78,6 +78,8 @@ ) from galaxy.schema.workflows import ( InvokeWorkflowPayload, + SetWorkflowMenuPayload, + SetWorkflowMenuSummary, StoredWorkflowDetailed, ) from galaxy.structured_app import StructuredApp @@ -145,46 +147,6 @@ def __init__(self, app: StructuredApp): self.workflow_contents_manager = app.workflow_contents_manager self.tool_recommendations = recommendations.ToolRecommendations() - @expose_api - def set_workflow_menu(self, trans: GalaxyWebTransaction, payload=None, **kwd): - """ - Save workflow menu to be shown in the tool panel - PUT /api/workflows/menu - """ - payload = payload or {} - user = trans.user - workflow_ids = payload.get("workflow_ids") - if workflow_ids is None: - workflow_ids = [] - elif not isinstance(workflow_ids, list): - workflow_ids = [workflow_ids] - workflow_ids_decoded = [] - # Decode the encoded workflow ids - for ids in workflow_ids: - workflow_ids_decoded.append(trans.security.decode_id(ids)) - session = trans.sa_session - # This explicit remove seems like a hack, need to figure out - # how to make the association do it automatically. - for m in user.stored_workflow_menu_entries: - session.delete(m) - user.stored_workflow_menu_entries = [] - # To ensure id list is unique - seen_workflow_ids = set() - for wf_id in workflow_ids_decoded: - if wf_id in seen_workflow_ids: - continue - else: - seen_workflow_ids.add(wf_id) - m = model.StoredWorkflowMenuEntry() - m.stored_workflow = session.get(model.StoredWorkflow, wf_id) - - user.stored_workflow_menu_entries.append(m) - with transaction(session): - session.commit() - message = "Menu updated." - trans.set_message(message) - return {"message": message, "status": "done"} - @expose_api def create(self, trans: GalaxyWebTransaction, payload=None, **kwd): """ @@ -905,6 +867,15 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): ), ] +SetWorkflowMenuBody = Annotated[ + Optional[SetWorkflowMenuPayload], + Body( + default=None, + title="Set workflow menu", + description="The values to set a workflow menu.", + ), +] + @router.cbv class FastAPIWorkflows: @@ -1022,6 +993,17 @@ def unpublish( """Removes this item from the published list and return the current sharing status.""" return self.service.shareable_service.unpublish(trans, workflow_id) + @router.put( + "/api/workflows/menu", + summary="Save workflow menu to be shown in the tool panel", + ) + def set_workflow_menu( + self, + payload: SetWorkflowMenuBody, + trans: ProvidesHistoryContext = DependsOnTrans, + ) -> SetWorkflowMenuSummary: + return self.service.set_workflow_menu(payload, trans) + @router.put( "/api/workflows/{workflow_id}/share_with_users", summary="Share this item with specific users.", From 69d083956ef49012997a80c767e200d932dd11f4 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 26 Feb 2024 19:31:37 +0100 Subject: [PATCH 02/73] Create pydantic models for the set_workflow_menu operation of the WorkflowsAPI --- lib/galaxy/schema/workflows.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 4e80dcb7c55e..66ee370c466c 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -13,6 +13,7 @@ ) from typing_extensions import Annotated +from galaxy.schema.fields import DecodedDatabaseIdField from galaxy.schema.schema import ( AnnotationField, InputDataCollectionStep, @@ -231,3 +232,24 @@ class StoredWorkflowDetailed(StoredWorkflowSummary): title="Source Metadata", description="The source metadata of the workflow.", ) + + +class SetWorkflowMenuPayload(Model): + workflow_ids: Union[List[DecodedDatabaseIdField], DecodedDatabaseIdField] = Field( + ..., + title="Workflow IDs", + description="The list of workflow IDs to set the menu entry for.", + ) + + +class SetWorkflowMenuSummary(Model): + message: Optional[Any] = Field( + ..., + title="Message", + description="The message of the operation.", + ) + status: str = Field( + ..., + title="Status", + description="The status of the operation.", + ) From bcf07e44407b1b956be6591cb6791c8d6ec71d28 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 26 Feb 2024 19:32:29 +0100 Subject: [PATCH 03/73] Refactor set_workflow_menu operation to FastAPI --- .../webapps/galaxy/services/workflows.py | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index 72414b169abf..72dd77e2b4be 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -10,9 +10,13 @@ from galaxy import ( exceptions, + model, web, ) -from galaxy.managers.context import ProvidesUserContext +from galaxy.managers.context import ( + ProvidesHistoryContext, + ProvidesUserContext, +) from galaxy.managers.workflows import ( RefactorResponse, WorkflowContentsManager, @@ -28,6 +32,8 @@ ) from galaxy.schema.workflows import ( InvokeWorkflowPayload, + SetWorkflowMenuPayload, + SetWorkflowMenuSummary, StoredWorkflowDetailed, ) from galaxy.util.tool_shed.tool_shed_registry import Registry @@ -221,6 +227,41 @@ def refactor( stored_workflow = self._workflows_manager.get_stored_workflow(trans, workflow_id, by_stored_id=not instance) return self._workflow_contents_manager.refactor(trans, stored_workflow, payload) + def set_workflow_menu( + self, + payload: Union[SetWorkflowMenuPayload, None], + trans: ProvidesHistoryContext, + ) -> SetWorkflowMenuSummary: + user = trans.user + if payload: + workflow_ids = payload.workflow_ids + if not isinstance(workflow_ids, list): + workflow_ids = [workflow_ids] + else: + workflow_ids = [] + session = trans.sa_session + # This explicit remove seems like a hack, need to figure out + # how to make the association do it automatically. + for m in user.stored_workflow_menu_entries: + session.delete(m) + user.stored_workflow_menu_entries = [] + # To ensure id list is unique + seen_workflow_ids = set() + for wf_id in workflow_ids: + if wf_id in seen_workflow_ids: + continue + else: + seen_workflow_ids.add(wf_id) + m = model.StoredWorkflowMenuEntry() + m.stored_workflow = session.get(model.StoredWorkflow, wf_id) + + user.stored_workflow_menu_entries.append(m) + with transaction(session): + session.commit() + message = "Menu updated." + trans.set_message(message) + return SetWorkflowMenuSummary(message=message, status="done") + def show_workflow(self, trans, workflow_id, instance, legacy, version) -> StoredWorkflowDetailed: stored_workflow = self._workflows_manager.get_stored_workflow(trans, workflow_id, by_stored_id=not instance) if stored_workflow.importable is False and stored_workflow.user != trans.user and not trans.user_is_admin: From 5e27757fce03afaf3c99fe143473412a3b89288f Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 26 Feb 2024 19:32:48 +0100 Subject: [PATCH 04/73] Remove the mapping to the legacy route --- lib/galaxy/webapps/galaxy/buildapp.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index 951926dcc35b..a04847ddcaea 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -591,9 +591,6 @@ def populate_api_routes(webapp, app): webapp.mapper.resource("plugins", "plugins", path_prefix="/api") webapp.mapper.connect("/api/workflows/build_module", action="build_module", controller="workflows") - webapp.mapper.connect( - "/api/workflows/menu", action="set_workflow_menu", controller="workflows", conditions=dict(method=["PUT"]) - ) webapp.mapper.resource("workflow", "workflows", path_prefix="/api") # ---- visualizations registry ---- generic template renderer From 1fc7e39b414db24bf4c7faccfdf1c21bcfbcdca3 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Tue, 27 Feb 2024 17:34:06 +0100 Subject: [PATCH 05/73] Add TODO --- lib/galaxy/webapps/galaxy/services/workflows.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index 72dd77e2b4be..e1ea3cdf68d4 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -229,7 +229,7 @@ def refactor( def set_workflow_menu( self, - payload: Union[SetWorkflowMenuPayload, None], + payload: Optional[SetWorkflowMenuPayload], trans: ProvidesHistoryContext, ) -> SetWorkflowMenuSummary: user = trans.user @@ -259,7 +259,8 @@ def set_workflow_menu( with transaction(session): session.commit() message = "Menu updated." - trans.set_message(message) + # TODO - It seems like this populates a mako template, is it necessary? + # trans.set_message(message) return SetWorkflowMenuSummary(message=message, status="done") def show_workflow(self, trans, workflow_id, instance, legacy, version) -> StoredWorkflowDetailed: From 18ea3efabbc2a0a8972487ca9a97d37f5aa2b484 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Tue, 27 Feb 2024 17:35:19 +0100 Subject: [PATCH 06/73] Type payload of set_workflow_menu operation properly --- lib/galaxy/webapps/galaxy/api/workflows.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index ad2513bb25c4..42b9396cff58 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -870,7 +870,6 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): SetWorkflowMenuBody = Annotated[ Optional[SetWorkflowMenuPayload], Body( - default=None, title="Set workflow menu", description="The values to set a workflow menu.", ), @@ -999,7 +998,7 @@ def unpublish( ) def set_workflow_menu( self, - payload: SetWorkflowMenuBody, + payload: SetWorkflowMenuBody = None, trans: ProvidesHistoryContext = DependsOnTrans, ) -> SetWorkflowMenuSummary: return self.service.set_workflow_menu(payload, trans) From 8bf1a2f9f5688c1fc22fbe1663aa4a230d7b64e4 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Tue, 27 Feb 2024 18:25:05 +0100 Subject: [PATCH 07/73] Mark HistoryId query param as invocation specific --- lib/galaxy/webapps/galaxy/api/workflows.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 42b9396cff58..c0815055f9bb 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -1171,7 +1171,7 @@ def show_workflow( ), ] -HistoryIdQueryParam = Annotated[ +InvocationsHistoryIdQueryParam = Annotated[ Optional[DecodedDatabaseIdField], Query( title="History ID", @@ -1280,7 +1280,7 @@ def index_invocations( self, response: Response, workflow_id: WorkflowIdQueryParam = None, - history_id: HistoryIdQueryParam = None, + history_id: InvocationsHistoryIdQueryParam = None, job_id: JobIdQueryParam = None, user_id: UserIdQueryParam = None, sort_by: InvocationsSortByQueryParam = None, @@ -1334,7 +1334,7 @@ def index_workflow_invocations( self, response: Response, workflow_id: StoredWorkflowIDPathParam, - history_id: HistoryIdQueryParam = None, + history_id: InvocationsHistoryIdQueryParam = None, job_id: JobIdQueryParam = None, user_id: UserIdQueryParam = None, sort_by: InvocationsSortByQueryParam = None, From 92d29c3c598f19053d59f6807429327a5a674106 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 28 Feb 2024 09:21:29 +0100 Subject: [PATCH 08/73] Refactor workflow_dict operation to FastAPI --- lib/galaxy/webapps/galaxy/api/workflows.py | 98 +++++++++++----------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index c0815055f9bb..374bc7b1e0ac 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -21,7 +21,10 @@ Response, status, ) +<<<<<<< HEAD from gxformat2.yaml import ordered_dump +======= +>>>>>>> Refactor workflow_dict operation to FastAPI from pydantic import ( UUID1, UUID4, @@ -285,56 +288,6 @@ def create(self, trans: GalaxyWebTransaction, payload=None, **kwd): # This was already raised above, but just in case... raise exceptions.RequestParameterMissingException("No method for workflow creation supplied.") - @expose_api_raw_anonymous_and_sessionless - def workflow_dict(self, trans: GalaxyWebTransaction, workflow_id, **kwd): - """ - GET /api/workflows/{encoded_workflow_id}/download - - Returns a selected workflow. - - :type style: str - :param style: Style of export. The default is 'export', which is the meant to be used - with workflow import endpoints. Other formats such as 'instance', 'editor', - 'run' are more tied to the GUI and should not be considered stable APIs. - The default format for 'export' is specified by the - admin with the `default_workflow_export_format` config - option. Style can be specified as either 'ga' or 'format2' directly - to be explicit about which format to download. - - :param instance: true if fetch by Workflow ID instead of StoredWorkflow id, false - by default. - :type instance: boolean - """ - stored_workflow = self.__get_stored_accessible_workflow(trans, workflow_id, **kwd) - - style = kwd.get("style", "export") - download_format = kwd.get("format") - version = kwd.get("version") - history = None - if history_id := kwd.get("history_id"): - history = self.history_manager.get_accessible( - self.decode_id(history_id), trans.user, current_history=trans.history - ) - ret_dict = self.workflow_contents_manager.workflow_to_dict( - trans, stored_workflow, style=style, version=version, history=history - ) - if download_format == "json-download": - sname = stored_workflow.name - sname = "".join(c in util.FILENAME_VALID_CHARS and c or "_" for c in sname)[0:150] - if ret_dict.get("format-version", None) == "0.1": - extension = "ga" - else: - extension = "gxwf.json" - trans.response.headers["Content-Disposition"] = ( - f'attachment; filename="Galaxy-Workflow-{sname}.{extension}"' - ) - trans.response.set_content_type("application/galaxy-archive") - - if style == "format2" and download_format != "json-download": - return ordered_dump(ret_dict) - else: - return format_return_as_json(ret_dict, pretty=True) - @expose_api def import_new_workflow_deprecated(self, trans: GalaxyWebTransaction, payload, **kwd): """ @@ -849,6 +802,30 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): description="Set this to true to skip joining workflow step counts and optimize the resulting index query. Response objects will not contain step counts.", ) +StyleQueryParam = Annotated[ + Optional[str], + Query( + title="Style of export", + description="The default is 'export', which is the meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are more tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download.", + ), +] + +FormatQueryParam = Annotated[ + Optional[str], + Query( + title="Format", + description="The format to download the workflow in.", + ), +] + +WorkflowsHistoryIDQueryParam = Annotated[ + Optional[DecodedDatabaseIdField], + Query( + title="History ID", + description="The history id to import a workflow from.", + ), +] + InvokeWorkflowBody = Annotated[ InvokeWorkflowPayload, Body( @@ -931,6 +908,27 @@ def sharing( """Return the sharing status of the item.""" return self.service.shareable_service.sharing(trans, workflow_id) + @router.get( + "/api/workflows/{workflow_id}/download", + summary="Returns a selected workflow.", + ) + # Preserve the following download route for now for dependent applications -- deprecate at some point + @router.get( + "/api/workflows/download/{workflow_id}", + summary="Returns a selected workflow.", + ) + def workflow_dict( + self, + workflow_id: StoredWorkflowIDPathParam, + history_id: WorkflowsHistoryIDQueryParam = None, + style: StyleQueryParam = "export", + format: FormatQueryParam = None, + version: VersionQueryParam = None, + instance: InstanceQueryParam = False, + trans: ProvidesUserContext = DependsOnTrans, + ): + return self.service.download_workflow(trans, workflow_id, history_id, style, format, version, instance) + @router.put( "/api/workflows/{workflow_id}/enable_link_access", summary="Makes this item accessible by a URL link.", From 7ace91f521f5af4d102a8540c2413410f5def8b7 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 28 Feb 2024 09:21:49 +0100 Subject: [PATCH 09/73] Create service method for workflow_dict operation --- .../webapps/galaxy/services/workflows.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index e1ea3cdf68d4..cb4bf7fdf211 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -8,15 +8,19 @@ Union, ) +from gxformat2._yaml import ordered_dump + from galaxy import ( exceptions, model, + util, web, ) from galaxy.managers.context import ( ProvidesHistoryContext, ProvidesUserContext, ) +from galaxy.managers.histories import HistoryManager from galaxy.managers.workflows import ( RefactorResponse, WorkflowContentsManager, @@ -37,6 +41,7 @@ StoredWorkflowDetailed, ) from galaxy.util.tool_shed.tool_shed_registry import Registry +from galaxy.web import format_return_as_json from galaxy.webapps.galaxy.services.base import ServiceBase from galaxy.webapps.galaxy.services.notifications import NotificationService from galaxy.webapps.galaxy.services.sharable import ShareableService @@ -58,12 +63,39 @@ def __init__( serializer: WorkflowSerializer, tool_shed_registry: Registry, notification_service: NotificationService, + history_manager: HistoryManager, ): self._workflows_manager = workflows_manager self._workflow_contents_manager = workflow_contents_manager self._serializer = serializer self.shareable_service = ShareableService(workflows_manager, serializer, notification_service) self._tool_shed_registry = tool_shed_registry + self._history_manager = history_manager + + def download_workflow(self, trans, workflow_id, history_id, style, format, version, instance): + stored_workflow = self._workflows_manager.get_stored_workflow(trans, workflow_id, by_stored_id=not instance) + history = None + if history_id: + history = self._history_manager.get_accessible(history_id, trans.user, current_history=trans.history) + ret_dict = self._workflow_contents_manager.workflow_to_dict( + trans, stored_workflow, style=style, version=version, history=history + ) + if format == "json-download": + sname = stored_workflow.name + sname = "".join(c in util.FILENAME_VALID_CHARS and c or "_" for c in sname)[0:150] + if ret_dict.get("format-version", None) == "0.1": + extension = "ga" + else: + extension = "gxwf.json" + trans.response.headers["Content-Disposition"] = ( + f'attachment; filename="Galaxy-Workflow-{sname}.{extension}"' + ) + trans.response.set_content_type("application/galaxy-archive") + + if style == "format2" and format != "json-download": + return ordered_dump(ret_dict) + else: + return ret_dict def index( self, From 5ffd8ae73d4b5866bcfd8108ba73edda54868f70 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 28 Feb 2024 09:22:04 +0100 Subject: [PATCH 10/73] Remove mapping to legacy routes --- lib/galaxy/webapps/galaxy/buildapp.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index a04847ddcaea..8a700636c839 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -621,21 +621,6 @@ def populate_api_routes(webapp, app): action="import_new_workflow_deprecated", conditions=dict(method=["POST"]), ) - webapp.mapper.connect( - "workflow_dict", - "/api/workflows/{workflow_id}/download", - controller="workflows", - action="workflow_dict", - conditions=dict(method=["GET"]), - ) - # Preserve the following download route for now for dependent applications -- deprecate at some point - webapp.mapper.connect( - "workflow_dict", - "/api/workflows/download/{workflow_id}", - controller="workflows", - action="workflow_dict", - conditions=dict(method=["GET"]), - ) # Deprecated in favor of POST /api/workflows with shared_workflow_id in payload. webapp.mapper.connect( "import_shared_workflow_deprecated", From bbccfe78b6272ed4db6b9e29f8ab8fbc99d66b77 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 28 Feb 2024 09:23:12 +0100 Subject: [PATCH 11/73] Regenerate the client schema --- client/src/api/schema/schema.ts | 84 +++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index a2aa6e3d6c75..9ae31a97516a 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -4900,6 +4900,10 @@ export interface paths { patch?: never; trace?: never; }; + "/api/workflows/download/{workflow_id}": { + /** Returns a selected workflow. */ + get: operations["workflow_dict_api_workflows_download__workflow_id__get"]; + }; "/api/workflows/menu": { parameters: { query?: never; @@ -4972,6 +4976,10 @@ export interface paths { patch?: never; trace?: never; }; + "/api/workflows/{workflow_id}/download": { + /** Returns a selected workflow. */ + get: operations["workflow_dict_api_workflows__workflow_id__download_get"]; + }; "/api/workflows/{workflow_id}/enable_link_access": { parameters: { query?: never; @@ -33195,6 +33203,44 @@ export interface operations { }; }; }; + workflow_dict_api_workflows_download__workflow_id__get: { + /** Returns a selected workflow. */ + parameters: { + /** @description The history id to import a workflow from. */ + /** @description The default is 'export', which is the meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are more tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download. */ + /** @description The format to download the workflow in. */ + /** @description The version of the workflow to fetch. */ + query?: { + history_id?: string | null; + style?: string | null; + format?: string | null; + version?: number | null; + instance?: boolean | null; + }; + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + header?: { + "run-as"?: string | null; + }; + /** @description The encoded database identifier of the Stored Workflow. */ + path: { + workflow_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": Record; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; get_workflow_menu_api_workflows_menu_get: { parameters: { query?: { @@ -33430,6 +33476,44 @@ export interface operations { }; }; }; + workflow_dict_api_workflows__workflow_id__download_get: { + /** Returns a selected workflow. */ + parameters: { + /** @description The history id to import a workflow from. */ + /** @description The default is 'export', which is the meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are more tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download. */ + /** @description The format to download the workflow in. */ + /** @description The version of the workflow to fetch. */ + query?: { + history_id?: string | null; + style?: string | null; + format?: string | null; + version?: number | null; + instance?: boolean | null; + }; + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + header?: { + "run-as"?: string | null; + }; + /** @description The encoded database identifier of the Stored Workflow. */ + path: { + workflow_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": Record; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; enable_link_access_api_workflows__workflow_id__enable_link_access_put: { parameters: { query?: never; From 9c60fd7b16606634860cd015a4f2fa1ecaa3a95b Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 29 Feb 2024 14:58:29 +0100 Subject: [PATCH 12/73] Remove unused internal method in legacy WorkflowsAPIController --- lib/galaxy/webapps/galaxy/api/workflows.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 374bc7b1e0ac..ba9092531b98 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -652,10 +652,6 @@ def _import_tools_if_needed(self, trans, workflow_create_options, raw_workflow_d changeset_revision = item["changeset_revision"] irm.install(tool_shed_url, name, owner, changeset_revision, install_options) - def __get_stored_accessible_workflow(self, trans, workflow_id, **kwd): - instance = util.string_as_bool(kwd.get("instance", "false")) - return self.workflow_manager.get_stored_accessible_workflow(trans, workflow_id, by_stored_id=not instance) - def __get_stored_workflow(self, trans, workflow_id, **kwd): instance = util.string_as_bool(kwd.get("instance", "false")) return self.workflow_manager.get_stored_workflow(trans, workflow_id, by_stored_id=not instance) From 9d811b02caec543c291570df8da1227fe33986a3 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 29 Feb 2024 14:59:10 +0100 Subject: [PATCH 13/73] Use the correct get_workflow method from WorkflowsManager --- lib/galaxy/webapps/galaxy/services/workflows.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index cb4bf7fdf211..9beb42dff665 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -8,6 +8,7 @@ Union, ) +from fastapi.responses import PlainTextResponse from gxformat2._yaml import ordered_dump from galaxy import ( @@ -73,7 +74,9 @@ def __init__( self._history_manager = history_manager def download_workflow(self, trans, workflow_id, history_id, style, format, version, instance): - stored_workflow = self._workflows_manager.get_stored_workflow(trans, workflow_id, by_stored_id=not instance) + stored_workflow = self._workflows_manager.get_stored_accessible_workflow( + trans, workflow_id, by_stored_id=not instance + ) history = None if history_id: history = self._history_manager.get_accessible(history_id, trans.user, current_history=trans.history) From 75c0f7b4fbc78b9f2a938ba6afcf9278e6387875 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 29 Feb 2024 18:09:39 +0100 Subject: [PATCH 14/73] Type yaml return of download_workflow method --- lib/galaxy/webapps/galaxy/services/workflows.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index 9beb42dff665..32640af47cca 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -42,7 +42,6 @@ StoredWorkflowDetailed, ) from galaxy.util.tool_shed.tool_shed_registry import Registry -from galaxy.web import format_return_as_json from galaxy.webapps.galaxy.services.base import ServiceBase from galaxy.webapps.galaxy.services.notifications import NotificationService from galaxy.webapps.galaxy.services.sharable import ShareableService @@ -96,7 +95,7 @@ def download_workflow(self, trans, workflow_id, history_id, style, format, versi trans.response.set_content_type("application/galaxy-archive") if style == "format2" and format != "json-download": - return ordered_dump(ret_dict) + return PlainTextResponse(ordered_dump(ret_dict)) else: return ret_dict From a8ec75968e60a91fa29915cda159c21a14f06905 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Sun, 3 Mar 2024 17:26:18 +0100 Subject: [PATCH 15/73] Add pydantic models for return of workflow_dict operation --- lib/galaxy/schema/workflows.py | 326 +++++++++++++++++++++++++++++++++ 1 file changed, 326 insertions(+) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 66ee370c466c..10012aba3988 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -28,8 +28,17 @@ SubworkflowStep, ToolStep, WorkflowInput, + WorkflowModuleType, ) +WorkflowAnnotationField = Annotated[ + Optional[str], + Field( + title="Annotation", + description="An annotation to provide details or to help understand the purpose and usage of this item.", + ), +] + class GetTargetHistoryPayload(Model): # TODO - Are the descriptions correct? @@ -253,3 +262,320 @@ class SetWorkflowMenuSummary(Model): title="Status", description="The status of the operation.", ) + + +class WorkflowDictPreviewSteps(Model): + order_index: int = Field( + ..., + title="Order Index", + description="The order index of the step.", + ) + type: WorkflowModuleType = Field( + ..., + title="Type", + description="The type of workflow module.", + ) + annotation: WorkflowAnnotationField = None + label: str = Field( + ..., + title="Label", + description="The label of the step.", + ) + tool_id: Optional[str] = Field( + None, title="Tool ID", description="The unique name of the tool associated with this step." + ) + tool_version: Optional[str] = Field( + None, title="Tool Version", description="The version of the tool associated with this step." + ) + inputs: List[Dict[str, Any]] = Field( + ..., + title="Inputs", + description="The inputs of the step.", + ) + errors: Optional[List[str]] = Field( + None, + title="Errors", + description="Any errors associated with the subworkflow.", + ) + + +class WorkflowDictEditorSteps(Model): + id: int = Field( + ..., + title="ID", + description="The order index of the step.", + ) + type: WorkflowModuleType = Field( + ..., + title="Type", + description="The type of workflow module.", + ) + label: str = Field( + ..., + title="Label", + description="The label of the step.", + ) + content_id: Optional[str] = Field( + None, + title="Content ID", + description="The identifier for the content of the step.", + ) + name: Optional[str] = Field( + None, + title="Name", + description="The name of the step.", + ) + tool_state: Optional[Dict[str, Any]] = Field( + None, + title="Tool State", + description="The state of the step's tool.", + ) + errors: Optional[List[str]] = Field( + None, + title="Errors", + description="Any errors associated with the step.", + ) + inputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Inputs", + description="The inputs of the step.", + ) + outputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Outputs", + description="The outputs of the step.", + ) + config_form: Optional[Dict[str, Any]] = Field( + None, + title="Config Form", + description="The configuration form for the step.", + ) + annotation: WorkflowAnnotationField + post_job_actions: Optional[Dict[str, Any]] = Field( + None, + title="Post Job Actions", + description="A dictionary of post-job actions for the step.", + ) + uuid: Optional[str] = Field( + None, + title="UUID", + description="The UUID of the step.", + ) + when: Optional[str] = Field( + None, + title="When", + description="The when expression for the step.", + ) + workflow_outputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Workflow Outputs", + description="A list of workflow outputs for the step.", + ) + tooltip: Optional[str] = Field( + None, + title="Tooltip", + description="The tooltip for the step.", + ) + input_connections: Optional[Dict[str, Any]] = Field( + None, + title="Input Connections", + description="A dictionary representing the input connections for the step.", + ) + position: Optional[Dict[str, Any]] = Field( + None, + title="Position", + description="The position of the step.", + ) + tool_version: Optional[str] = Field( + None, + title="Tool Version", + description="The version of the step's tool.", + ) + + +# TODO - This is missing some fields - see manager line 1006 +class WorkflowDictRunSteps(Model): + inputs: List[Dict[str, Any]] = Field( + ..., + title="Inputs", + description="The inputs of the step.", + ) + when: Optional[str] = Field( + None, + title="When", + description="The when expression for the step.", + ) + replacement_parameters: Optional[List[Dict[str, Any]]] = Field( + None, + title="Replacement Parameters", + description="Informal replacement parameters for the step.", + ) + step_type: WorkflowModuleType = Field( + ..., + title="Step Type", + description="The type of the step.", + ) + step_label: str = Field( + ..., + title="Step Label", + description="The label of the step.", + ) + step_name: str = Field( + ..., + title="Step Name", + description="The name of the step's module.", + ) + step_version: Optional[str] = Field( + None, + title="Step Version", + description="The version of the step's module.", + ) + step_index: int = Field( + ..., + title="Step Index", + description="The order index of the step.", + ) + output_connections: List[Dict[str, Any]] = Field( + ..., + title="Output Connections", + description="A list of dictionaries representing the output connections of the step.", + ) + annotation: WorkflowAnnotationField = None + messages: Optional[List[str]] = Field( + None, + title="Messages", + description="Upgrade messages for the step.", + ) + # TODO - can further specify post_job_actions - look at code in manager + post_job_actions: Optional[List[Dict[str, Any]]] = Field( + None, + title="Post Job Actions", + description="A list of dictionaries representing the post-job actions for the step.", + ) + + +class WorkflowDictBaseModel(Model): + name: str = Field( + ..., + title="Name", + description="The name of the workflow.", + ) + version: int = Field( + ..., + title="Version", + description="The version of the workflow.", + ) + + +class WorkflowDictPreviewSummary(WorkflowDictBaseModel): + steps: List[WorkflowDictPreviewSteps] = Field( + ..., + title="Steps", + description="A dictionary with information about all the steps of the workflow.", + ) + + +class WorkflowDictEditorSummary(WorkflowDictBaseModel): + upgrade_messages: Dict[int, str] = Field( + ..., + title="Upgrade Messages", + description="Upgrade messages for each step in the workflow.", + ) + report: Dict[str, Any] = Field( + ..., + title="Report", + description="The reports configuration for the workflow.", + ) + comments: List[Dict[str, Any]] = Field( + ..., + title="Comments", + description="Comments on the workflow.", + ) + annotation: WorkflowAnnotationField + license: Optional[str] = Field( + None, + title="License", + description="The license information for the workflow.", + ) + creator: Optional[Dict[str, Any]] = Field( + None, + title="Creator", + description="Metadata about the creator of the workflow.", + ) + source_metadata: Optional[Dict[str, Any]] = Field( + None, + title="Source Metadata", + description="Metadata about the source of the workflow", + ) + steps: Dict[int, WorkflowDictEditorSteps] = Field( + ..., + title="Steps", + description="A dictionary with information about all the steps of the workflow.", + ) + + +class WorkflowDictRunSummary(WorkflowDictBaseModel): + id: Optional[str] = Field( + None, + title="ID", + description="The encoded ID of the stored workflow.", + ) + history_id: Optional[str] = Field( + None, + title="History ID", + description="The encoded ID of the history associated with the workflow (or None if not applicable).", + ) + step_version_changes: Optional[List[Dict[str, Any]]] = Field( + None, + title="Step Version Changes", + description="A list of version changes for the workflow steps.", + ) + has_upgrade_messages: Optional[bool] = Field( + None, + title="Has Upgrade Messages", + description="A boolean indicating whether the workflow has upgrade messages.", + ) + workflow_resource_parameters: Optional[Dict[str, Any]] = Field( + None, + title="Workflow Resource Parameters", + description="The resource parameters of the workflow.", + ) + steps: List[WorkflowDictRunSteps] = Field( + ..., + title="Steps", + description="A dictionary with information about all the steps of the workflow.", + ) + + +class WorkflowDictExportSummary(WorkflowDictBaseModel): + a_galaxy_workflow: Optional[bool] = Field( + None, + title="A Galaxy Workflow", + description="Is a Galaxy workflow.", + ) + format_version: Optional[str] = Field( + None, + title="Format Version", + description="The version of the workflow format being used.", + ) + annotation: WorkflowAnnotationField + tags: Optional[List[str]] = Field( + None, + title="Tags", + description="The tags associated with the workflow.", + ) + uuid: Optional[str] = Field( + None, + title="UUID", + description="The UUID (Universally Unique Identifier) of the workflow, represented as a string.", + ) + comments: Optional[List[Dict[str, Any]]] = Field( + None, + title="Comments", + description="A list of dictionaries representing comments associated with the workflow.", + ) + report: Optional[Dict[str, Any]] = Field( + None, + title="Report", + description="The configuration for generating a report for the workflow.", + ) From 69bbb50fa82d9dab2eac9197d817a92d16998db7 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Sun, 3 Mar 2024 17:26:41 +0100 Subject: [PATCH 16/73] Type return of download method --- .../webapps/galaxy/services/workflows.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index 32640af47cca..55e15f0ba1bf 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -40,6 +40,9 @@ SetWorkflowMenuPayload, SetWorkflowMenuSummary, StoredWorkflowDetailed, + WorkflowDictEditorSummary, + WorkflowDictPreviewSummary, + WorkflowDictRunSummary, ) from galaxy.util.tool_shed.tool_shed_registry import Registry from galaxy.webapps.galaxy.services.base import ServiceBase @@ -96,6 +99,22 @@ def download_workflow(self, trans, workflow_id, history_id, style, format, versi if style == "format2" and format != "json-download": return PlainTextResponse(ordered_dump(ret_dict)) + elif style == "export": + return ret_dict + elif style == "editor": + return WorkflowDictEditorSummary(**ret_dict) + elif style == ("legacy" or "instance"): + return StoredWorkflowDetailed(**ret_dict) + elif style == "run": + return WorkflowDictRunSummary(**ret_dict) + elif style == "preview": + return WorkflowDictPreviewSummary(**ret_dict) + elif style == "format2": + return ret_dict + elif style == "format2_wrapped_yaml": + return ret_dict + elif style == "ga": + return ret_dict else: return ret_dict From 5c54863603a0c87ca68883d5cd826e34cb92f3d6 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 11 Mar 2024 11:50:26 +0100 Subject: [PATCH 17/73] Add return model --- lib/galaxy/webapps/galaxy/services/workflows.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index 55e15f0ba1bf..f318158ff736 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -41,6 +41,7 @@ SetWorkflowMenuSummary, StoredWorkflowDetailed, WorkflowDictEditorSummary, + WorkflowDictExportSummary, WorkflowDictPreviewSummary, WorkflowDictRunSummary, ) @@ -96,11 +97,10 @@ def download_workflow(self, trans, workflow_id, history_id, style, format, versi f'attachment; filename="Galaxy-Workflow-{sname}.{extension}"' ) trans.response.set_content_type("application/galaxy-archive") - + if style == "export": + style = style = self._workflow_contents_manager.app.config.default_workflow_export_format if style == "format2" and format != "json-download": return PlainTextResponse(ordered_dump(ret_dict)) - elif style == "export": - return ret_dict elif style == "editor": return WorkflowDictEditorSummary(**ret_dict) elif style == ("legacy" or "instance"): @@ -114,7 +114,7 @@ def download_workflow(self, trans, workflow_id, history_id, style, format, versi elif style == "format2_wrapped_yaml": return ret_dict elif style == "ga": - return ret_dict + return WorkflowDictExportSummary(**ret_dict) else: return ret_dict From d30ca46e42c075d4ee4ad49a5624aa3339e76cf2 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 11 Mar 2024 11:51:52 +0100 Subject: [PATCH 18/73] Make label optional in steps model of editor and run workflowdictsummary --- lib/galaxy/schema/workflows.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 10012aba3988..6ee9a8042fe5 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -310,8 +310,8 @@ class WorkflowDictEditorSteps(Model): title="Type", description="The type of workflow module.", ) - label: str = Field( - ..., + label: Optional[str] = Field( + None, title="Label", description="The label of the step.", ) @@ -415,8 +415,8 @@ class WorkflowDictRunSteps(Model): title="Step Type", description="The type of the step.", ) - step_label: str = Field( - ..., + step_label: Optional[str] = Field( + None, title="Step Label", description="The label of the step.", ) From 1d8ba7388349e40a174a13d50b4d57c40929bf3f Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 11 Mar 2024 14:54:19 +0100 Subject: [PATCH 19/73] Add step model for WorkflowDictExportSummary --- lib/galaxy/schema/workflows.py | 155 ++++++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 6ee9a8042fe5..82f395546242 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -13,6 +13,7 @@ ) from typing_extensions import Annotated +from galaxy.model import InputConnDictType from galaxy.schema.fields import DecodedDatabaseIdField from galaxy.schema.schema import ( AnnotationField, @@ -454,6 +455,138 @@ class WorkflowDictRunSteps(Model): ) +class WorkflowDictExportSteps(Model): + id: int = Field( + ..., + title="ID", + description="The order index of the step.", + ) + type: WorkflowModuleType = Field( + ..., + title="Type", + description="The type of the step.", + ) + content_id: Optional[str] = Field( + None, + title="Content ID", + description="The content ID of the step.", + ) + tool_id: Optional[str] = Field( + None, + title="Tool ID", + description="The tool ID associated with the step (applicable only if the step type is 'tool').", + ) + tool_version: Optional[str] = Field( + None, + title="Tool Version", + description="The version of the tool associated with the step.", + ) + name: str = Field( + ..., + title="Name", + description="The name of the step.", + ) + tool_state: Optional[str] = Field( + None, + title="Tool State", + description="The serialized state of the tool associated with the step.", + ) + errors: Optional[str] = Field( + None, + title="Errors", + description="Any errors associated with the step.", + ) + uuid: str = Field( + ..., + title="UUID", + description="The UUID (Universally Unique Identifier) of the step.", + ) + label: Optional[str] = Field( + None, + title="Label", + description="The label of the step (optional).", + ) + annotation: WorkflowAnnotationField = Field( + None, + title="Annotation", + description="The annotation associated with the step.", + ) + when: Optional[str] = Field( + None, + title="When", + description="The when expression of the step.", + ) + # TODO - can be modeled see manager line 1483 or below + tool_shed_repository: Optional[Dict[str, Any]] = Field( + None, + title="Tool Shed Repository", + description="Information about the tool shed repository associated with the tool.", + ) + # "name" (type: str): The name of the tool shed repository. + # "owner" (type: str): The owner of the tool shed repository. + # "changeset_revision" (type: str): The changeset revision of the tool shed repository. + # "tool_shed" (type: str): The tool shed URL. + tool_representation: Optional[Dict[str, Any]] = Field( + None, + title="Tool Representation", + description="The representation of the tool associated with the step.", + ) + # TODO - can be modeled see manager line 1500 + post_job_actions: Optional[Dict[str, Any]] = Field( + None, + title="Post Job Actions", + description="A dictionary containing post-job actions associated with the step.", + ) + # TODO - can also be WorkflowDictExportSummary see manager line 1512 + subworkflow: Optional[Dict[str, Any]] = Field( + None, + title="Sub Workflow", + description="The sub-workflow associated with the step.", + ) + # TODO - can be modeled see manager line 1516 -1532 + inputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Inputs", + description="The inputs of the step.", + ) + # TODO - can be modeled see manager line 1535 and 1543 + workflow_outputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Workflow Outputs", + description="A list of workflow outputs for the step.", + ) + # TODO - can be modeled see manager line 1546 + outputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Outputs", + description="The outputs of the step.", + ) + # TODO - can be modeled see manager line 1551 + in_parameter: Optional[Dict[str, Any]] = Field( + None, title="In", description="The input connections of the step.", alias="in" + ) + input_connections: Optional[InputConnDictType] = Field( + None, + title="Input Connections", + description="The input connections of the step.", + ) + position: Optional[Any] = Field( + None, + title="Position", + description="The position of the step.", + ) + + +# "post_job_actions" (type: dict): Dictionary containing post-job actions associated with the step. + +# The keys are a combination of action_type and output_name. +# The values are dictionaries with the following items: +# "action_type" (type: str): The type of the post-job action. +# "output_name" (type: str): The name of the output associated with the post-job action. +# "action_arguments" (type: str): The arguments of the post-job action. +# These items provide detailed information about each step in the workflow, including the step type, associated tools, errors, and annotations. + + class WorkflowDictBaseModel(Model): name: str = Field( ..., @@ -548,7 +681,7 @@ class WorkflowDictRunSummary(WorkflowDictBaseModel): class WorkflowDictExportSummary(WorkflowDictBaseModel): - a_galaxy_workflow: Optional[bool] = Field( + a_galaxy_workflow: Optional[str] = Field( None, title="A Galaxy Workflow", description="Is a Galaxy workflow.", @@ -579,3 +712,23 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): title="Report", description="The configuration for generating a report for the workflow.", ) + creator: Optional[Dict[str, Any]] = Field( + None, + title="Creator", + description="Metadata about the creator of the workflow.", + ) + license: Optional[str] = Field( + None, + title="License", + description="The license information for the workflow.", + ) + source_metadata: Optional[Dict[str, Any]] = Field( + None, + title="Source Metadata", + description="Metadata about the source of the workflow.", + ) + steps: Dict[int, WorkflowDictExportSteps] = Field( + ..., + title="Steps", + description="A dictionary with information about all the steps of the workflow.", + ) From 177ad207493b14496adcab48fe68f8a2cdb2944a Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 11 Mar 2024 20:18:30 +0100 Subject: [PATCH 20/73] Change type of input_connections field in step model for WorkflowExportSummary --- lib/galaxy/schema/workflows.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 82f395546242..04621c943629 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -13,7 +13,6 @@ ) from typing_extensions import Annotated -from galaxy.model import InputConnDictType from galaxy.schema.fields import DecodedDatabaseIdField from galaxy.schema.schema import ( AnnotationField, @@ -565,7 +564,7 @@ class WorkflowDictExportSteps(Model): in_parameter: Optional[Dict[str, Any]] = Field( None, title="In", description="The input connections of the step.", alias="in" ) - input_connections: Optional[InputConnDictType] = Field( + input_connections: Optional[Dict[str, Union[Dict[str, Any], List[Dict[str, Any]]]]] = Field( None, title="Input Connections", description="The input connections of the step.", From 645db8bea1ced40f94679692fe9359fa02d06607 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 13 Mar 2024 21:32:24 +0100 Subject: [PATCH 21/73] Add pydantic model for workflowdict in format2 version --- lib/galaxy/schema/workflows.py | 78 +++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 10 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 04621c943629..0e57d4204078 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -576,16 +576,6 @@ class WorkflowDictExportSteps(Model): ) -# "post_job_actions" (type: dict): Dictionary containing post-job actions associated with the step. - -# The keys are a combination of action_type and output_name. -# The values are dictionaries with the following items: -# "action_type" (type: str): The type of the post-job action. -# "output_name" (type: str): The name of the output associated with the post-job action. -# "action_arguments" (type: str): The arguments of the post-job action. -# These items provide detailed information about each step in the workflow, including the step type, associated tools, errors, and annotations. - - class WorkflowDictBaseModel(Model): name: str = Field( ..., @@ -731,3 +721,71 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): title="Steps", description="A dictionary with information about all the steps of the workflow.", ) + + +class WorkflowDictFormat2Summary(Model): + workflow_class: str = Field( + ..., + title="Class", + description="The class of the workflow.", + alias="class", + ) + label: Optional[str] = Field( + None, + title="Label", + description="The label or name of the workflow.", + ) + creator: Optional[Dict[str, Any]] = Field( + None, + title="Creator", + description="Metadata about the creator of the workflow.", + ) + license: Optional[str] = Field( + None, + title="License", + description="The license information for the workflow.", + ) + release: Optional[str] = Field( + None, + title="Release", + description="The release information for the workflow.", + ) + tags: Optional[List[str]] = Field( + None, + title="Tags", + description="The tags associated with the workflow.", + ) + uuid: Optional[str] = Field( + None, + title="UUID", + description="The UUID (Universally Unique Identifier) of the workflow, represented as a string.", + ) + report: Optional[Dict[str, Any]] = Field( + None, + title="Report", + description="The configuration for generating a report for the workflow.", + ) + inputs: Optional[Dict[str, Any]] = Field( + None, + title="Inputs", + description="A dictionary representing the inputs of the workflow.", + ) + outputs: Optional[Dict[str, Any]] = Field( + None, + title="Outputs", + description="A dictionary representing the outputs of the workflow.", + ) + # TODO - step into line 888 in manager + steps: Dict[str, Any] = Field( + ..., + title="Steps", + description="A dictionary representing the steps of the workflow.", + ) + + +class WorkflowDictFormat2WrappedYamlSummary(Model): + yaml_content: str = Field( + ..., + title="YAML Content", + description="The content of the workflow in YAML format.", + ) From 3fc024f02dfee359bec80a7e29328db6a8c9ea20 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 13 Mar 2024 21:33:12 +0100 Subject: [PATCH 22/73] Add pydantic models to return of workflow_dict operation --- lib/galaxy/webapps/galaxy/api/workflows.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index ba9092531b98..ba5ea1b6c816 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -84,6 +84,12 @@ SetWorkflowMenuPayload, SetWorkflowMenuSummary, StoredWorkflowDetailed, + WorkflowDictEditorSummary, + WorkflowDictExportSummary, + WorkflowDictFormat2Summary, + WorkflowDictFormat2WrappedYamlSummary, + WorkflowDictPreviewSummary, + WorkflowDictRunSummary, ) from galaxy.structured_app import StructuredApp from galaxy.tool_shed.galaxy_install.install_manager import InstallRepositoryManager @@ -848,6 +854,16 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): ), ] +DownloadWorkflowSummary = Union[ + WorkflowDictEditorSummary, + StoredWorkflowDetailed, + WorkflowDictRunSummary, + WorkflowDictPreviewSummary, + WorkflowDictFormat2Summary, + WorkflowDictExportSummary, + WorkflowDictFormat2WrappedYamlSummary, +] + @router.cbv class FastAPIWorkflows: @@ -907,11 +923,13 @@ def sharing( @router.get( "/api/workflows/{workflow_id}/download", summary="Returns a selected workflow.", + response_model_exclude_unset=True, ) # Preserve the following download route for now for dependent applications -- deprecate at some point @router.get( "/api/workflows/download/{workflow_id}", summary="Returns a selected workflow.", + response_model_exclude_unset=True, ) def workflow_dict( self, @@ -922,7 +940,7 @@ def workflow_dict( version: VersionQueryParam = None, instance: InstanceQueryParam = False, trans: ProvidesUserContext = DependsOnTrans, - ): + ) -> DownloadWorkflowSummary: return self.service.download_workflow(trans, workflow_id, history_id, style, format, version, instance) @router.put( From d531b6e77b22e57e1995cbb5e5c33bcd1a3ebec4 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 13 Mar 2024 21:34:05 +0100 Subject: [PATCH 23/73] Add further typing to return of download_workflow method --- lib/galaxy/webapps/galaxy/services/workflows.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index f318158ff736..cfacfd756bb8 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -42,6 +42,8 @@ StoredWorkflowDetailed, WorkflowDictEditorSummary, WorkflowDictExportSummary, + WorkflowDictFormat2Summary, + WorkflowDictFormat2WrappedYamlSummary, WorkflowDictPreviewSummary, WorkflowDictRunSummary, ) @@ -110,13 +112,13 @@ def download_workflow(self, trans, workflow_id, history_id, style, format, versi elif style == "preview": return WorkflowDictPreviewSummary(**ret_dict) elif style == "format2": - return ret_dict + return WorkflowDictFormat2Summary(**ret_dict) elif style == "format2_wrapped_yaml": - return ret_dict + return WorkflowDictFormat2WrappedYamlSummary(**ret_dict) elif style == "ga": return WorkflowDictExportSummary(**ret_dict) else: - return ret_dict + raise exceptions.RequestParameterInvalidException(f"Unknown workflow style {style}") def index( self, From b88190c4ca87c4e14d3b1de0497814b481fa3f83 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 14 Mar 2024 20:33:20 +0100 Subject: [PATCH 24/73] Properly type creator in pydantic models of workflowdict operation --- lib/galaxy/schema/workflows.py | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 0e57d4204078..eea153ac5ac9 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -39,6 +39,15 @@ ), ] +WorkflowCreator = Annotated[ + Optional[List[Union[Person, Organization]]], + Field( + None, + title="Creator", + description=("Additional information about the creator (or multiple creators) of this workflow."), + ), +] + class GetTargetHistoryPayload(Model): # TODO - Are the descriptions correct? @@ -198,11 +207,7 @@ class StoredWorkflowDetailed(StoredWorkflowSummary): inputs: Dict[int, WorkflowInput] = Field( {}, title="Inputs", description="A dictionary containing information about all the inputs of the workflow." ) - creator: Optional[List[Union[Person, Organization]]] = Field( - None, - title="Creator", - description=("Additional information about the creator (or multiple creators) of this workflow."), - ) + creator: WorkflowCreator steps: Dict[ int, Annotated[ @@ -619,11 +624,7 @@ class WorkflowDictEditorSummary(WorkflowDictBaseModel): title="License", description="The license information for the workflow.", ) - creator: Optional[Dict[str, Any]] = Field( - None, - title="Creator", - description="Metadata about the creator of the workflow.", - ) + creator: WorkflowCreator source_metadata: Optional[Dict[str, Any]] = Field( None, title="Source Metadata", @@ -701,11 +702,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): title="Report", description="The configuration for generating a report for the workflow.", ) - creator: Optional[Dict[str, Any]] = Field( - None, - title="Creator", - description="Metadata about the creator of the workflow.", - ) + creator: WorkflowCreator license: Optional[str] = Field( None, title="License", @@ -735,11 +732,7 @@ class WorkflowDictFormat2Summary(Model): title="Label", description="The label or name of the workflow.", ) - creator: Optional[Dict[str, Any]] = Field( - None, - title="Creator", - description="Metadata about the creator of the workflow.", - ) + creator: WorkflowCreator license: Optional[str] = Field( None, title="License", From aae45570b15adc3d092589392766655f71e027b8 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 14 Mar 2024 20:34:37 +0100 Subject: [PATCH 25/73] Add alias for format_version field in pydantic model of workflowdict operation --- lib/galaxy/schema/workflows.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index eea153ac5ac9..ec9ef96ea578 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -678,6 +678,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): ) format_version: Optional[str] = Field( None, + alias="format-version", title="Format Version", description="The version of the workflow format being used.", ) From c98190f174645a3fc11d007fcce2e310806c315f Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 14 Mar 2024 21:02:08 +0100 Subject: [PATCH 26/73] Regenerate the client schema --- lib/galaxy/schema/schema.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 8b9c1ecc0bdd..42c5bf012694 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -2617,6 +2617,7 @@ class SubworkflowStepToExport(WorkflowStepToExportBase): ) +# TODO - move to schema of workflow class WorkflowToExport(Model): a_galaxy_workflow: str = Field( # Is this meant to be a bool instead? "true", title="Galaxy Workflow", description="Whether this workflow is a Galaxy Workflow." From 356d44a93b483363de01f4efe216ada64e58561e Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 14 Mar 2024 22:27:40 +0100 Subject: [PATCH 27/73] Create base model for step models of WorkflowSummary models --- lib/galaxy/schema/workflows.py | 242 +++++++++++---------------------- 1 file changed, 77 insertions(+), 165 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index ec9ef96ea578..134318a05da6 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -269,113 +269,123 @@ class SetWorkflowMenuSummary(Model): ) -class WorkflowDictPreviewSteps(Model): - order_index: int = Field( - ..., - title="Order Index", - description="The order index of the step.", - ) +class WorkflowDictStepsBase(Model): type: WorkflowModuleType = Field( ..., title="Type", - description="The type of workflow module.", + alias="step_type", + description="The type of the module that represents a step in the workflow.", ) - annotation: WorkflowAnnotationField = None - label: str = Field( - ..., + # fields below are not in all models initially, but as they were optional in all + # models that had them I think it should be no problem to put them here + # in the base in order to avoid code duplication + when: Optional[str] = Field( + None, + title="When", + description="The when expression for the step.", + ) + label: Optional[str] = Field( + None, + alias="step_label", title="Label", description="The label of the step.", ) - tool_id: Optional[str] = Field( - None, title="Tool ID", description="The unique name of the tool associated with this step." + # TODO - could be modeled further see manager + post_job_actions: Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] = Field( + None, + title="Post Job Actions", + description="A dictionary of post-job actions for the step.", ) tool_version: Optional[str] = Field( - None, title="Tool Version", description="The version of the tool associated with this step." - ) - inputs: List[Dict[str, Any]] = Field( - ..., - title="Inputs", - description="The inputs of the step.", + None, + title="Tool Version", + description="The version of the tool associated with the step.", ) - errors: Optional[List[str]] = Field( + errors: Optional[Union[List[str], str]] = Field( None, title="Errors", - description="Any errors associated with the subworkflow.", + description="Any errors associated with the step.", + ) + tool_id: Optional[str] = Field( + None, + title="Tool ID", + description="The tool ID associated with the step.", + ) + position: Optional[Any] = Field( + None, + title="Position", + description="The position of the step.", + ) + # TODO - can be modeled further see manager + outputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Outputs", + description="The outputs of the step.", + ) + tool_state: Optional[Union[Dict[str, Any], str]] = Field( + None, + title="Tool State", + description="The state of the tool associated with the step", + ) + content_id: Optional[str] = Field( + None, + title="Content ID", + description="The content ID of the step.", + ) + # TODO - could be modeled further see manager + workflow_outputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Workflow Outputs", + description="A list of workflow outputs for the step.", ) -class WorkflowDictEditorSteps(Model): - id: int = Field( +class WorkflowDictPreviewSteps(WorkflowDictStepsBase): + order_index: int = Field( ..., - title="ID", + title="Order Index", description="The order index of the step.", ) - type: WorkflowModuleType = Field( + annotation: WorkflowAnnotationField = None + label: str = Field( ..., - title="Type", - description="The type of workflow module.", - ) - label: Optional[str] = Field( - None, title="Label", description="The label of the step.", ) - content_id: Optional[str] = Field( - None, - title="Content ID", - description="The identifier for the content of the step.", + inputs: List[Dict[str, Any]] = Field( + ..., + title="Inputs", + description="The inputs of the step.", + ) + + +class WorkflowDictEditorSteps(WorkflowDictStepsBase): + id: int = Field( + ..., + title="ID", + description="The order index of the step.", ) name: Optional[str] = Field( None, title="Name", description="The name of the step.", ) - tool_state: Optional[Dict[str, Any]] = Field( - None, - title="Tool State", - description="The state of the step's tool.", - ) - errors: Optional[List[str]] = Field( - None, - title="Errors", - description="Any errors associated with the step.", - ) inputs: Optional[List[Dict[str, Any]]] = Field( None, title="Inputs", description="The inputs of the step.", ) - outputs: Optional[List[Dict[str, Any]]] = Field( - None, - title="Outputs", - description="The outputs of the step.", - ) config_form: Optional[Dict[str, Any]] = Field( None, title="Config Form", description="The configuration form for the step.", ) annotation: WorkflowAnnotationField - post_job_actions: Optional[Dict[str, Any]] = Field( - None, - title="Post Job Actions", - description="A dictionary of post-job actions for the step.", - ) uuid: Optional[str] = Field( None, title="UUID", description="The UUID of the step.", ) - when: Optional[str] = Field( - None, - title="When", - description="The when expression for the step.", - ) - workflow_outputs: Optional[List[Dict[str, Any]]] = Field( - None, - title="Workflow Outputs", - description="A list of workflow outputs for the step.", - ) tooltip: Optional[str] = Field( None, title="Tooltip", @@ -386,45 +396,20 @@ class WorkflowDictEditorSteps(Model): title="Input Connections", description="A dictionary representing the input connections for the step.", ) - position: Optional[Dict[str, Any]] = Field( - None, - title="Position", - description="The position of the step.", - ) - tool_version: Optional[str] = Field( - None, - title="Tool Version", - description="The version of the step's tool.", - ) -# TODO - This is missing some fields - see manager line 1006 -class WorkflowDictRunSteps(Model): +# TODO - This is potentially missing some fields, when step type is tool - see manager line 1006 - TODO +class WorkflowDictRunSteps(WorkflowDictStepsBase): inputs: List[Dict[str, Any]] = Field( ..., title="Inputs", description="The inputs of the step.", ) - when: Optional[str] = Field( - None, - title="When", - description="The when expression for the step.", - ) replacement_parameters: Optional[List[Dict[str, Any]]] = Field( None, title="Replacement Parameters", description="Informal replacement parameters for the step.", ) - step_type: WorkflowModuleType = Field( - ..., - title="Step Type", - description="The type of the step.", - ) - step_label: Optional[str] = Field( - None, - title="Step Label", - description="The label of the step.", - ) step_name: str = Field( ..., title="Step Name", @@ -451,75 +436,25 @@ class WorkflowDictRunSteps(Model): title="Messages", description="Upgrade messages for the step.", ) - # TODO - can further specify post_job_actions - look at code in manager - post_job_actions: Optional[List[Dict[str, Any]]] = Field( - None, - title="Post Job Actions", - description="A list of dictionaries representing the post-job actions for the step.", - ) -class WorkflowDictExportSteps(Model): +class WorkflowDictExportSteps(WorkflowDictStepsBase): id: int = Field( ..., title="ID", description="The order index of the step.", ) - type: WorkflowModuleType = Field( - ..., - title="Type", - description="The type of the step.", - ) - content_id: Optional[str] = Field( - None, - title="Content ID", - description="The content ID of the step.", - ) - tool_id: Optional[str] = Field( - None, - title="Tool ID", - description="The tool ID associated with the step (applicable only if the step type is 'tool').", - ) - tool_version: Optional[str] = Field( - None, - title="Tool Version", - description="The version of the tool associated with the step.", - ) name: str = Field( ..., title="Name", description="The name of the step.", ) - tool_state: Optional[str] = Field( - None, - title="Tool State", - description="The serialized state of the tool associated with the step.", - ) - errors: Optional[str] = Field( - None, - title="Errors", - description="Any errors associated with the step.", - ) uuid: str = Field( ..., title="UUID", description="The UUID (Universally Unique Identifier) of the step.", ) - label: Optional[str] = Field( - None, - title="Label", - description="The label of the step (optional).", - ) - annotation: WorkflowAnnotationField = Field( - None, - title="Annotation", - description="The annotation associated with the step.", - ) - when: Optional[str] = Field( - None, - title="When", - description="The when expression of the step.", - ) + annotation: WorkflowAnnotationField = None # TODO - can be modeled see manager line 1483 or below tool_shed_repository: Optional[Dict[str, Any]] = Field( None, @@ -535,12 +470,6 @@ class WorkflowDictExportSteps(Model): title="Tool Representation", description="The representation of the tool associated with the step.", ) - # TODO - can be modeled see manager line 1500 - post_job_actions: Optional[Dict[str, Any]] = Field( - None, - title="Post Job Actions", - description="A dictionary containing post-job actions associated with the step.", - ) # TODO - can also be WorkflowDictExportSummary see manager line 1512 subworkflow: Optional[Dict[str, Any]] = Field( None, @@ -553,18 +482,6 @@ class WorkflowDictExportSteps(Model): title="Inputs", description="The inputs of the step.", ) - # TODO - can be modeled see manager line 1535 and 1543 - workflow_outputs: Optional[List[Dict[str, Any]]] = Field( - None, - title="Workflow Outputs", - description="A list of workflow outputs for the step.", - ) - # TODO - can be modeled see manager line 1546 - outputs: Optional[List[Dict[str, Any]]] = Field( - None, - title="Outputs", - description="The outputs of the step.", - ) # TODO - can be modeled see manager line 1551 in_parameter: Optional[Dict[str, Any]] = Field( None, title="In", description="The input connections of the step.", alias="in" @@ -574,11 +491,6 @@ class WorkflowDictExportSteps(Model): title="Input Connections", description="The input connections of the step.", ) - position: Optional[Any] = Field( - None, - title="Position", - description="The position of the step.", - ) class WorkflowDictBaseModel(Model): From ce91a39cdf79ea841357fe41b95b757b85fa094d Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Fri, 15 Mar 2024 21:04:23 +0100 Subject: [PATCH 28/73] Create base model for step models of WorkflowSummary models --- lib/galaxy/schema/workflows.py | 125 +++++++++++++++++---------------- 1 file changed, 66 insertions(+), 59 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 134318a05da6..c1321a3335bf 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -28,7 +28,6 @@ SubworkflowStep, ToolStep, WorkflowInput, - WorkflowModuleType, ) WorkflowAnnotationField = Annotated[ @@ -270,26 +269,11 @@ class SetWorkflowMenuSummary(Model): class WorkflowDictStepsBase(Model): - type: WorkflowModuleType = Field( - ..., - title="Type", - alias="step_type", - description="The type of the module that represents a step in the workflow.", - ) - # fields below are not in all models initially, but as they were optional in all - # models that had them I think it should be no problem to put them here - # in the base in order to avoid code duplication when: Optional[str] = Field( None, title="When", description="The when expression for the step.", ) - label: Optional[str] = Field( - None, - alias="step_label", - title="Label", - description="The label of the step.", - ) # TODO - could be modeled further see manager post_job_actions: Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] = Field( None, @@ -340,7 +324,70 @@ class WorkflowDictStepsBase(Model): ) -class WorkflowDictPreviewSteps(WorkflowDictStepsBase): +class WorkflowDictStepsExtendedBase(WorkflowDictStepsBase): + type: str = Field( + ..., + title="Type", + description="The type of the module that represents a step in the workflow.", + ) + label: Optional[str] = Field( + None, + title="Label", + description="The label of the step.", + ) + + +# TODO - This is potentially missing some fields, when step type is tool - see manager line 1006 - TODO +class WorkflowDictRunSteps(WorkflowDictStepsBase): + inputs: List[Dict[str, Any]] = Field( + ..., + title="Inputs", + description="The inputs of the step.", + ) + replacement_parameters: Optional[List[Dict[str, Any]]] = Field( + None, + title="Replacement Parameters", + description="Informal replacement parameters for the step.", + ) + step_name: str = Field( + ..., + title="Step Name", + description="The name of the step's module.", + ) + step_version: Optional[str] = Field( + None, + title="Step Version", + description="The version of the step's module.", + ) + step_index: int = Field( + ..., + title="Step Index", + description="The order index of the step.", + ) + output_connections: List[Dict[str, Any]] = Field( + ..., + title="Output Connections", + description="A list of dictionaries representing the output connections of the step.", + ) + annotation: WorkflowAnnotationField = None + messages: Optional[List[str]] = Field( + None, + title="Messages", + description="Upgrade messages for the step.", + ) + step_type: str = Field( + ..., + title="Step Type", + description="The type of the step.", + ) + step_label: Optional[str] = Field( + None, + title="Step Label", + description="The label of the step.", + ) + + +class WorkflowDictPreviewSteps(WorkflowDictStepsExtendedBase): order_index: int = Field( ..., title="Order Index", @@ -359,7 +406,7 @@ class WorkflowDictPreviewSteps(WorkflowDictStepsBase): ) -class WorkflowDictEditorSteps(WorkflowDictStepsBase): +class WorkflowDictEditorSteps(WorkflowDictStepsExtendedBase): id: int = Field( ..., title="ID", @@ -398,47 +445,7 @@ class WorkflowDictEditorSteps(WorkflowDictStepsBase): ) -# TODO - This is potentially missing some fields, when step type is tool - see manager line 1006 - TODO -class WorkflowDictRunSteps(WorkflowDictStepsBase): - inputs: List[Dict[str, Any]] = Field( - ..., - title="Inputs", - description="The inputs of the step.", - ) - replacement_parameters: Optional[List[Dict[str, Any]]] = Field( - None, - title="Replacement Parameters", - description="Informal replacement parameters for the step.", - ) - step_name: str = Field( - ..., - title="Step Name", - description="The name of the step's module.", - ) - step_version: Optional[str] = Field( - None, - title="Step Version", - description="The version of the step's module.", - ) - step_index: int = Field( - ..., - title="Step Index", - description="The order index of the step.", - ) - output_connections: List[Dict[str, Any]] = Field( - ..., - title="Output Connections", - description="A list of dictionaries representing the output connections of the step.", - ) - annotation: WorkflowAnnotationField = None - messages: Optional[List[str]] = Field( - None, - title="Messages", - description="Upgrade messages for the step.", - ) - - -class WorkflowDictExportSteps(WorkflowDictStepsBase): +class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): id: int = Field( ..., title="ID", From ade337fc1d37d58b8077f86ae295f08d13e3989b Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 18 Mar 2024 16:54:54 +0100 Subject: [PATCH 29/73] Add annotation field to pydantic model of workflow_dict operation --- lib/galaxy/schema/workflows.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index c1321a3335bf..5d0ce763c8e8 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -694,6 +694,7 @@ class WorkflowDictFormat2Summary(Model): title="Steps", description="A dictionary representing the steps of the workflow.", ) + doc: WorkflowAnnotationField = None class WorkflowDictFormat2WrappedYamlSummary(Model): From 9cc4515c0df314b119435dca2d1c4c4cc0b3156a Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 20 Mar 2024 23:13:18 +0100 Subject: [PATCH 30/73] Fix typing of error field in base of step models of workflowdictsummary models --- lib/galaxy/schema/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 5d0ce763c8e8..831a3f62d976 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -285,7 +285,7 @@ class WorkflowDictStepsBase(Model): title="Tool Version", description="The version of the tool associated with the step.", ) - errors: Optional[Union[List[str], str]] = Field( + errors: Optional[Union[List[str], str, Dict[str, Any]]] = Field( None, title="Errors", description="Any errors associated with the step.", From 54c0a01d2b3295cb8c6275ec4c28e9b55a6fcc01 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 20 Mar 2024 23:32:10 +0100 Subject: [PATCH 31/73] Fix typing in WorkflowDictFormat2WrappedYamlSummary model --- lib/galaxy/schema/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 831a3f62d976..a7ebb7382576 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -698,7 +698,7 @@ class WorkflowDictFormat2Summary(Model): class WorkflowDictFormat2WrappedYamlSummary(Model): - yaml_content: str = Field( + yaml_content: Any = Field( ..., title="YAML Content", description="The content of the workflow in YAML format.", From df6f0b85ed8ac864baa6c499427e7efb5a6334b3 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 21 Mar 2024 21:21:10 +0100 Subject: [PATCH 32/73] Add test for set_workflow_menu operation from WorfklowAPI --- lib/galaxy_test/api/test_workflows.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index d7a77b04bb22..5fdc2041b236 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -870,6 +870,15 @@ def test_update_tags(self): update_response = self._update_workflow(workflow_id, update_payload).json() assert update_response["tags"] == [] + def test_set_workflow_menu(self): + original_name = "test update name" + workflow_object = self.workflow_populator.load_workflow(name=original_name) + upload_response = self.__test_upload(workflow=workflow_object, name=original_name) + workflow = upload_response.json() + workflow_id = workflow["id"] + response = self._put(f"/api/workflows/menu", {"workflow_ids": workflow_id}, json=True) + self._assert_status_code_is(response, 200) + def test_update_name(self): original_name = "test update name" workflow_object = self.workflow_populator.load_workflow(name=original_name) From d1cad095ad1d47d75fbe3108da107bf340c2ac67 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 21 Mar 2024 22:22:25 +0100 Subject: [PATCH 33/73] Refine descriptions in pydantic models for workflow_dict operation --- lib/galaxy/schema/workflows.py | 72 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index a7ebb7382576..ec1625e3f1a5 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -278,7 +278,7 @@ class WorkflowDictStepsBase(Model): post_job_actions: Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] = Field( None, title="Post Job Actions", - description="A dictionary of post-job actions for the step.", + description="Set of actions that will be run when the job finishes.", ) tool_version: Optional[str] = Field( None, @@ -288,17 +288,17 @@ class WorkflowDictStepsBase(Model): errors: Optional[Union[List[str], str, Dict[str, Any]]] = Field( None, title="Errors", - description="Any errors associated with the step.", + description="An message indicating possible errors in the step.", ) tool_id: Optional[str] = Field( None, title="Tool ID", - description="The tool ID associated with the step.", + description="The unique name of the tool associated with this step.", ) position: Optional[Any] = Field( None, title="Position", - description="The position of the step.", + description="Layout position of this step in the graph", ) # TODO - can be modeled further see manager outputs: Optional[List[Dict[str, Any]]] = Field( @@ -320,7 +320,7 @@ class WorkflowDictStepsBase(Model): workflow_outputs: Optional[List[Dict[str, Any]]] = Field( None, title="Workflow Outputs", - description="A list of workflow outputs for the step.", + description="Workflow outputs associated with this step.", ) @@ -349,11 +349,7 @@ class WorkflowDictRunSteps(WorkflowDictStepsBase): title="Replacement Parameters", description="Informal replacement parameters for the step.", ) - step_name: str = Field( - ..., - title="Step Name", - description="The name of the step's module.", - ) + step_name: str = Field(..., title="Step Name", description="The descriptive name of the module or step.") step_version: Optional[str] = Field( None, title="Step Version", @@ -367,7 +363,7 @@ class WorkflowDictRunSteps(WorkflowDictStepsBase): output_connections: List[Dict[str, Any]] = Field( ..., title="Output Connections", - description="A list of dictionaries representing the output connections of the step.", + description="The output connections of the step.", ) annotation: WorkflowAnnotationField = None messages: Optional[List[str]] = Field( @@ -410,12 +406,12 @@ class WorkflowDictEditorSteps(WorkflowDictStepsExtendedBase): id: int = Field( ..., title="ID", - description="The order index of the step.", + description="The identifier of the step. It matches the index order of the step inside the workflow.", ) name: Optional[str] = Field( None, title="Name", - description="The name of the step.", + description="The descriptive name of the module or step.", ) inputs: Optional[List[Dict[str, Any]]] = Field( None, @@ -431,7 +427,8 @@ class WorkflowDictEditorSteps(WorkflowDictStepsExtendedBase): uuid: Optional[str] = Field( None, title="UUID", - description="The UUID of the step.", + description="Universal unique identifier of the workflow.", + # description="The UUID (Universally Unique Identifier) of the step.", ) tooltip: Optional[str] = Field( None, @@ -441,7 +438,7 @@ class WorkflowDictEditorSteps(WorkflowDictStepsExtendedBase): input_connections: Optional[Dict[str, Any]] = Field( None, title="Input Connections", - description="A dictionary representing the input connections for the step.", + description="The input connections for the step.", ) @@ -449,17 +446,18 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): id: int = Field( ..., title="ID", - description="The order index of the step.", + description="The identifier of the step. It matches the index order of the step inside the workflow.", ) name: str = Field( ..., title="Name", - description="The name of the step.", + description="The descriptive name of the module or step.", ) uuid: str = Field( ..., title="UUID", - description="The UUID (Universally Unique Identifier) of the step.", + description="Universal unique identifier of the workflow.", + # description="The UUID (Universally Unique Identifier) of the step.", ) annotation: WorkflowAnnotationField = None # TODO - can be modeled see manager line 1483 or below @@ -481,7 +479,7 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): subworkflow: Optional[Dict[str, Any]] = Field( None, title="Sub Workflow", - description="The sub-workflow associated with the step.", + description="Full information about the subworkflow associated with this step.", ) # TODO - can be modeled see manager line 1516 -1532 inputs: Optional[List[Dict[str, Any]]] = Field( @@ -509,7 +507,7 @@ class WorkflowDictBaseModel(Model): version: int = Field( ..., title="Version", - description="The version of the workflow.", + description="The version of the workflow represented by an incremental number.", ) @@ -517,7 +515,7 @@ class WorkflowDictPreviewSummary(WorkflowDictBaseModel): steps: List[WorkflowDictPreviewSteps] = Field( ..., title="Steps", - description="A dictionary with information about all the steps of the workflow.", + description="Information about all the steps of the workflow.", ) @@ -541,7 +539,7 @@ class WorkflowDictEditorSummary(WorkflowDictBaseModel): license: Optional[str] = Field( None, title="License", - description="The license information for the workflow.", + description="SPDX Identifier of the license associated with this workflow.", ) creator: WorkflowCreator source_metadata: Optional[Dict[str, Any]] = Field( @@ -552,7 +550,7 @@ class WorkflowDictEditorSummary(WorkflowDictBaseModel): steps: Dict[int, WorkflowDictEditorSteps] = Field( ..., title="Steps", - description="A dictionary with information about all the steps of the workflow.", + description="Information about all the steps of the workflow.", ) @@ -560,22 +558,24 @@ class WorkflowDictRunSummary(WorkflowDictBaseModel): id: Optional[str] = Field( None, title="ID", - description="The encoded ID of the stored workflow.", + # description="The encoded ID of the stored workflow.", + description="TODO", ) history_id: Optional[str] = Field( None, title="History ID", - description="The encoded ID of the history associated with the workflow (or None if not applicable).", + # description="The encoded ID of the history associated with the workflow (or None if not applicable).", + description="TODO", ) step_version_changes: Optional[List[Dict[str, Any]]] = Field( None, title="Step Version Changes", - description="A list of version changes for the workflow steps.", + description="Version changes for the workflow steps.", ) has_upgrade_messages: Optional[bool] = Field( None, title="Has Upgrade Messages", - description="A boolean indicating whether the workflow has upgrade messages.", + description="Whether the workflow has upgrade messages.", ) workflow_resource_parameters: Optional[Dict[str, Any]] = Field( None, @@ -585,7 +585,7 @@ class WorkflowDictRunSummary(WorkflowDictBaseModel): steps: List[WorkflowDictRunSteps] = Field( ..., title="Steps", - description="A dictionary with information about all the steps of the workflow.", + description="Information about all the steps of the workflow.", ) @@ -593,7 +593,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): a_galaxy_workflow: Optional[str] = Field( None, title="A Galaxy Workflow", - description="Is a Galaxy workflow.", + description="Whether this workflow is a Galaxy Workflow.", ) format_version: Optional[str] = Field( None, @@ -615,7 +615,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): comments: Optional[List[Dict[str, Any]]] = Field( None, title="Comments", - description="A list of dictionaries representing comments associated with the workflow.", + description="Comments associated with the workflow.", ) report: Optional[Dict[str, Any]] = Field( None, @@ -626,7 +626,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): license: Optional[str] = Field( None, title="License", - description="The license information for the workflow.", + description="SPDX Identifier of the license associated with this workflow.", ) source_metadata: Optional[Dict[str, Any]] = Field( None, @@ -636,7 +636,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): steps: Dict[int, WorkflowDictExportSteps] = Field( ..., title="Steps", - description="A dictionary with information about all the steps of the workflow.", + description="Information about all the steps of the workflow.", ) @@ -656,7 +656,7 @@ class WorkflowDictFormat2Summary(Model): license: Optional[str] = Field( None, title="License", - description="The license information for the workflow.", + description="SPDX Identifier of the license associated with this workflow.", ) release: Optional[str] = Field( None, @@ -681,18 +681,18 @@ class WorkflowDictFormat2Summary(Model): inputs: Optional[Dict[str, Any]] = Field( None, title="Inputs", - description="A dictionary representing the inputs of the workflow.", + description="The inputs of the workflow.", ) outputs: Optional[Dict[str, Any]] = Field( None, title="Outputs", - description="A dictionary representing the outputs of the workflow.", + description="The outputs of the workflow.", ) # TODO - step into line 888 in manager steps: Dict[str, Any] = Field( ..., title="Steps", - description="A dictionary representing the steps of the workflow.", + description="Information about all the steps of the workflow.", ) doc: WorkflowAnnotationField = None From 901dae7b5eb34c5629a66f153beefeed2415b413 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 21 Mar 2024 22:31:52 +0100 Subject: [PATCH 34/73] Move old and unused WorkflowToExport model to workflow schema file --- lib/galaxy/schema/schema.py | 116 -------------------------------- lib/galaxy/schema/workflows.py | 117 +++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+), 116 deletions(-) diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 42c5bf012694..e828fe1308f0 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -23,7 +23,6 @@ BeforeValidator, ConfigDict, Field, - Json, model_validator, RootModel, UUID4, @@ -2496,71 +2495,6 @@ class WorkflowStepLayoutPosition(Model): InvocationsStateCounts = RootModel[Dict[str, int]] -class WorkflowStepToExportBase(Model): - id: int = Field( - ..., - title="ID", - description="The identifier of the step. It matches the index order of the step inside the workflow.", - ) - type: str = Field(..., title="Type", description="The type of workflow module.") - name: str = Field(..., title="Name", description="The descriptive name of the module or step.") - annotation: Optional[str] = AnnotationField - tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? - None, title="Tool ID", description="The unique name of the tool associated with this step." - ) - uuid: UUID4 = Field( - ..., - title="UUID", - description="Universal unique identifier of the workflow.", - ) - label: Optional[str] = Field( - None, - title="Label", - ) - inputs: List[Input] = Field( - ..., - title="Inputs", - description="TODO", - ) - outputs: List[Output] = Field( - ..., - title="Outputs", - description="TODO", - ) - input_connections: Dict[str, InputConnection] = Field( - {}, - title="Input Connections", - description="TODO", - ) - position: WorkflowStepLayoutPosition = Field( - ..., - title="Position", - description="Layout position of this step in the graph", - ) - workflow_outputs: List[WorkflowOutput] = Field( - [], title="Workflow Outputs", description="Workflow outputs associated with this step." - ) - - -class WorkflowStepToExport(WorkflowStepToExportBase): - content_id: Optional[str] = Field( # Duplicate of `tool_id` or viceversa? - None, title="Content ID", description="TODO" - ) - tool_version: Optional[str] = Field( - None, title="Tool Version", description="The version of the tool associated with this step." - ) - tool_state: Json = Field( - ..., - title="Tool State", - description="JSON string containing the serialized representation of the persistable state of the step.", - ) - errors: Optional[str] = Field( - None, - title="Errors", - description="An message indicating possible errors in the step.", - ) - - class ToolShedRepositorySummary(Model): name: str = Field( ..., @@ -2602,56 +2536,6 @@ class PostJobAction(Model): ) -class WorkflowToolStepToExport(WorkflowStepToExportBase): - tool_shed_repository: ToolShedRepositorySummary = Field( - ..., title="Tool Shed Repository", description="Information about the origin repository of this tool." - ) - post_job_actions: Dict[str, PostJobAction] = Field( - ..., title="Post-job Actions", description="Set of actions that will be run when the job finish." - ) - - -class SubworkflowStepToExport(WorkflowStepToExportBase): - subworkflow: "WorkflowToExport" = Field( - ..., title="Subworkflow", description="Full information about the subworkflow associated with this step." - ) - - -# TODO - move to schema of workflow -class WorkflowToExport(Model): - a_galaxy_workflow: str = Field( # Is this meant to be a bool instead? - "true", title="Galaxy Workflow", description="Whether this workflow is a Galaxy Workflow." - ) - format_version: str = Field( - "0.1", - alias="format-version", # why this field uses `-` instead of `_`? - title="Galaxy Workflow", - description="Whether this workflow is a Galaxy Workflow.", - ) - name: str = Field(..., title="Name", description="The name of the workflow.") - annotation: Optional[str] = AnnotationField - tags: TagCollection - uuid: Optional[UUID4] = Field( - None, - title="UUID", - description="Universal unique identifier of the workflow.", - ) - creator: Optional[List[Union[Person, Organization]]] = Field( - None, - title="Creator", - description=("Additional information about the creator (or multiple creators) of this workflow."), - ) - license: Optional[str] = Field( - None, title="License", description="SPDX Identifier of the license associated with this workflow." - ) - version: int = Field( - ..., title="Version", description="The version of the workflow represented by an incremental number." - ) - steps: Dict[int, Union[SubworkflowStepToExport, WorkflowToolStepToExport, WorkflowStepToExport]] = Field( - {}, title="Steps", description="A dictionary with information about all the steps of the workflow." - ) - - # Roles ----------------------------------------------------------------- RoleIdField = Annotated[EncodedDatabaseIdField, Field(title="ID", description="Encoded ID of the role")] diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index ec1625e3f1a5..10de457cd3ad 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -703,3 +703,120 @@ class WorkflowDictFormat2WrappedYamlSummary(Model): title="YAML Content", description="The content of the workflow in YAML format.", ) + + +""" +class WorkflowStepToExportBase(Model): + id: int = Field( + ..., + title="ID", + description="The identifier of the step. It matches the index order of the step inside the workflow.", + ) + type: str = Field(..., title="Type", description="The type of workflow module.") + name: str = Field(..., title="Name", description="The descriptive name of the module or step.") + annotation: Optional[str] = AnnotationField + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, title="Tool ID", description="The unique name of the tool associated with this step." + ) + uuid: UUID4 = Field( + ..., + title="UUID", + description="Universal unique identifier of the workflow.", + ) + label: Optional[str] = Field( + None, + title="Label", + ) + inputs: List[Input] = Field( + ..., + title="Inputs", + description="TODO", + ) + outputs: List[Output] = Field( + ..., + title="Outputs", + description="TODO", + ) + input_connections: Dict[str, InputConnection] = Field( + {}, + title="Input Connections", + description="TODO", + ) + position: WorkflowStepLayoutPosition = Field( + ..., + title="Position", + description="Layout position of this step in the graph", + ) + workflow_outputs: List[WorkflowOutput] = Field( + [], title="Workflow Outputs", description="Workflow outputs associated with this step." + ) + + +class WorkflowStepToExport(WorkflowStepToExportBase): + content_id: Optional[str] = Field( # Duplicate of `tool_id` or viceversa? + None, title="Content ID", description="TODO" + ) + tool_version: Optional[str] = Field( + None, title="Tool Version", description="The version of the tool associated with this step." + ) + tool_state: Json = Field( + ..., + title="Tool State", + description="JSON string containing the serialized representation of the persistable state of the step.", + ) + errors: Optional[str] = Field( + None, + title="Errors", + description="An message indicating possible errors in the step.", + ) + + +class WorkflowToolStepToExport(WorkflowStepToExportBase): + tool_shed_repository: ToolShedRepositorySummary = Field( + ..., title="Tool Shed Repository", description="Information about the origin repository of this tool." + ) + post_job_actions: Dict[str, PostJobAction] = Field( + ..., title="Post-job Actions", description="Set of actions that will be run when the job finish." + ) + + +class SubworkflowStepToExport(WorkflowStepToExportBase): + subworkflow: "WorkflowToExport" = Field( + ..., title="Subworkflow", description="Full information about the subworkflow associated with this step." + ) + + +# TODO - move to schema of workflow +class WorkflowToExport(Model): + a_galaxy_workflow: str = Field( # Is this meant to be a bool instead? + "true", title="Galaxy Workflow", description="Whether this workflow is a Galaxy Workflow." + ) + format_version: str = Field( + "0.1", + alias="format-version", # why this field uses `-` instead of `_`? + title="Galaxy Workflow", + description="Whether this workflow is a Galaxy Workflow.", + ) + name: str = Field(..., title="Name", description="The name of the workflow.") + annotation: Optional[str] = AnnotationField + tags: TagCollection + uuid: Optional[UUID4] = Field( + None, + title="UUID", + description="Universal unique identifier of the workflow.", + ) + creator: Optional[List[Union[Person, Organization]]] = Field( + None, + title="Creator", + description=("Additional information about the creator (or multiple creators) of this workflow."), + ) + license: Optional[str] = Field( + None, title="License", description="SPDX Identifier of the license associated with this workflow." + ) + version: int = Field( + ..., title="Version", description="The version of the workflow represented by an incremental number." + ) + steps: Dict[int, Union[SubworkflowStepToExport, WorkflowToolStepToExport, WorkflowStepToExport]] = Field( + {}, title="Steps", description="A dictionary with information about all the steps of the workflow." + ) +""" From 78d08ffd79ea76c5fecd5e8e3030251219951723 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 21 Mar 2024 22:32:22 +0100 Subject: [PATCH 35/73] Fix style error in test_set_workflow_menu --- lib/galaxy_test/api/test_workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index 5fdc2041b236..aeedbd174576 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -876,7 +876,7 @@ def test_set_workflow_menu(self): upload_response = self.__test_upload(workflow=workflow_object, name=original_name) workflow = upload_response.json() workflow_id = workflow["id"] - response = self._put(f"/api/workflows/menu", {"workflow_ids": workflow_id}, json=True) + response = self._put("/api/workflows/menu", {"workflow_ids": workflow_id}, json=True) self._assert_status_code_is(response, 200) def test_update_name(self): From 5866b77cc5949321246144cbfbf358dea3d4c73e Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Sun, 24 Mar 2024 17:45:45 +0100 Subject: [PATCH 36/73] Add type to uuid field --- lib/galaxy/schema/workflows.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 10de457cd3ad..58258c51c29f 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -10,6 +10,7 @@ from pydantic import ( Field, field_validator, + UUID4, ) from typing_extensions import Annotated @@ -424,11 +425,10 @@ class WorkflowDictEditorSteps(WorkflowDictStepsExtendedBase): description="The configuration form for the step.", ) annotation: WorkflowAnnotationField - uuid: Optional[str] = Field( + uuid: Optional[UUID4] = Field( None, title="UUID", description="Universal unique identifier of the workflow.", - # description="The UUID (Universally Unique Identifier) of the step.", ) tooltip: Optional[str] = Field( None, @@ -453,11 +453,10 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): title="Name", description="The descriptive name of the module or step.", ) - uuid: str = Field( + uuid: UUID4 = Field( ..., title="UUID", description="Universal unique identifier of the workflow.", - # description="The UUID (Universally Unique Identifier) of the step.", ) annotation: WorkflowAnnotationField = None # TODO - can be modeled see manager line 1483 or below @@ -607,10 +606,10 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): title="Tags", description="The tags associated with the workflow.", ) - uuid: Optional[str] = Field( + uuid: Optional[UUID4] = Field( None, title="UUID", - description="The UUID (Universally Unique Identifier) of the workflow, represented as a string.", + description="The UUID (Universally Unique Identifier) of the workflow.", ) comments: Optional[List[Dict[str, Any]]] = Field( None, @@ -668,10 +667,10 @@ class WorkflowDictFormat2Summary(Model): title="Tags", description="The tags associated with the workflow.", ) - uuid: Optional[str] = Field( + uuid: Optional[UUID4] = Field( None, title="UUID", - description="The UUID (Universally Unique Identifier) of the workflow, represented as a string.", + description="The UUID (Universally Unique Identifier) of the workflow.", ) report: Optional[Dict[str, Any]] = Field( None, From f516c4edb338f0f13326c6f6fa515b2ceaa0ff30 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Sun, 24 Mar 2024 18:09:41 +0100 Subject: [PATCH 37/73] Move workflow specific model to the workflow schema file --- lib/galaxy/schema/schema.py | 73 ------------------------------- lib/galaxy/schema/workflows.py | 78 +++++++++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 74 deletions(-) diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index e828fe1308f0..56dde26b3c36 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -2281,42 +2281,6 @@ class StoredWorkflowSummary(Model, WithModelClass): ) -class WorkflowInput(Model): - label: Optional[str] = Field( - ..., - title="Label", - description="Label of the input.", - ) - value: Optional[Any] = Field( - ..., - title="Value", - description="TODO", - ) - uuid: Optional[UUID4] = Field( - ..., - title="UUID", - description="Universal unique identifier of the input.", - ) - - -class WorkflowOutput(Model): - label: Optional[str] = Field( - None, - title="Label", - description="Label of the output.", - ) - output_name: str = Field( - ..., - title="Output Name", - description="The name assigned to the output.", - ) - uuid: Optional[UUID4] = Field( - None, - title="UUID", - description="Universal unique identifier of the output.", - ) - - class InputStep(Model): source_step: int = Field( ..., @@ -2455,43 +2419,6 @@ class Person(Creator): ) -class Input(Model): - name: str = Field(..., title="Name", description="The name of the input.") - description: str = Field(..., title="Description", description="The annotation or description of the input.") - - -class Output(Model): - name: str = Field(..., title="Name", description="The name of the output.") - type: str = Field(..., title="Type", description="The extension or type of output.") - - -class InputConnection(Model): - id: int = Field(..., title="ID", description="The identifier of the input.") - output_name: str = Field( - ..., - title="Output Name", - description="The name assigned to the output.", - ) - input_subworkflow_step_id: Optional[int] = Field( - None, - title="Input Subworkflow Step ID", - description="TODO", - ) - - -class WorkflowStepLayoutPosition(Model): - """Position and dimensions of the workflow step represented by a box on the graph.""" - - bottom: int = Field(..., title="Bottom", description="Position in pixels of the bottom of the box.") - top: int = Field(..., title="Top", description="Position in pixels of the top of the box.") - left: int = Field(..., title="Left", description="Left margin or left-most position of the box.") - right: int = Field(..., title="Right", description="Right margin or right-most position of the box.") - x: int = Field(..., title="X", description="Horizontal pixel coordinate of the top right corner of the box.") - y: int = Field(..., title="Y", description="Vertical pixel coordinate of the top right corner of the box.") - height: int = Field(..., title="Height", description="Height of the box in pixels.") - width: int = Field(..., title="Width", description="Width of the box in pixels.") - - InvocationsStateCounts = RootModel[Dict[str, int]] diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 58258c51c29f..d698a6bce3b0 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -28,7 +28,6 @@ StoredWorkflowSummary, SubworkflowStep, ToolStep, - WorkflowInput, ) WorkflowAnnotationField = Annotated[ @@ -49,6 +48,83 @@ ] +class Input(Model): + name: str = Field(..., title="Name", description="The name of the input.") + description: str = Field(..., title="Description", description="The annotation or description of the input.") + + +class Output(Model): + name: str = Field(..., title="Name", description="The name of the output.") + type: str = Field(..., title="Type", description="The extension or type of output.") + + +class InputConnection(Model): + id: int = Field(..., title="ID", description="The identifier of the input.") + output_name: str = Field( + ..., + title="Output Name", + description="The name assigned to the output.", + ) + input_subworkflow_step_id: Optional[int] = Field( + None, + title="Input Subworkflow Step ID", + description="TODO", + ) + + +class WorkflowStepLayoutPosition(Model): + """Position and dimensions of the workflow step represented by a box on the graph.""" + + bottom: Optional[int] = Field(None, title="Bottom", description="Position in pixels of the bottom of the box.") + top: Optional[int] = Field(None, title="Top", description="Position in pixels of the top of the box.") + left: Optional[int] = Field(None, title="Left", description="Left margin or left-most position of the box.") + right: Optional[int] = Field(None, title="Right", description="Right margin or right-most position of the box.") + x: Optional[int] = Field( + None, title="X", description="Horizontal pixel coordinate of the top right corner of the box." + ) + y: Optional[int] = Field( + None, title="Y", description="Vertical pixel coordinate of the top right corner of the box." + ) + height: Optional[int] = Field(None, title="Height", description="Height of the box in pixels.") + width: Optional[int] = Field(None, title="Width", description="Width of the box in pixels.") + + +class WorkflowInput(Model): + label: Optional[str] = Field( + ..., + title="Label", + description="Label of the input.", + ) + value: Optional[Any] = Field( + ..., + title="Value", + description="TODO", + ) + uuid: Optional[UUID4] = Field( + ..., + title="UUID", + description="Universal unique identifier of the input.", + ) + + +class WorkflowOutput(Model): + label: Optional[str] = Field( + None, + title="Label", + description="Label of the output.", + ) + output_name: str = Field( + ..., + title="Output Name", + description="The name assigned to the output.", + ) + uuid: Optional[UUID4] = Field( + None, + title="UUID", + description="Universal unique identifier of the output.", + ) + + class GetTargetHistoryPayload(Model): # TODO - Are the descriptions correct? history: Optional[str] = Field( From 7b6d62ad2863f153910808adbf0947541be775d9 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Sun, 24 Mar 2024 18:18:26 +0100 Subject: [PATCH 38/73] Add typing to position field in base model of workflowdictsteps --- lib/galaxy/schema/workflows.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index d698a6bce3b0..1641a9667329 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -76,8 +76,8 @@ class WorkflowStepLayoutPosition(Model): """Position and dimensions of the workflow step represented by a box on the graph.""" bottom: Optional[int] = Field(None, title="Bottom", description="Position in pixels of the bottom of the box.") - top: Optional[int] = Field(None, title="Top", description="Position in pixels of the top of the box.") - left: Optional[int] = Field(None, title="Left", description="Left margin or left-most position of the box.") + top: int = Field(..., title="Top", description="Position in pixels of the top of the box.") + left: int = Field(..., title="Left", description="Left margin or left-most position of the box.") right: Optional[int] = Field(None, title="Right", description="Right margin or right-most position of the box.") x: Optional[int] = Field( None, title="X", description="Horizontal pixel coordinate of the top right corner of the box." @@ -372,7 +372,7 @@ class WorkflowDictStepsBase(Model): title="Tool ID", description="The unique name of the tool associated with this step.", ) - position: Optional[Any] = Field( + position: Optional[WorkflowStepLayoutPosition] = Field( None, title="Position", description="Layout position of this step in the graph", From ca4c39510638272df4ed046ba2b0c27017db31db Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Sun, 24 Mar 2024 18:37:23 +0100 Subject: [PATCH 39/73] Add further typing to step models of workflowdict --- lib/galaxy/schema/workflows.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 1641a9667329..77972f44ccc8 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -393,8 +393,7 @@ class WorkflowDictStepsBase(Model): title="Content ID", description="The content ID of the step.", ) - # TODO - could be modeled further see manager - workflow_outputs: Optional[List[Dict[str, Any]]] = Field( + workflow_outputs: Optional[List[WorkflowOutput]] = Field( None, title="Workflow Outputs", description="Workflow outputs associated with this step.", @@ -566,7 +565,7 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): in_parameter: Optional[Dict[str, Any]] = Field( None, title="In", description="The input connections of the step.", alias="in" ) - input_connections: Optional[Dict[str, Union[Dict[str, Any], List[Dict[str, Any]]]]] = Field( + input_connections: Optional[Dict[str, Union[InputConnection, List[InputConnection]]]] = Field( None, title="Input Connections", description="The input connections of the step.", From d493ed2fe3eeeb4019673235b0e79a0e697b7f60 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 27 Mar 2024 15:08:06 +0100 Subject: [PATCH 40/73] Allow float type for fields WorkflowStepLayoutPosition model --- lib/galaxy/schema/workflows.py | 60 +++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 77972f44ccc8..32441010af6e 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -75,18 +75,54 @@ class InputConnection(Model): class WorkflowStepLayoutPosition(Model): """Position and dimensions of the workflow step represented by a box on the graph.""" - bottom: Optional[int] = Field(None, title="Bottom", description="Position in pixels of the bottom of the box.") - top: int = Field(..., title="Top", description="Position in pixels of the top of the box.") - left: int = Field(..., title="Left", description="Left margin or left-most position of the box.") - right: Optional[int] = Field(None, title="Right", description="Right margin or right-most position of the box.") - x: Optional[int] = Field( - None, title="X", description="Horizontal pixel coordinate of the top right corner of the box." - ) - y: Optional[int] = Field( - None, title="Y", description="Vertical pixel coordinate of the top right corner of the box." - ) - height: Optional[int] = Field(None, title="Height", description="Height of the box in pixels.") - width: Optional[int] = Field(None, title="Width", description="Width of the box in pixels.") + bottom: Optional[Union[int, float]] = Field( + None, + title="Bottom", + description="Position of the bottom of the box.", + # description="Position in pixels of the bottom of the box.", + ) + top: Union[int, float] = Field( + ..., + title="Top", + description="Position of the top of the box.", + # description="Position in pixels of the top of the box.", + ) + left: Union[int, float] = Field( + ..., + title="Left", + description="Left margin or left-most position of the box.", + # description="Left margin or left-most position of the box.", + ) + right: Optional[Union[int, float]] = Field( + None, + title="Right", + description="Right margin or right-most position of the box.", + # description="Right margin or right-most position of the box.", + ) + x: Optional[Union[int, float]] = Field( + None, + title="X", + description="Horizontal coordinate of the top right corner of the box.", + # description="Horizontal pixel coordinate of the top right corner of the box.", + ) + y: Optional[Union[int, float]] = Field( + None, + title="Y", + description="Vertical coordinate of the top right corner of the box.", + # description="Vertical pixel coordinate of the top right corner of the box.", + ) + height: Optional[Union[int, float]] = Field( + None, + title="Height", + description="Height of the box.", + # description="Height of the box in pixels.", + ) + width: Optional[Union[int, float]] = Field( + None, + title="Width", + description="Width of the box.", + # description="Width of the box in pixels.", + ) class WorkflowInput(Model): From f10863c6c2e3326b9f871e06c6f5805a02975d2f Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 27 Mar 2024 15:14:18 +0100 Subject: [PATCH 41/73] Allow str as replacement_parameter in WorkflowDictRunSteps model --- lib/galaxy/schema/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 32441010af6e..98ca9731b3d2 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -456,7 +456,7 @@ class WorkflowDictRunSteps(WorkflowDictStepsBase): title="Inputs", description="The inputs of the step.", ) - replacement_parameters: Optional[List[Dict[str, Any]]] = Field( + replacement_parameters: Optional[List[Union[str, Dict[str, Any]]]] = Field( None, title="Replacement Parameters", description="Informal replacement parameters for the step.", From 516011c4e360f99d59e4c1cf4cf59ab93c4927f7 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 28 Mar 2024 12:10:43 +0100 Subject: [PATCH 42/73] Allow str type for step_version_changes field in WorkflowDictRunSummary model --- lib/galaxy/schema/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 98ca9731b3d2..3191ba8dcb96 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -677,7 +677,7 @@ class WorkflowDictRunSummary(WorkflowDictBaseModel): # description="The encoded ID of the history associated with the workflow (or None if not applicable).", description="TODO", ) - step_version_changes: Optional[List[Dict[str, Any]]] = Field( + step_version_changes: Optional[List[Union[str, Dict[str, Any]]]] = Field( None, title="Step Version Changes", description="Version changes for the workflow steps.", From e840d32667045766a5a08ab596700c21b3649438 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Fri, 29 Mar 2024 13:23:27 +0100 Subject: [PATCH 43/73] Move workflow specific models to the workflow schema file --- lib/galaxy/schema/schema.py | 41 ---------------------------------- lib/galaxy/schema/workflows.py | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 56dde26b3c36..f3592a4ab8b4 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -2422,47 +2422,6 @@ class Person(Creator): InvocationsStateCounts = RootModel[Dict[str, int]] -class ToolShedRepositorySummary(Model): - name: str = Field( - ..., - title="Name", - description="The name of the repository.", - ) - owner: str = Field( - ..., - title="Owner", - description="The owner of the repository.", - ) - changeset_revision: str = Field( - ..., - title="Changeset Revision", - description="TODO", - ) - tool_shed: str = Field( - ..., - title="Tool Shed", - description="The Tool Shed base URL.", - ) - - -class PostJobAction(Model): - action_type: str = Field( - ..., - title="Action Type", - description="The type of action to run.", - ) - output_name: str = Field( - ..., - title="Output Name", - description="The name of the output that will be affected by the action.", - ) - action_arguments: Dict[str, Any] = Field( - ..., - title="Action Arguments", - description="Any additional arguments needed by the action.", - ) - - # Roles ----------------------------------------------------------------- RoleIdField = Annotated[EncodedDatabaseIdField, Field(title="ID", description="Encoded ID of the role")] diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 3191ba8dcb96..976f195c3790 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -161,6 +161,47 @@ class WorkflowOutput(Model): ) +class ToolShedRepositorySummary(Model): + name: str = Field( + ..., + title="Name", + description="The name of the repository.", + ) + owner: str = Field( + ..., + title="Owner", + description="The owner of the repository.", + ) + changeset_revision: str = Field( + ..., + title="Changeset Revision", + description="TODO", + ) + tool_shed: str = Field( + ..., + title="Tool Shed", + description="The Tool Shed base URL.", + ) + + +class PostJobAction(Model): + action_type: str = Field( + ..., + title="Action Type", + description="The type of action to run.", + ) + output_name: str = Field( + ..., + title="Output Name", + description="The name of the output that will be affected by the action.", + ) + action_arguments: Dict[str, Any] = Field( + ..., + title="Action Arguments", + description="Any additional arguments needed by the action.", + ) + + class GetTargetHistoryPayload(Model): # TODO - Are the descriptions correct? history: Optional[str] = Field( From 62528ff8a43a70a8752437313bb554edebe27514 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Fri, 29 Mar 2024 13:53:29 +0100 Subject: [PATCH 44/73] Refine tpying in pydantic models of workflow_dict operation --- lib/galaxy/schema/workflows.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 976f195c3790..ee5deb4c3046 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -27,6 +27,7 @@ PreferredObjectStoreIdField, StoredWorkflowSummary, SubworkflowStep, + TagCollection, ToolStep, ) @@ -200,6 +201,11 @@ class PostJobAction(Model): title="Action Arguments", description="Any additional arguments needed by the action.", ) + short_str: Optional[str] = Field( + None, + title="Short String", + description="A short string representation of the action.", + ) class GetTargetHistoryPayload(Model): @@ -428,8 +434,7 @@ class WorkflowDictStepsBase(Model): title="When", description="The when expression for the step.", ) - # TODO - could be modeled further see manager - post_job_actions: Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] = Field( + post_job_actions: Optional[Union[PostJobAction, List[PostJobAction]]] = Field( None, title="Post Job Actions", description="Set of actions that will be run when the job finishes.", @@ -611,16 +616,11 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): description="Universal unique identifier of the workflow.", ) annotation: WorkflowAnnotationField = None - # TODO - can be modeled see manager line 1483 or below - tool_shed_repository: Optional[Dict[str, Any]] = Field( + tool_shed_repository: Optional[ToolShedRepositorySummary] = Field( None, title="Tool Shed Repository", description="Information about the tool shed repository associated with the tool.", ) - # "name" (type: str): The name of the tool shed repository. - # "owner" (type: str): The owner of the tool shed repository. - # "changeset_revision" (type: str): The changeset revision of the tool shed repository. - # "tool_shed" (type: str): The tool shed URL. tool_representation: Optional[Dict[str, Any]] = Field( None, title="Tool Representation", @@ -632,8 +632,7 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): title="Sub Workflow", description="Full information about the subworkflow associated with this step.", ) - # TODO - can be modeled see manager line 1516 -1532 - inputs: Optional[List[Dict[str, Any]]] = Field( + inputs: Optional[List[Input]] = Field( None, title="Inputs", description="The inputs of the step.", @@ -747,13 +746,14 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): description="Whether this workflow is a Galaxy Workflow.", ) format_version: Optional[str] = Field( + # "0.1", None, alias="format-version", title="Format Version", description="The version of the workflow format being used.", ) annotation: WorkflowAnnotationField - tags: Optional[List[str]] = Field( + tags: Optional[TagCollection] = Field( None, title="Tags", description="The tags associated with the workflow.", @@ -814,7 +814,7 @@ class WorkflowDictFormat2Summary(Model): title="Release", description="The release information for the workflow.", ) - tags: Optional[List[str]] = Field( + tags: Optional[TagCollection] = Field( None, title="Tags", description="The tags associated with the workflow.", @@ -883,7 +883,7 @@ class WorkflowStepToExportBase(Model): title="Inputs", description="TODO", ) - outputs: List[Output] = Field( + outputs: List[Output] = Field( # TODO not yet used in models above ..., title="Outputs", description="TODO", From 57770ad0b9fec1d62f0a05f55750f6fb3f47d558 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 1 Apr 2024 15:27:02 +0200 Subject: [PATCH 45/73] Type in_parameter field in WorkflowDictExportSteps with new model and add more comments --- lib/galaxy/schema/workflows.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index ee5deb4c3046..7db55d7198ff 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -54,6 +54,7 @@ class Input(Model): description: str = Field(..., title="Description", description="The annotation or description of the input.") +# TODO - Not in use class Output(Model): name: str = Field(..., title="Name", description="The name of the output.") type: str = Field(..., title="Type", description="The extension or type of output.") @@ -208,6 +209,15 @@ class PostJobAction(Model): ) +class StepIn(Model): + # TODO - add proper type and description - see _workflow_to_dict_export in manager for more details + default: Any = Field( + ..., + title="Default", + description="TODO", + ) + + class GetTargetHistoryPayload(Model): # TODO - Are the descriptions correct? history: Optional[str] = Field( @@ -449,7 +459,7 @@ class WorkflowDictStepsBase(Model): title="Errors", description="An message indicating possible errors in the step.", ) - tool_id: Optional[str] = Field( + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? None, title="Tool ID", description="The unique name of the tool associated with this step.", @@ -465,6 +475,7 @@ class WorkflowDictStepsBase(Model): title="Outputs", description="The outputs of the step.", ) + # TODO - could be JSON type but works like tool_state: Optional[Union[Dict[str, Any], str]] = Field( None, title="Tool State", @@ -637,8 +648,7 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): title="Inputs", description="The inputs of the step.", ) - # TODO - can be modeled see manager line 1551 - in_parameter: Optional[Dict[str, Any]] = Field( + in_parameter: Optional[Dict[str, StepIn]] = Field( None, title="In", description="The input connections of the step.", alias="in" ) input_connections: Optional[Dict[str, Union[InputConnection, List[InputConnection]]]] = Field( From 5dce471f362728583446a48f738816c12028e5d4 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 1 Apr 2024 18:56:12 +0200 Subject: [PATCH 46/73] Adjsut typing of field post_job_actions in model WorkflowDictStepsBase --- lib/galaxy/schema/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 7db55d7198ff..d837ca76065c 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -444,7 +444,7 @@ class WorkflowDictStepsBase(Model): title="When", description="The when expression for the step.", ) - post_job_actions: Optional[Union[PostJobAction, List[PostJobAction]]] = Field( + post_job_actions: Optional[Union[List[PostJobAction], Dict[str, PostJobAction]]] = Field( None, title="Post Job Actions", description="Set of actions that will be run when the job finishes.", From c52e3ab559ade070a47bedd8818cb0194b2904f7 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Fri, 12 Apr 2024 17:27:09 +0200 Subject: [PATCH 47/73] Remove comments --- lib/galaxy/schema/workflows.py | 117 --------------------------------- 1 file changed, 117 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index d837ca76065c..f4779316b0b6 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -864,120 +864,3 @@ class WorkflowDictFormat2WrappedYamlSummary(Model): title="YAML Content", description="The content of the workflow in YAML format.", ) - - -""" -class WorkflowStepToExportBase(Model): - id: int = Field( - ..., - title="ID", - description="The identifier of the step. It matches the index order of the step inside the workflow.", - ) - type: str = Field(..., title="Type", description="The type of workflow module.") - name: str = Field(..., title="Name", description="The descriptive name of the module or step.") - annotation: Optional[str] = AnnotationField - tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? - None, title="Tool ID", description="The unique name of the tool associated with this step." - ) - uuid: UUID4 = Field( - ..., - title="UUID", - description="Universal unique identifier of the workflow.", - ) - label: Optional[str] = Field( - None, - title="Label", - ) - inputs: List[Input] = Field( - ..., - title="Inputs", - description="TODO", - ) - outputs: List[Output] = Field( # TODO not yet used in models above - ..., - title="Outputs", - description="TODO", - ) - input_connections: Dict[str, InputConnection] = Field( - {}, - title="Input Connections", - description="TODO", - ) - position: WorkflowStepLayoutPosition = Field( - ..., - title="Position", - description="Layout position of this step in the graph", - ) - workflow_outputs: List[WorkflowOutput] = Field( - [], title="Workflow Outputs", description="Workflow outputs associated with this step." - ) - - -class WorkflowStepToExport(WorkflowStepToExportBase): - content_id: Optional[str] = Field( # Duplicate of `tool_id` or viceversa? - None, title="Content ID", description="TODO" - ) - tool_version: Optional[str] = Field( - None, title="Tool Version", description="The version of the tool associated with this step." - ) - tool_state: Json = Field( - ..., - title="Tool State", - description="JSON string containing the serialized representation of the persistable state of the step.", - ) - errors: Optional[str] = Field( - None, - title="Errors", - description="An message indicating possible errors in the step.", - ) - - -class WorkflowToolStepToExport(WorkflowStepToExportBase): - tool_shed_repository: ToolShedRepositorySummary = Field( - ..., title="Tool Shed Repository", description="Information about the origin repository of this tool." - ) - post_job_actions: Dict[str, PostJobAction] = Field( - ..., title="Post-job Actions", description="Set of actions that will be run when the job finish." - ) - - -class SubworkflowStepToExport(WorkflowStepToExportBase): - subworkflow: "WorkflowToExport" = Field( - ..., title="Subworkflow", description="Full information about the subworkflow associated with this step." - ) - - -# TODO - move to schema of workflow -class WorkflowToExport(Model): - a_galaxy_workflow: str = Field( # Is this meant to be a bool instead? - "true", title="Galaxy Workflow", description="Whether this workflow is a Galaxy Workflow." - ) - format_version: str = Field( - "0.1", - alias="format-version", # why this field uses `-` instead of `_`? - title="Galaxy Workflow", - description="Whether this workflow is a Galaxy Workflow.", - ) - name: str = Field(..., title="Name", description="The name of the workflow.") - annotation: Optional[str] = AnnotationField - tags: TagCollection - uuid: Optional[UUID4] = Field( - None, - title="UUID", - description="Universal unique identifier of the workflow.", - ) - creator: Optional[List[Union[Person, Organization]]] = Field( - None, - title="Creator", - description=("Additional information about the creator (or multiple creators) of this workflow."), - ) - license: Optional[str] = Field( - None, title="License", description="SPDX Identifier of the license associated with this workflow." - ) - version: int = Field( - ..., title="Version", description="The version of the workflow represented by an incremental number." - ) - steps: Dict[int, Union[SubworkflowStepToExport, WorkflowToolStepToExport, WorkflowStepToExport]] = Field( - {}, title="Steps", description="A dictionary with information about all the steps of the workflow." - ) -""" From 1946b6fe23f97e151c20da50ebc8d7f7eb3acbac Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 15 Apr 2024 15:24:07 +0200 Subject: [PATCH 48/73] Refine return models of the workflow_dict operation from the WorkflowAPI --- lib/galaxy/schema/workflows.py | 90 ++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index f4779316b0b6..bfc2793eb5bb 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -1,4 +1,5 @@ import json +from enum import Enum from typing import ( Any, Dict, @@ -12,9 +13,15 @@ field_validator, UUID4, ) -from typing_extensions import Annotated +from typing_extensions import ( + Annotated, + Literal, +) -from galaxy.schema.fields import DecodedDatabaseIdField +from galaxy.schema.fields import ( + DecodedDatabaseIdField, + EncodedDatabaseIdField, +) from galaxy.schema.schema import ( AnnotationField, InputDataCollectionStep, @@ -30,6 +37,7 @@ TagCollection, ToolStep, ) +from galaxy.schema.workflow.comments import WorkflowCommentModel WorkflowAnnotationField = Annotated[ Optional[str], @@ -49,6 +57,12 @@ ] +class GalaxyWorkflowIdentifiers(str, Enum): + true = "true" + zero_point_one = "0.1" + galaxy_workflow = "GalaxyWorkflow" + + class Input(Model): name: str = Field(..., title="Name", description="The name of the input.") description: str = Field(..., title="Description", description="The annotation or description of the input.") @@ -211,6 +225,7 @@ class PostJobAction(Model): class StepIn(Model): # TODO - add proper type and description - see _workflow_to_dict_export in manager for more details + # or class WorkflowStepInput default: Any = Field( ..., title="Default", @@ -637,8 +652,7 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): title="Tool Representation", description="The representation of the tool associated with the step.", ) - # TODO - can also be WorkflowDictExportSummary see manager line 1512 - subworkflow: Optional[Dict[str, Any]] = Field( + subworkflow: Optional["WorkflowDictExportSummary"] = Field( None, title="Sub Workflow", description="Full information about the subworkflow associated with this step.", @@ -648,9 +662,7 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): title="Inputs", description="The inputs of the step.", ) - in_parameter: Optional[Dict[str, StepIn]] = Field( - None, title="In", description="The input connections of the step.", alias="in" - ) + in_parameter: Optional[Dict[str, StepIn]] = Field(None, title="In", description="TODO", alias="in") input_connections: Optional[Dict[str, Union[InputConnection, List[InputConnection]]]] = Field( None, title="Input Connections", @@ -685,25 +697,26 @@ class WorkflowDictEditorSummary(WorkflowDictBaseModel): title="Upgrade Messages", description="Upgrade messages for each step in the workflow.", ) + # TODO - can this be modeled further? see manager method _workflow_to_dict_editor report: Dict[str, Any] = Field( ..., title="Report", description="The reports configuration for the workflow.", ) - comments: List[Dict[str, Any]] = Field( + comments: List[WorkflowCommentModel] = Field( ..., title="Comments", description="Comments on the workflow.", ) annotation: WorkflowAnnotationField license: Optional[str] = Field( - None, + ..., title="License", description="SPDX Identifier of the license associated with this workflow.", ) creator: WorkflowCreator source_metadata: Optional[Dict[str, Any]] = Field( - None, + ..., title="Source Metadata", description="Metadata about the source of the workflow", ) @@ -715,30 +728,28 @@ class WorkflowDictEditorSummary(WorkflowDictBaseModel): class WorkflowDictRunSummary(WorkflowDictBaseModel): - id: Optional[str] = Field( - None, + id: EncodedDatabaseIdField = Field( + ..., title="ID", - # description="The encoded ID of the stored workflow.", - description="TODO", + description="The encoded ID of the stored workflow.", ) - history_id: Optional[str] = Field( + history_id: Optional[EncodedDatabaseIdField] = Field( None, title="History ID", - # description="The encoded ID of the history associated with the workflow (or None if not applicable).", - description="TODO", + description="The encoded ID of the history associated with the workflow.", ) - step_version_changes: Optional[List[Union[str, Dict[str, Any]]]] = Field( - None, + step_version_changes: List[Union[str, Dict[str, Any]]] = Field( + ..., title="Step Version Changes", description="Version changes for the workflow steps.", ) - has_upgrade_messages: Optional[bool] = Field( - None, + has_upgrade_messages: bool = Field( + ..., title="Has Upgrade Messages", description="Whether the workflow has upgrade messages.", ) workflow_resource_parameters: Optional[Dict[str, Any]] = Field( - None, + ..., title="Workflow Resource Parameters", description="The resource parameters of the workflow.", ) @@ -750,21 +761,22 @@ class WorkflowDictRunSummary(WorkflowDictBaseModel): class WorkflowDictExportSummary(WorkflowDictBaseModel): - a_galaxy_workflow: Optional[str] = Field( - None, + a_galaxy_workflow: Literal[GalaxyWorkflowIdentifiers.true] = Field( + # a_galaxy_workflow: str = Field( + ..., title="A Galaxy Workflow", description="Whether this workflow is a Galaxy Workflow.", ) - format_version: Optional[str] = Field( - # "0.1", - None, + format_version: Literal[GalaxyWorkflowIdentifiers.zero_point_one] = Field( + # format_version: str = Field( + ..., alias="format-version", title="Format Version", description="The version of the workflow format being used.", ) annotation: WorkflowAnnotationField - tags: Optional[TagCollection] = Field( - None, + tags: TagCollection = Field( + ..., title="Tags", description="The tags associated with the workflow.", ) @@ -773,8 +785,8 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): title="UUID", description="The UUID (Universally Unique Identifier) of the workflow.", ) - comments: Optional[List[Dict[str, Any]]] = Field( - None, + comments: List[Dict[str, Any]] = Field( + ..., title="Comments", description="Comments associated with the workflow.", ) @@ -802,7 +814,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): class WorkflowDictFormat2Summary(Model): - workflow_class: str = Field( + workflow_class: Literal[GalaxyWorkflowIdentifiers.galaxy_workflow] = Field( ..., title="Class", description="The class of the workflow.", @@ -839,17 +851,17 @@ class WorkflowDictFormat2Summary(Model): title="Report", description="The configuration for generating a report for the workflow.", ) - inputs: Optional[Dict[str, Any]] = Field( - None, + inputs: Dict[str, Any] = Field( + ..., title="Inputs", description="The inputs of the workflow.", ) - outputs: Optional[Dict[str, Any]] = Field( - None, + outputs: Dict[str, Any] = Field( + ..., title="Outputs", description="The outputs of the workflow.", ) - # TODO - step into line 888 in manager + # TODO - can be modeled further see manager method workflow_to_dict steps: Dict[str, Any] = Field( ..., title="Steps", @@ -859,8 +871,10 @@ class WorkflowDictFormat2Summary(Model): class WorkflowDictFormat2WrappedYamlSummary(Model): + # TODO What type is this? yaml_content: Any = Field( ..., title="YAML Content", - description="The content of the workflow in YAML format.", + # description="Safe and ordered dump of YAML to stream", + description="The content of the workflow in YAML .", ) From 314e026c8f7ecf539ee39b040ebab4bacdce2ad3 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 15 Apr 2024 15:31:09 +0200 Subject: [PATCH 49/73] Remove comments --- lib/galaxy/schema/workflows.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index bfc2793eb5bb..071e4aa5da6e 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -95,49 +95,41 @@ class WorkflowStepLayoutPosition(Model): None, title="Bottom", description="Position of the bottom of the box.", - # description="Position in pixels of the bottom of the box.", ) top: Union[int, float] = Field( ..., title="Top", description="Position of the top of the box.", - # description="Position in pixels of the top of the box.", ) left: Union[int, float] = Field( ..., title="Left", description="Left margin or left-most position of the box.", - # description="Left margin or left-most position of the box.", ) right: Optional[Union[int, float]] = Field( None, title="Right", description="Right margin or right-most position of the box.", - # description="Right margin or right-most position of the box.", ) x: Optional[Union[int, float]] = Field( None, title="X", description="Horizontal coordinate of the top right corner of the box.", - # description="Horizontal pixel coordinate of the top right corner of the box.", ) y: Optional[Union[int, float]] = Field( None, title="Y", description="Vertical coordinate of the top right corner of the box.", - # description="Vertical pixel coordinate of the top right corner of the box.", ) height: Optional[Union[int, float]] = Field( None, title="Height", description="Height of the box.", - # description="Height of the box in pixels.", ) width: Optional[Union[int, float]] = Field( None, title="Width", description="Width of the box.", - # description="Width of the box in pixels.", ) @@ -238,19 +230,16 @@ class GetTargetHistoryPayload(Model): history: Optional[str] = Field( None, title="History", - # description="The encoded history id - passed exactly like this 'hist_id=...' - to import the workflow into. Or the name of the new history to import the workflow into.", description="The encoded history id - passed exactly like this 'hist_id=...' - into which to import. Or the name of the new history into which to import.", ) history_id: Optional[str] = Field( None, title="History ID", - # description="The history to import the workflow into.", description="The encoded history id into which to import.", ) new_history_name: Optional[str] = Field( None, title="New History Name", - # description="The name of the new history to import the workflow into.", description="The name of the new history into which to import.", ) From e565895f656ad1ff3fb6bd42f48a1ed9682545f5 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Tue, 16 Apr 2024 09:23:09 +0200 Subject: [PATCH 50/73] Refine return models of the workflow_dict operation from the WorkflowAPI --- lib/galaxy/schema/workflows.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 071e4aa5da6e..0951c2a329f0 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -57,10 +57,11 @@ ] -class GalaxyWorkflowIdentifiers(str, Enum): +class GalaxyWorkflowStrAttributes(str, Enum): true = "true" zero_point_one = "0.1" galaxy_workflow = "GalaxyWorkflow" + no_tags = "" class Input(Model): @@ -641,6 +642,7 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): title="Tool Representation", description="The representation of the tool associated with the step.", ) + # subworkflow: Optional[Dict[str, Any]] = Field( subworkflow: Optional["WorkflowDictExportSummary"] = Field( None, title="Sub Workflow", @@ -665,6 +667,9 @@ class WorkflowDictBaseModel(Model): title="Name", description="The name of the workflow.", ) + + +class WorkflowDictExtendedBaseModel(WorkflowDictBaseModel): version: int = Field( ..., title="Version", @@ -672,7 +677,7 @@ class WorkflowDictBaseModel(Model): ) -class WorkflowDictPreviewSummary(WorkflowDictBaseModel): +class WorkflowDictPreviewSummary(WorkflowDictExtendedBaseModel): steps: List[WorkflowDictPreviewSteps] = Field( ..., title="Steps", @@ -680,7 +685,7 @@ class WorkflowDictPreviewSummary(WorkflowDictBaseModel): ) -class WorkflowDictEditorSummary(WorkflowDictBaseModel): +class WorkflowDictEditorSummary(WorkflowDictExtendedBaseModel): upgrade_messages: Dict[int, str] = Field( ..., title="Upgrade Messages", @@ -716,7 +721,7 @@ class WorkflowDictEditorSummary(WorkflowDictBaseModel): ) -class WorkflowDictRunSummary(WorkflowDictBaseModel): +class WorkflowDictRunSummary(WorkflowDictExtendedBaseModel): id: EncodedDatabaseIdField = Field( ..., title="ID", @@ -750,13 +755,18 @@ class WorkflowDictRunSummary(WorkflowDictBaseModel): class WorkflowDictExportSummary(WorkflowDictBaseModel): - a_galaxy_workflow: Literal[GalaxyWorkflowIdentifiers.true] = Field( + a_galaxy_workflow: Literal[GalaxyWorkflowStrAttributes.true] = Field( # a_galaxy_workflow: str = Field( ..., title="A Galaxy Workflow", description="Whether this workflow is a Galaxy Workflow.", ) - format_version: Literal[GalaxyWorkflowIdentifiers.zero_point_one] = Field( + version: Optional[int] = Field( + None, + title="Version", + description="The version of the workflow represented by an incremental number.", + ) + format_version: Literal[GalaxyWorkflowStrAttributes.zero_point_one] = Field( # format_version: str = Field( ..., alias="format-version", @@ -764,7 +774,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): description="The version of the workflow format being used.", ) annotation: WorkflowAnnotationField - tags: TagCollection = Field( + tags: Union[TagCollection, Literal[GalaxyWorkflowStrAttributes.no_tags]] = Field( ..., title="Tags", description="The tags associated with the workflow.", @@ -803,7 +813,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): class WorkflowDictFormat2Summary(Model): - workflow_class: Literal[GalaxyWorkflowIdentifiers.galaxy_workflow] = Field( + workflow_class: Literal[GalaxyWorkflowStrAttributes.galaxy_workflow] = Field( ..., title="Class", description="The class of the workflow.", From 5cebbdceff1f7b08f786e1e7ebada7d31547beab Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 17 Apr 2024 10:13:38 +0200 Subject: [PATCH 51/73] Refine return models of the workflow_dict operation from the WorkflowAPI and add tool specific step model for runsummary model --- lib/galaxy/schema/workflows.py | 230 ++++++++++++++++++++++++++++----- 1 file changed, 201 insertions(+), 29 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 0951c2a329f0..f172a112ff7f 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -1,5 +1,4 @@ import json -from enum import Enum from typing import ( Any, Dict, @@ -18,10 +17,7 @@ Literal, ) -from galaxy.schema.fields import ( - DecodedDatabaseIdField, - EncodedDatabaseIdField, -) +from galaxy.schema.fields import DecodedDatabaseIdField from galaxy.schema.schema import ( AnnotationField, InputDataCollectionStep, @@ -57,13 +53,6 @@ ] -class GalaxyWorkflowStrAttributes(str, Enum): - true = "true" - zero_point_one = "0.1" - galaxy_workflow = "GalaxyWorkflow" - no_tags = "" - - class Input(Model): name: str = Field(..., title="Name", description="The name of the input.") description: str = Field(..., title="Description", description="The annotation or description of the input.") @@ -474,13 +463,11 @@ class WorkflowDictStepsBase(Model): title="Position", description="Layout position of this step in the graph", ) - # TODO - can be modeled further see manager outputs: Optional[List[Dict[str, Any]]] = Field( None, title="Outputs", description="The outputs of the step.", ) - # TODO - could be JSON type but works like tool_state: Optional[Union[Dict[str, Any], str]] = Field( None, title="Tool State", @@ -512,7 +499,7 @@ class WorkflowDictStepsExtendedBase(WorkflowDictStepsBase): # TODO - This is potentially missing some fields, when step type is tool - see manager line 1006 - TODO -class WorkflowDictRunSteps(WorkflowDictStepsBase): +class WorkflowDictRunStep(WorkflowDictStepsBase): inputs: List[Dict[str, Any]] = Field( ..., title="Inputs", @@ -557,7 +544,193 @@ class WorkflowDictRunSteps(WorkflowDictStepsBase): ) -class WorkflowDictPreviewSteps(WorkflowDictStepsExtendedBase): +class WorkflowDictRunToolStep(WorkflowDictRunStep): + model_class: Literal["tool"] = Field( + ..., + title="Model Class", + description="The model class of the tool step.", + # description="The model class of the step, given it is a tool.", + ) + id: str = Field( + ..., + title="ID", + description="The identifier of the tool step.", + ) + name: str = Field( + ..., + title="Name", + description="The name of the tool step.", + ) + version: str = Field( + ..., + title="Version", + description="The version of the tool step.", + ) + description: str = Field( + ..., + title="Description", + description="The description of the tool step.", + ) + labels: List[str] = Field( + ..., + title="Labels", + description="The labels of the tool step.", + ) + edam_operations: List[str] = Field( + ..., + title="EDAM Operations", + description="The EDAM operations of the tool step.", + ) + edam_topics: List[str] = Field( + ..., + title="EDAM Topics", + description="The EDAM topics of the tool step.", + ) + hidden: str = Field( + ..., + title="Hidden", + description="The hidden status of the tool step.", + ) + is_workflow_compatible: bool = Field( + ..., + title="Is Workflow Compatible", + description="Indicates if the tool step is compatible with workflows.", + ) + xrefs: List[str] = Field( + ..., + title="XRefs", + description="The cross-references of the tool step.", + ) + panel_section_id: str = Field( + ..., + title="Panel Section ID", + description="The panel section ID of the tool step.", + ) + panel_section_name: str = Field( + ..., + title="Panel Section Name", + description="The panel section name of the tool step.", + ) + form_style: str = Field( + ..., + title="Form Style", + description="The form style of the tool step.", + ) + help: str = Field( + ..., + title="Help", + description="The help of the tool step.", + ) + citations: bool = Field( + ..., + title="Citations", + description="The citations of the tool step.", + ) + sharable_url: Optional[str] = Field( + None, + title="Sharable URL", + description="The sharable URL of the tool step.", + ) + message: str = Field( + ..., + title="Message", + description="The message of the tool step.", + ) + warnings: Optional[str] = Field( + None, + title="Warnings", + description="The warnings of the tool step.", + ) + versions: List[str] = Field( + ..., + title="Versions", + description="The versions of the tool step.", + ) + requirements: List[str] = Field( + ..., + title="Requirements", + description="The requirements of the tool step.", + ) + tool_errors: Optional[str] = Field( + None, + title="Tool Errors", + description="An message indicating possible errors in the tool step.", + ) + state_inputs: Dict[str, Any] = Field( + ..., + title="State Inputs", + description="The state inputs of the tool step.", + ) + job_id: Optional[str] = Field( + None, + title="Job ID", + description="The ID of the job associated with the tool step.", + ) + job_remap: Optional[str] = Field( + None, + title="Job Remap", + description="The remap of the job associated with the tool step.", + ) + history_id: str = Field( + ..., + title="History ID", + description="The ID of the history associated with the tool step.", + ) + display: bool = Field( + ..., + title="Display", + description="Indicates if the tool step should be displayed.", + ) + action: str = Field( + ..., + title="Action", + description="The action of the tool step.", + ) + license: Optional[str] = Field( + None, + title="License", + description="The license of the tool step.", + ) + creator: Optional[str] = Field( + None, + title="Creator", + description="The creator of the tool step.", + ) + method: str = Field( + ..., + title="Method", + description="The method of the tool step.", + ) + enctype: str = Field( + ..., + title="Enctype", + description="The enctype of the tool step.", + ) + tool_shed_repository: Optional[ToolShedRepositorySummary] = Field( + None, + title="Tool Shed Repository", + description="Information about the tool shed repository associated with the tool.", + ) + link: Optional[str] = Field( + None, + title="Link", + description="The link of the tool step.", + ) + # TODO - see lib/galaxy/tools/__init__.py - class Tool - to_dict for further typing + min_width: Optional[Any] = Field( + None, + title="Min Width", + description="The minimum width of the tool step.", + ) + # TODO - see lib/galaxy/tools/__init__.py - class Tool - to_dict for further typing + target: Optional[Any] = Field( + None, + title="Target", + description="The target of the tool step.", + ) + + +class WorkflowDictPreviewStep(WorkflowDictStepsExtendedBase): order_index: int = Field( ..., title="Order Index", @@ -576,7 +749,7 @@ class WorkflowDictPreviewSteps(WorkflowDictStepsExtendedBase): ) -class WorkflowDictEditorSteps(WorkflowDictStepsExtendedBase): +class WorkflowDictEditorStep(WorkflowDictStepsExtendedBase): id: int = Field( ..., title="ID", @@ -615,7 +788,7 @@ class WorkflowDictEditorSteps(WorkflowDictStepsExtendedBase): ) -class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): +class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): id: int = Field( ..., title="ID", @@ -642,7 +815,6 @@ class WorkflowDictExportSteps(WorkflowDictStepsExtendedBase): title="Tool Representation", description="The representation of the tool associated with the step.", ) - # subworkflow: Optional[Dict[str, Any]] = Field( subworkflow: Optional["WorkflowDictExportSummary"] = Field( None, title="Sub Workflow", @@ -678,7 +850,7 @@ class WorkflowDictExtendedBaseModel(WorkflowDictBaseModel): class WorkflowDictPreviewSummary(WorkflowDictExtendedBaseModel): - steps: List[WorkflowDictPreviewSteps] = Field( + steps: List[WorkflowDictPreviewStep] = Field( ..., title="Steps", description="Information about all the steps of the workflow.", @@ -714,7 +886,7 @@ class WorkflowDictEditorSummary(WorkflowDictExtendedBaseModel): title="Source Metadata", description="Metadata about the source of the workflow", ) - steps: Dict[int, WorkflowDictEditorSteps] = Field( + steps: Dict[int, WorkflowDictEditorStep] = Field( ..., title="Steps", description="Information about all the steps of the workflow.", @@ -722,12 +894,12 @@ class WorkflowDictEditorSummary(WorkflowDictExtendedBaseModel): class WorkflowDictRunSummary(WorkflowDictExtendedBaseModel): - id: EncodedDatabaseIdField = Field( + id: str = Field( ..., title="ID", description="The encoded ID of the stored workflow.", ) - history_id: Optional[EncodedDatabaseIdField] = Field( + history_id: Optional[str] = Field( None, title="History ID", description="The encoded ID of the history associated with the workflow.", @@ -747,7 +919,7 @@ class WorkflowDictRunSummary(WorkflowDictExtendedBaseModel): title="Workflow Resource Parameters", description="The resource parameters of the workflow.", ) - steps: List[WorkflowDictRunSteps] = Field( + steps: List[Union[WorkflowDictRunToolStep, WorkflowDictRunStep]] = Field( ..., title="Steps", description="Information about all the steps of the workflow.", @@ -755,7 +927,7 @@ class WorkflowDictRunSummary(WorkflowDictExtendedBaseModel): class WorkflowDictExportSummary(WorkflowDictBaseModel): - a_galaxy_workflow: Literal[GalaxyWorkflowStrAttributes.true] = Field( + a_galaxy_workflow: Literal["true"] = Field( # a_galaxy_workflow: str = Field( ..., title="A Galaxy Workflow", @@ -766,7 +938,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): title="Version", description="The version of the workflow represented by an incremental number.", ) - format_version: Literal[GalaxyWorkflowStrAttributes.zero_point_one] = Field( + format_version: Literal["0.1"] = Field( # format_version: str = Field( ..., alias="format-version", @@ -774,7 +946,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): description="The version of the workflow format being used.", ) annotation: WorkflowAnnotationField - tags: Union[TagCollection, Literal[GalaxyWorkflowStrAttributes.no_tags]] = Field( + tags: Union[TagCollection, Literal[""]] = Field( ..., title="Tags", description="The tags associated with the workflow.", @@ -805,7 +977,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): title="Source Metadata", description="Metadata about the source of the workflow.", ) - steps: Dict[int, WorkflowDictExportSteps] = Field( + steps: Dict[int, WorkflowDictExportStep] = Field( ..., title="Steps", description="Information about all the steps of the workflow.", @@ -813,7 +985,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): class WorkflowDictFormat2Summary(Model): - workflow_class: Literal[GalaxyWorkflowStrAttributes.galaxy_workflow] = Field( + workflow_class: Literal["GalaxyWorkflow"] = Field( ..., title="Class", description="The class of the workflow.", From 2b323df9ef5a7b5d5f96513ee4dd0a4e0268e408 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 17 Apr 2024 10:14:57 +0200 Subject: [PATCH 52/73] Remove comment --- lib/galaxy/schema/workflows.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index f172a112ff7f..a050176f6672 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -498,7 +498,6 @@ class WorkflowDictStepsExtendedBase(WorkflowDictStepsBase): ) -# TODO - This is potentially missing some fields, when step type is tool - see manager line 1006 - TODO class WorkflowDictRunStep(WorkflowDictStepsBase): inputs: List[Dict[str, Any]] = Field( ..., From f01ecd3200aa180e19d1d8825599e4129b439c06 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Sat, 4 May 2024 18:09:59 +0200 Subject: [PATCH 53/73] Remove unused imports --- lib/galaxy/webapps/galaxy/api/workflows.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index ba5ea1b6c816..64d405e96059 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -97,11 +97,7 @@ from galaxy.tools._types import ParameterValidationErrorsT from galaxy.tools.parameters import populate_state from galaxy.tools.parameters.workflow_utils import workflow_building_modes -from galaxy.web import ( - expose_api, - expose_api_raw_anonymous_and_sessionless, - format_return_as_json, -) +from galaxy.web import expose_api from galaxy.webapps.base.controller import ( SharableMixin, url_for, From 90eff8fb5cc8ea429b18161c6908912a21e2d419 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 23 May 2024 15:17:12 +0200 Subject: [PATCH 54/73] Apply suggested changes --- lib/galaxy/schema/workflows.py | 17 +++++------------ lib/galaxy/webapps/galaxy/api/workflows.py | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index a050176f6672..94df67b8a7de 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -53,23 +53,17 @@ ] -class Input(Model): +class WorkflowDictExportStepInput(Model): name: str = Field(..., title="Name", description="The name of the input.") description: str = Field(..., title="Description", description="The annotation or description of the input.") -# TODO - Not in use -class Output(Model): - name: str = Field(..., title="Name", description="The name of the output.") - type: str = Field(..., title="Type", description="The extension or type of output.") - - class InputConnection(Model): - id: int = Field(..., title="ID", description="The identifier of the input.") + id: int = Field(..., title="ID", description="The order index of the step.") output_name: str = Field( ..., title="Output Name", - description="The name assigned to the output.", + description="The output name of the input step that serves as the source for this connection.", ) input_subworkflow_step_id: Optional[int] = Field( None, @@ -132,7 +126,6 @@ class WorkflowInput(Model): value: Optional[Any] = Field( ..., title="Value", - description="TODO", ) uuid: Optional[UUID4] = Field( ..., @@ -150,7 +143,7 @@ class WorkflowOutput(Model): output_name: str = Field( ..., title="Output Name", - description="The name assigned to the output.", + description="The name of the step output.", ) uuid: Optional[UUID4] = Field( None, @@ -819,7 +812,7 @@ class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): title="Sub Workflow", description="Full information about the subworkflow associated with this step.", ) - inputs: Optional[List[Input]] = Field( + inputs: Optional[List[WorkflowDictExportStepInput]] = Field( None, title="Inputs", description="The inputs of the step.", diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 64d405e96059..40dcff0e6ac4 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -804,7 +804,7 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): Optional[str], Query( title="Style of export", - description="The default is 'export', which is the meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are more tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download.", + description="The default is 'export', which is meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download.", ), ] From b2039652e223f1d4fb2c744332fe4993e9f9a721 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 23 May 2024 15:20:02 +0200 Subject: [PATCH 55/73] Remove the description from fields, where the description equals to TODO --- lib/galaxy/schema/workflows.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 94df67b8a7de..ac5165fc894f 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -68,7 +68,6 @@ class InputConnection(Model): input_subworkflow_step_id: Optional[int] = Field( None, title="Input Subworkflow Step ID", - description="TODO", ) @@ -166,7 +165,6 @@ class ToolShedRepositorySummary(Model): changeset_revision: str = Field( ..., title="Changeset Revision", - description="TODO", ) tool_shed: str = Field( ..., @@ -204,7 +202,6 @@ class StepIn(Model): default: Any = Field( ..., title="Default", - description="TODO", ) @@ -253,7 +250,6 @@ class InvokeWorkflowPayload(GetTargetHistoryPayload): True, title="Require Exact Tool Versions", description="If true, exact tool versions are required for workflow invocation.", - # description="TODO", ) allow_tool_state_corrections: Optional[bool] = Field( False, @@ -295,27 +291,22 @@ def inputs_string_to_json(cls, v): inputs: Optional[Dict[str, Any]] = Field( None, title="Inputs", - description="TODO", ) ds_map: Optional[Dict[str, Dict[str, Any]]] = Field( {}, title="Dataset Map", - description="TODO", ) resource_params: Optional[Dict[str, Any]] = Field( {}, title="Resource Parameters", - description="TODO", ) replacement_params: Optional[Dict[str, Any]] = Field( {}, title="Replacement Parameters", - description="TODO", ) step_parameters: Optional[Dict[str, Any]] = Field( None, title="Step Parameters", - description="TODO", ) no_add_to_history: Optional[bool] = Field( False, @@ -337,7 +328,6 @@ def inputs_string_to_json(cls, v): None, title="Effective Outputs", # lib/galaxy/workflow/run_request.py - see line 455 - description="TODO", ) preferred_intermediate_object_store_id: Optional[str] = Field( None, @@ -817,7 +807,7 @@ class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): title="Inputs", description="The inputs of the step.", ) - in_parameter: Optional[Dict[str, StepIn]] = Field(None, title="In", description="TODO", alias="in") + in_parameter: Optional[Dict[str, StepIn]] = Field(None, title="In", alias="in") input_connections: Optional[Dict[str, Union[InputConnection, List[InputConnection]]]] = Field( None, title="Input Connections", From 7a4f08f02e63a87a80da9396bfbf60330053853a Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 23 May 2024 17:04:07 +0200 Subject: [PATCH 56/73] Limit type of field x and y fields in WorkflowStepLayoutPosition to integer --- lib/galaxy/schema/workflows.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index ac5165fc894f..401e4d0d3b61 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -94,12 +94,12 @@ class WorkflowStepLayoutPosition(Model): title="Right", description="Right margin or right-most position of the box.", ) - x: Optional[Union[int, float]] = Field( + x: Optional[int] = Field( None, title="X", description="Horizontal coordinate of the top right corner of the box.", ) - y: Optional[Union[int, float]] = Field( + y: Optional[int] = Field( None, title="Y", description="Vertical coordinate of the top right corner of the box.", From 46844590b56512d8bd8c972fe9a1256ba34f2a05 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Tue, 4 Jun 2024 17:47:09 +0200 Subject: [PATCH 57/73] Make sure tag_str is always of type list, when assigning a value to it in internal manager method _workflow_to_dict_export --- lib/galaxy/managers/workflows.py | 2 +- lib/galaxy/webapps/galaxy/api/workflows.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index da341fa446c4..e145f829e6f1 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -1441,7 +1441,7 @@ def _workflow_to_dict_export(self, trans, stored=None, workflow=None, internal=F If `allow_upgrade`, the workflow and sub-workflows might use updated tool versions when refactoring. """ annotation_str = "" - tags_list = [] + tag_str = [""] annotation_owner = None if stored is not None: if stored.id: diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 40dcff0e6ac4..b28004c56d29 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -21,10 +21,6 @@ Response, status, ) -<<<<<<< HEAD -from gxformat2.yaml import ordered_dump -======= ->>>>>>> Refactor workflow_dict operation to FastAPI from pydantic import ( UUID1, UUID4, From 0f13941fab3b78217d42d5b4a4b2a01e7e0b13bc Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Tue, 4 Jun 2024 17:48:02 +0200 Subject: [PATCH 58/73] Specify valid style types for query param of workflow_dict operation --- lib/galaxy/webapps/galaxy/api/workflows.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index b28004c56d29..098d516eee87 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -10,6 +10,7 @@ Any, Dict, List, + Literal, Optional, Union, ) @@ -797,7 +798,9 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): ) StyleQueryParam = Annotated[ - Optional[str], + Optional[ + Literal["export", "format2", "editor", "legacy", "instance", "run", "preview", "format2_wrapped_yaml", "ga"] + ], Query( title="Style of export", description="The default is 'export', which is meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download.", From f230bb3d4ad4e269e5a7a4be7a6021a20fb42878 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Tue, 4 Jun 2024 17:48:33 +0200 Subject: [PATCH 59/73] Apply code suggestions --- lib/galaxy/schema/workflows.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 401e4d0d3b61..baf81a28c3ed 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -421,6 +421,7 @@ class WorkflowDictStepsBase(Model): title="When", description="The when expression for the step.", ) + # We should eventually clean this up, `Dict[str, PostJobAction]]` is probably the better form. post_job_actions: Optional[Union[List[PostJobAction], Dict[str, PostJobAction]]] = Field( None, title="Post Job Actions", @@ -431,11 +432,13 @@ class WorkflowDictStepsBase(Model): title="Tool Version", description="The version of the tool associated with the step.", ) + # TODO: Formalize an error type errors: Optional[Union[List[str], str, Dict[str, Any]]] = Field( None, title="Errors", description="An message indicating possible errors in the step.", ) + # TODO: split step types and make required for tool steps tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? None, title="Tool ID", @@ -446,6 +449,7 @@ class WorkflowDictStepsBase(Model): title="Position", description="Layout position of this step in the graph", ) + # TODO: model outputs outputs: Optional[List[Dict[str, Any]]] = Field( None, title="Outputs", @@ -527,11 +531,11 @@ class WorkflowDictRunStep(WorkflowDictStepsBase): class WorkflowDictRunToolStep(WorkflowDictRunStep): + # TODO: remove everything that can be gotten through the tool store model_class: Literal["tool"] = Field( ..., title="Model Class", description="The model class of the tool step.", - # description="The model class of the step, given it is a tool.", ) id: str = Field( ..., @@ -928,7 +932,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): description="The version of the workflow format being used.", ) annotation: WorkflowAnnotationField - tags: Union[TagCollection, Literal[""]] = Field( + tags: TagCollection = Field( ..., title="Tags", description="The tags associated with the workflow.", @@ -938,7 +942,8 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): title="UUID", description="The UUID (Universally Unique Identifier) of the workflow.", ) - comments: List[Dict[str, Any]] = Field( + comments: List[WorkflowCommentModel] = Field( + # comments: List[Dict[str, Any]] = Field( ..., title="Comments", description="Comments associated with the workflow.", From f5e232c20a4738164e474b35e7757f0459f4e241 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 6 Jun 2024 12:54:34 +0200 Subject: [PATCH 60/73] Allow list of empty string for tags field in WorkflowDictExportSummary --- lib/galaxy/schema/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index baf81a28c3ed..b2f74798e76a 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -932,7 +932,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): description="The version of the workflow format being used.", ) annotation: WorkflowAnnotationField - tags: TagCollection = Field( + tags: Union[TagCollection, List[Literal[""]]] = Field( ..., title="Tags", description="The tags associated with the workflow.", From 0aeb1e9a29e4dd809c78e6b5492d03a3e6c43622 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 6 Jun 2024 13:00:05 +0200 Subject: [PATCH 61/73] Move field tool_id to explicit step models to enable more specific typing --- lib/galaxy/schema/workflows.py | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index b2f74798e76a..51abab4759d8 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -438,12 +438,6 @@ class WorkflowDictStepsBase(Model): title="Errors", description="An message indicating possible errors in the step.", ) - # TODO: split step types and make required for tool steps - tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? - None, - title="Tool ID", - description="The unique name of the tool associated with this step.", - ) position: Optional[WorkflowStepLayoutPosition] = Field( None, title="Position", @@ -507,6 +501,11 @@ class WorkflowDictRunStep(WorkflowDictStepsBase): title="Step Index", description="The order index of the step.", ) + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) output_connections: List[Dict[str, Any]] = Field( ..., title="Output Connections", @@ -714,6 +713,11 @@ class WorkflowDictRunToolStep(WorkflowDictRunStep): title="Target", description="The target of the tool step.", ) + tool_id: str = Field( # Duplicate of `content_id` or viceversa? + ..., + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) class WorkflowDictPreviewStep(WorkflowDictStepsExtendedBase): @@ -733,6 +737,11 @@ class WorkflowDictPreviewStep(WorkflowDictStepsExtendedBase): title="Inputs", description="The inputs of the step.", ) + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) class WorkflowDictEditorStep(WorkflowDictStepsExtendedBase): @@ -772,6 +781,11 @@ class WorkflowDictEditorStep(WorkflowDictStepsExtendedBase): title="Input Connections", description="The input connections for the step.", ) + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): @@ -806,6 +820,11 @@ class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): title="Sub Workflow", description="Full information about the subworkflow associated with this step.", ) + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) inputs: Optional[List[WorkflowDictExportStepInput]] = Field( None, title="Inputs", From f8ae6a5c69590f29d6cc37f349772fd152ce4b16 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 6 Jun 2024 15:27:19 +0200 Subject: [PATCH 62/73] Split model InputConnections into more specific models to use them in different step models --- lib/galaxy/schema/workflows.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 51abab4759d8..d686ed4ebf0b 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -58,19 +58,30 @@ class WorkflowDictExportStepInput(Model): description: str = Field(..., title="Description", description="The annotation or description of the input.") -class InputConnection(Model): +class InputConnectionBase(Model): id: int = Field(..., title="ID", description="The order index of the step.") output_name: str = Field( ..., title="Output Name", description="The output name of the input step that serves as the source for this connection.", ) + + +class InputConnectionExport(InputConnectionBase): input_subworkflow_step_id: Optional[int] = Field( None, title="Input Subworkflow Step ID", ) +class InputConnectionEditor(InputConnectionBase): + input_type: str = Field( + ..., + title="Input Type", + description="The input type of the workflow step.", + ) + + class WorkflowStepLayoutPosition(Model): """Position and dimensions of the workflow step represented by a box on the graph.""" @@ -776,7 +787,8 @@ class WorkflowDictEditorStep(WorkflowDictStepsExtendedBase): title="Tooltip", description="The tooltip for the step.", ) - input_connections: Optional[Dict[str, Any]] = Field( + input_connections: Optional[Dict[str, Union[InputConnectionEditor, List[InputConnectionEditor]]]] = Field( + # input_connections: Optional[Dict[str, Any]] = Field( None, title="Input Connections", description="The input connections for the step.", @@ -831,7 +843,7 @@ class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): description="The inputs of the step.", ) in_parameter: Optional[Dict[str, StepIn]] = Field(None, title="In", alias="in") - input_connections: Optional[Dict[str, Union[InputConnection, List[InputConnection]]]] = Field( + input_connections: Optional[Dict[str, Union[InputConnectionExport, List[InputConnectionExport]]]] = Field( None, title="Input Connections", description="The input connections of the step.", From 9c52d2d26364ec5ed6eba174f457c97fd3e6927b Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Fri, 7 Jun 2024 11:00:31 +0200 Subject: [PATCH 63/73] temporary change for debugging --- lib/galaxy/schema/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index d686ed4ebf0b..d68ad041d7f7 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -460,7 +460,7 @@ class WorkflowDictStepsBase(Model): title="Outputs", description="The outputs of the step.", ) - tool_state: Optional[Union[Dict[str, Any], str]] = Field( + tool_state: Optional[Dict[str, Any]] = Field( None, title="Tool State", description="The state of the tool associated with the step", From bb99760c940338c45aea08f1c071cad6bb6ee50c Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 10 Jun 2024 17:26:39 +0200 Subject: [PATCH 64/73] Fix typo in service method of the workflow_dict operation --- lib/galaxy/webapps/galaxy/services/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index cfacfd756bb8..155d66d27b90 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -100,7 +100,7 @@ def download_workflow(self, trans, workflow_id, history_id, style, format, versi ) trans.response.set_content_type("application/galaxy-archive") if style == "export": - style = style = self._workflow_contents_manager.app.config.default_workflow_export_format + style = self._workflow_contents_manager.app.config.default_workflow_export_format if style == "format2" and format != "json-download": return PlainTextResponse(ordered_dump(ret_dict)) elif style == "editor": From 08b00b542ec8c83b16f72c4b505e991b44bc3df6 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 10 Jun 2024 17:47:54 +0200 Subject: [PATCH 65/73] Add field_validator for tool_state field in step basemodel to deserialize json string --- lib/galaxy/schema/workflows.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index d68ad041d7f7..59511d6254fe 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -476,6 +476,17 @@ class WorkflowDictStepsBase(Model): description="Workflow outputs associated with this step.", ) + @field_validator( + "tool_state", + mode="before", + check_fields=False, + ) + @classmethod + def inputs_string_to_json(cls, v): + if isinstance(v, str): + return json.loads(v) + return v + class WorkflowDictStepsExtendedBase(WorkflowDictStepsBase): type: str = Field( From e9dc08b6e315ee6160c15936383a3ac4b07e68b2 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Tue, 11 Jun 2024 14:34:27 +0200 Subject: [PATCH 66/73] Change typing of field tool_state in step base model to allow strings --- lib/galaxy/schema/workflows.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 59511d6254fe..c7b0ec49b882 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -460,7 +460,7 @@ class WorkflowDictStepsBase(Model): title="Outputs", description="The outputs of the step.", ) - tool_state: Optional[Dict[str, Any]] = Field( + tool_state: Optional[Union[Dict[str, Any], str]] = Field( None, title="Tool State", description="The state of the tool associated with the step", @@ -476,16 +476,16 @@ class WorkflowDictStepsBase(Model): description="Workflow outputs associated with this step.", ) - @field_validator( - "tool_state", - mode="before", - check_fields=False, - ) - @classmethod - def inputs_string_to_json(cls, v): - if isinstance(v, str): - return json.loads(v) - return v + # @field_validator( + # "tool_state", + # mode="before", + # check_fields=False, + # ) + # @classmethod + # def inputs_string_to_json(cls, v): + # if isinstance(v, str): + # return json.loads(v) + # return v class WorkflowDictStepsExtendedBase(WorkflowDictStepsBase): From bcd20c008cbf267973246ebfac8f6313b3e4f08b Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 13 Jun 2024 13:15:11 +0200 Subject: [PATCH 67/73] Formalize error type for WorkflowDictStepsBase model --- lib/galaxy/schema/workflows.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index c7b0ec49b882..f9f75da014bd 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -426,6 +426,38 @@ class SetWorkflowMenuSummary(Model): ) +# see lib/galaxy/tools/parameters/__init__.py - def populate_state +RunStepLiteralError = Literal[ + "The number of repeat elements is outside the range specified by the tool.", + "The selected case is unavailable/invalid.", +] + +# see lib/galaxy/tools/parameters/__init__.py - def check_param +RunStepValueError = Union[ + # ValueError, + str, # unicodify(ValueError) +] + +# see lib/galaxy/tools/__init__.py - def to_json +RunStepError = Union[ + RunStepLiteralError, + RunStepValueError, +] + +# see lib/galaxy/workflow/modules.py - def get_errors +GeneralStepError = Union[ + Literal["Tool is not installed"], + str, # f"{self.tool_id} is not installed" +] + +# see lib/galaxy/managers/workflows.py - _workflow_to_dict_* +StepError = Union[ + Dict[str, RunStepError], + GeneralStepError, + List[GeneralStepError], +] + + class WorkflowDictStepsBase(Model): when: Optional[str] = Field( None, @@ -444,7 +476,7 @@ class WorkflowDictStepsBase(Model): description="The version of the tool associated with the step.", ) # TODO: Formalize an error type - errors: Optional[Union[List[str], str, Dict[str, Any]]] = Field( + errors: Optional[StepError] = Field( None, title="Errors", description="An message indicating possible errors in the step.", From dac8e28b4c51a1805a28da41b7a0929d1bdd3f83 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Wed, 19 Jun 2024 22:06:51 +0200 Subject: [PATCH 68/73] Model output field in WorkflowDictStepsBase and move it to the individual step models --- lib/galaxy/schema/workflows.py | 216 ++++++++++++++++++++++++++++++++- 1 file changed, 210 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index f9f75da014bd..48a99dceb3f9 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -458,6 +458,196 @@ class SetWorkflowMenuSummary(Model): ] +# TODO control typing +# see lib/galaxy/managers/workflows.py - line 1555 +class ExportDictStepToolOutput(Model): + name: str = Field( + ..., + title="Export step output name", + ) + type: str = Field( + ..., + title="Export step output type", + ) + + +# see lib/galaxy/tools/__init__.py - line 2404/2444 +# lib/galaxy/tool_util/parser/output_objects.py - line 123 +class RunStepToolOutput(Model): + name: str = Field( + ..., + ) + format: str = Field( + ..., + ) + label: str = Field( + ..., + ) + hidden: bool = Field( + ..., + ) + output_type: str = Field( + ..., + ) + format_source: Optional[str] = Field( + ..., + ) + default_identifier_source: str = Field( + ..., + ) + metadata_source: str = Field( + ..., + ) + parent: Optional[str] = Field( + ..., + ) + count: int = Field( + ..., + ) + from_work_dir: Optional[bool] = Field( + ..., + ) + edam_format: str = Field( + ..., + ) + edam_data: str = Field( + ..., + ) + # see lib/galaxy/tool_util/parser/output_collection_def.py - line 78 + discover_datasets: List[Any] = Field( + ..., + ) + + +# There is no need to model a class for the output of SubworkflowModule +# as it is equal to the output of one of the other modules + + +# see lib/galaxy/workflow/modules.py - line 1022 +class InputDataModuleStepOutput(Model): + name: Literal["output"] = Field( + ..., + title="Input data module step output name", + ) + extensions: Union[str, List[str]] = Field( + ..., + title="Input data module step output extensions", + ) + optional: bool = Field( + ..., + title="Is optional", + ) + + +# see lib/galaxy/workflow/modules.py - line 1136 +class InputDataCollectionModuleStepOutput(Model): + name: Literal["output"] = Field( + ..., + title="Input data collection module step output name", + ) + extensions: Union[str, List[str]] = Field( + ..., + title="Input data collection module step output extensions", + ) + collection: Literal[True] = Field( + ..., + title="Is collection", + ) + collection_type: str = Field( + ..., + title="Input data collection module step output collection type", + ) + optional: bool = Field( + ..., + title="Is optional", + ) + + +# see lib/galaxy/workflow/modules.py - line 1519 +class InputParameterModuleStepOutput(Model): + name: Literal["output"] = Field( + ..., + title="Input data module step output name", + ) + label: str = Field( + ..., + title="Input data module step output label", + ) + type: str = Field( + ..., + title="Input data module step output parameter type", + ) + optional: bool = Field( + ..., + title="Is optional", + ) + parameter: Literal[True] = Field( + ..., + title="Is parameter", + ) + + +# see lib/galaxy/workflow/modules.py - line 1673 +class PauseModuleStepOutput(Model): + name: Literal["output"] = Field( + ..., + title="Pause module step output name", + ) + label: Literal["Reviewed Dataset"] = Field( + ..., + title="Pause module step output label", + ) + extension: List[Literal["input"]] = Field( + ..., + ) + + +# see lib/galaxy/workflow/modules.py - line 1932 +class ToolModuleStepOutput(Model): + name: str = Field( + ..., + title="Tool module step output name", + ) + extensions: List[str] = Field( + ..., + title="Tool module step output extensions", + ) + type: str = Field( + ..., + title="Tool module step output type", + ) + optional: Literal[False] = Field(..., title="Is optional") + parameter: Literal[True] = Field( + ..., + title="Is parameter", + ) + collection: Literal[True] = Field( + ..., + title="Is collection", + ) + collection_type: str = Field( + ..., + title="Tool module step output collection type", + ) + collection_type_source: str = Field( + ..., + ) + label: Any = Field( + ..., + title="Tool module step output label", + ) + + +# used by: WorkflowDictEditorStep +ModulesStepOutput = Union[ + InputDataModuleStepOutput, + InputDataCollectionModuleStepOutput, + InputParameterModuleStepOutput, + PauseModuleStepOutput, + ToolModuleStepOutput, +] + + class WorkflowDictStepsBase(Model): when: Optional[str] = Field( None, @@ -475,7 +665,6 @@ class WorkflowDictStepsBase(Model): title="Tool Version", description="The version of the tool associated with the step.", ) - # TODO: Formalize an error type errors: Optional[StepError] = Field( None, title="Errors", @@ -487,11 +676,11 @@ class WorkflowDictStepsBase(Model): description="Layout position of this step in the graph", ) # TODO: model outputs - outputs: Optional[List[Dict[str, Any]]] = Field( - None, - title="Outputs", - description="The outputs of the step.", - ) + # # outputs: Optional[List[Dict[str, Any]]] = Field( + # None, + # title="Outputs", + # description="The outputs of the step.", + # ) tool_state: Optional[Union[Dict[str, Any], str]] = Field( None, title="Tool State", @@ -585,6 +774,11 @@ class WorkflowDictRunStep(WorkflowDictStepsBase): class WorkflowDictRunToolStep(WorkflowDictRunStep): # TODO: remove everything that can be gotten through the tool store + outputs: List[RunStepToolOutput] = Field( + ..., + title="Outputs", + description="The outputs of the step.", + ) model_class: Literal["tool"] = Field( ..., title="Model Class", @@ -841,6 +1035,11 @@ class WorkflowDictEditorStep(WorkflowDictStepsExtendedBase): title="Tool ID", description="The unique name of the tool associated with this step.", ) + outputs: Optional[List[ModulesStepOutput]] = Field( + None, + title="Outputs", + description="The outputs of the step.", + ) class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): @@ -885,6 +1084,11 @@ class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): title="Inputs", description="The inputs of the step.", ) + outputs: Optional[List[ExportDictStepToolOutput]] = Field( + None, + title="Outputs", + description="The outputs of the step.", + ) in_parameter: Optional[Dict[str, StepIn]] = Field(None, title="In", alias="in") input_connections: Optional[Dict[str, Union[InputConnectionExport, List[InputConnectionExport]]]] = Field( None, From 482227382e7fa14ad9e68036efc7922c4405ba56 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 23 Sep 2024 13:37:56 +0200 Subject: [PATCH 69/73] Make hints about where StepOutput models are populated more general --- lib/galaxy/schema/workflows.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 48a99dceb3f9..d9c8e003c051 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -523,7 +523,7 @@ class RunStepToolOutput(Model): # as it is equal to the output of one of the other modules -# see lib/galaxy/workflow/modules.py - line 1022 +# see lib/galaxy/workflow/modules.py - class InputDataModule; method get_all_outputs class InputDataModuleStepOutput(Model): name: Literal["output"] = Field( ..., @@ -539,7 +539,7 @@ class InputDataModuleStepOutput(Model): ) -# see lib/galaxy/workflow/modules.py - line 1136 +# see lib/galaxy/workflow/modules.py - - class InputDataCollectionModule; method get_all_outputs class InputDataCollectionModuleStepOutput(Model): name: Literal["output"] = Field( ..., @@ -563,7 +563,7 @@ class InputDataCollectionModuleStepOutput(Model): ) -# see lib/galaxy/workflow/modules.py - line 1519 +# see lib/galaxy/workflow/modules.py - - class InputParameterModule; method get_all_outputs class InputParameterModuleStepOutput(Model): name: Literal["output"] = Field( ..., @@ -587,7 +587,7 @@ class InputParameterModuleStepOutput(Model): ) -# see lib/galaxy/workflow/modules.py - line 1673 +# see lib/galaxy/workflow/modules.py - class PauseModule; method get_all_outputs class PauseModuleStepOutput(Model): name: Literal["output"] = Field( ..., @@ -602,7 +602,7 @@ class PauseModuleStepOutput(Model): ) -# see lib/galaxy/workflow/modules.py - line 1932 +# see lib/galaxy/workflow/modules.py - class ToolModule; method get_all_outputs class ToolModuleStepOutput(Model): name: str = Field( ..., From 15aa79ac73a897b746c0e02b2fc84130574b8019 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 23 Sep 2024 13:39:24 +0200 Subject: [PATCH 70/73] Make necessary fields in ToolModuleStepOutput model optional --- lib/galaxy/schema/workflows.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index d9c8e003c051..50def53ee772 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -617,23 +617,23 @@ class ToolModuleStepOutput(Model): title="Tool module step output type", ) optional: Literal[False] = Field(..., title="Is optional") - parameter: Literal[True] = Field( - ..., + parameter: Optional[Literal[True]] = Field( + None, title="Is parameter", ) - collection: Literal[True] = Field( - ..., + collection: Optional[Literal[True]] = Field( + None, title="Is collection", ) - collection_type: str = Field( - ..., + collection_type: Optional[str] = Field( + None, title="Tool module step output collection type", ) - collection_type_source: str = Field( - ..., + collection_type_source: Optional[str] = Field( + None, ) - label: Any = Field( - ..., + label: Optional[Any] = Field( + None, title="Tool module step output label", ) From d20eb2220f45074518c93a22b598627c97fe3cad Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 23 Sep 2024 13:41:26 +0200 Subject: [PATCH 71/73] Fix typing of the field tags in the WorkflowDictExportSummary model --- lib/galaxy/schema/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 50def53ee772..e233e9058c9f 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -1210,7 +1210,7 @@ class WorkflowDictExportSummary(WorkflowDictBaseModel): description="The version of the workflow format being used.", ) annotation: WorkflowAnnotationField - tags: Union[TagCollection, List[Literal[""]]] = Field( + tags: TagCollection = Field( ..., title="Tags", description="The tags associated with the workflow.", From a52bcb5af533a438952b9ea0b882078385bdea5f Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 23 Sep 2024 13:42:40 +0200 Subject: [PATCH 72/73] Fix assignment of tags in _workflow_to_dict_export method --- lib/galaxy/managers/workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index e145f829e6f1..da341fa446c4 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -1441,7 +1441,7 @@ def _workflow_to_dict_export(self, trans, stored=None, workflow=None, internal=F If `allow_upgrade`, the workflow and sub-workflows might use updated tool versions when refactoring. """ annotation_str = "" - tag_str = [""] + tags_list = [] annotation_owner = None if stored is not None: if stored.id: From 21e25c8d02c41a2036aa22f18e26ea314b6143e3 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Mon, 23 Sep 2024 13:54:35 +0200 Subject: [PATCH 73/73] Regenerate the client schema --- client/src/api/schema/schema.ts | 1973 ++++++++++++++++++++++++++++--- 1 file changed, 1823 insertions(+), 150 deletions(-) diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 9ae31a97516a..01038a1b95ce 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -4901,8 +4901,21 @@ export interface paths { trace?: never; }; "/api/workflows/download/{workflow_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** Returns a selected workflow. */ get: operations["workflow_dict_api_workflows_download__workflow_id__get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; "/api/workflows/menu": { parameters: { @@ -4913,7 +4926,8 @@ export interface paths { }; /** Get workflows present in the tools panel. */ get: operations["get_workflow_menu_api_workflows_menu_get"]; - put?: never; + /** Save workflow menu to be shown in the tool panel */ + put: operations["set_workflow_menu_api_workflows_menu_put"]; post?: never; delete?: never; options?: never; @@ -4977,8 +4991,21 @@ export interface paths { trace?: never; }; "/api/workflows/{workflow_id}/download": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** Returns a selected workflow. */ get: operations["workflow_dict_api_workflows__workflow_id__download_get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; "/api/workflows/{workflow_id}/enable_link_access": { parameters: { @@ -8478,6 +8505,13 @@ export interface components { */ src: components["schemas"]["DataItemSourceType"]; }; + /** ExportDictStepToolOutput */ + ExportDictStepToolOutput: { + /** Export step output name */ + name: string; + /** Export step output type */ + type: string; + }; /** ExportHistoryArchivePayload */ ExportHistoryArchivePayload: { /** @@ -8970,6 +9004,97 @@ export interface components { */ update_time: string; }; + /** FrameComment */ + FrameComment: { + /** + * Child Comments + * @description A list of ids (see `id`) of all Comments which are encompassed by this Frame + */ + child_comments?: number[] | null; + /** + * Child Steps + * @description A list of ids of all Steps (see WorkflowStep.id) which are encompassed by this Frame + */ + child_steps?: number[] | null; + /** + * Color + * @description Color this comment is displayed as. The exact color hex is determined by the client + * @enum {string} + */ + color: "none" | "black" | "blue" | "turquoise" | "green" | "lime" | "orange" | "yellow" | "red" | "pink"; + data: components["schemas"]["FrameCommentData"]; + /** + * Id + * @description Unique identifier for this comment. Determined by the comments order + */ + id: number; + /** + * Position + * @description [x, y] position of this comment in the Workflow + */ + position: [number, number]; + /** + * Size + * @description [width, height] size of this comment + */ + size: [number, number]; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: "frame"; + }; + /** FrameCommentData */ + FrameCommentData: { + /** + * Title + * @description The Frames title + */ + title: string; + }; + /** FreehandComment */ + FreehandComment: { + /** + * Color + * @description Color this comment is displayed as. The exact color hex is determined by the client + * @enum {string} + */ + color: "none" | "black" | "blue" | "turquoise" | "green" | "lime" | "orange" | "yellow" | "red" | "pink"; + data: components["schemas"]["FreehandCommentData"]; + /** + * Id + * @description Unique identifier for this comment. Determined by the comments order + */ + id: number; + /** + * Position + * @description [x, y] position of this comment in the Workflow + */ + position: [number, number]; + /** + * Size + * @description [width, height] size of this comment + */ + size: [number, number]; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: "freehand"; + }; + /** FreehandCommentData */ + FreehandCommentData: { + /** + * Line + * @description List of [x, y] coordinates determining the unsmoothed line. Smoothing is done client-side using Catmull-Rom + */ + line: [number, number][]; + /** + * Thickness + * @description Width of the Line in pixels + */ + thickness: number; + }; /** FtpImportElement */ FtpImportElement: { /** Md5 */ @@ -11179,6 +11304,60 @@ export interface components { */ uri: string; }; + /** InputConnectionEditor */ + InputConnectionEditor: { + /** + * ID + * @description The order index of the step. + */ + id: number; + /** + * Input Type + * @description The input type of the workflow step. + */ + input_type: string; + /** + * Output Name + * @description The output name of the input step that serves as the source for this connection. + */ + output_name: string; + }; + /** InputConnectionExport */ + InputConnectionExport: { + /** + * ID + * @description The order index of the step. + */ + id: number; + /** Input Subworkflow Step ID */ + input_subworkflow_step_id?: number | null; + /** + * Output Name + * @description The output name of the input step that serves as the source for this connection. + */ + output_name: string; + }; + /** InputDataCollectionModuleStepOutput */ + InputDataCollectionModuleStepOutput: { + /** + * Is collection + * @constant + * @enum {boolean} + */ + collection: true; + /** Input data collection module step output collection type */ + collection_type: string; + /** Input data collection module step output extensions */ + extensions: string | string[]; + /** + * Input data collection module step output name + * @constant + * @enum {string} + */ + name: "output"; + /** Is optional */ + optional: boolean; + }; /** InputDataCollectionStep */ InputDataCollectionStep: { /** @@ -11221,6 +11400,19 @@ export interface components { /** When */ when: string | null; }; + /** InputDataModuleStepOutput */ + InputDataModuleStepOutput: { + /** Input data module step output extensions */ + extensions: string | string[]; + /** + * Input data module step output name + * @constant + * @enum {string} + */ + name: "output"; + /** Is optional */ + optional: boolean; + }; /** InputDataStep */ InputDataStep: { /** @@ -11263,6 +11455,27 @@ export interface components { /** When */ when: string | null; }; + /** InputParameterModuleStepOutput */ + InputParameterModuleStepOutput: { + /** Input data module step output label */ + label: string; + /** + * Input data module step output name + * @constant + * @enum {string} + */ + name: "output"; + /** Is optional */ + optional: boolean; + /** + * Is parameter + * @constant + * @enum {boolean} + */ + parameter: true; + /** Input data module step output parameter type */ + type: string; + }; /** InputParameterStep */ InputParameterStep: { /** @@ -12083,16 +12296,12 @@ export interface components { batch: boolean | null; /** * Dataset Map - * @description TODO * @default {} */ ds_map: { [key: string]: Record; } | null; - /** - * Effective Outputs - * @description TODO - */ + /** Effective Outputs */ effective_outputs?: unknown | null; /** * History @@ -12104,10 +12313,7 @@ export interface components { * @description The encoded history id into which to import. */ history_id?: string | null; - /** - * Inputs - * @description TODO - */ + /** Inputs */ inputs?: Record | null; /** * Inputs By @@ -12166,7 +12372,6 @@ export interface components { preferred_outputs_object_store_id?: string | null; /** * Replacement Parameters - * @description TODO * @default {} */ replacement_params: Record | null; @@ -12178,7 +12383,6 @@ export interface components { require_exact_tool_versions: boolean | null; /** * Resource Parameters - * @description TODO * @default {} */ resource_params: Record | null; @@ -12187,10 +12391,7 @@ export interface components { * @description Scheduler to use for workflow invocation. */ scheduler?: string | null; - /** - * Step Parameters - * @description TODO - */ + /** Step Parameters */ step_parameters?: Record | null; /** * Use cached job @@ -13291,6 +13492,44 @@ export interface components { * @enum {string} */ MandatoryNotificationCategory: "broadcast"; + /** MarkdownComment */ + MarkdownComment: { + /** + * Color + * @description Color this comment is displayed as. The exact color hex is determined by the client + * @enum {string} + */ + color: "none" | "black" | "blue" | "turquoise" | "green" | "lime" | "orange" | "yellow" | "red" | "pink"; + data: components["schemas"]["MarkdownCommentData"]; + /** + * Id + * @description Unique identifier for this comment. Determined by the comments order + */ + id: number; + /** + * Position + * @description [x, y] position of this comment in the Workflow + */ + position: [number, number]; + /** + * Size + * @description [width, height] size of this comment + */ + size: [number, number]; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: "markdown"; + }; + /** MarkdownCommentData */ + MarkdownCommentData: { + /** + * Text + * @description The unrendered source Markdown for this Comment + */ + text: string; + }; /** MaterializeDatasetInstanceAPIRequest */ MaterializeDatasetInstanceAPIRequest: { /** @@ -14141,6 +14380,23 @@ export interface components { */ to_posix_lines: boolean; }; + /** PauseModuleStepOutput */ + PauseModuleStepOutput: { + /** Extension */ + extension: "input"[]; + /** + * Pause module step output label + * @constant + * @enum {string} + */ + label: "Reviewed Dataset"; + /** + * Pause module step output name + * @constant + * @enum {string} + */ + name: "output"; + }; /** PauseStep */ PauseStep: { /** @@ -14267,6 +14523,29 @@ export interface components { /** Top */ top: number; }; + /** PostJobAction */ + PostJobAction: { + /** + * Action Arguments + * @description Any additional arguments needed by the action. + */ + action_arguments: Record; + /** + * Action Type + * @description The type of action to run. + */ + action_type: string; + /** + * Output Name + * @description The name of the output that will be affected by the action. + */ + output_name: string; + /** + * Short String + * @description A short string representation of the action. + */ + short_str?: string | null; + }; /** PrepareStoreDownloadPayload */ PrepareStoreDownloadPayload: { /** @@ -14783,6 +15062,37 @@ export interface components { RootModel_Dict_str__int__: { [key: string]: number; }; + /** RunStepToolOutput */ + RunStepToolOutput: { + /** Count */ + count: number; + /** Default Identifier Source */ + default_identifier_source: string; + /** Discover Datasets */ + discover_datasets: unknown[]; + /** Edam Data */ + edam_data: string; + /** Edam Format */ + edam_format: string; + /** Format */ + format: string; + /** Format Source */ + format_source: string | null; + /** From Work Dir */ + from_work_dir: boolean | null; + /** Hidden */ + hidden: boolean; + /** Label */ + label: string; + /** Metadata Source */ + metadata_source: string; + /** Name */ + name: string; + /** Output Type */ + output_type: string; + /** Parent */ + parent: string | null; + }; /** SearchJobsPayload */ SearchJobsPayload: { /** @@ -14939,6 +15249,27 @@ export interface components { */ new_slug: string; }; + /** SetWorkflowMenuPayload */ + SetWorkflowMenuPayload: { + /** + * Workflow IDs + * @description The list of workflow IDs to set the menu entry for. + */ + workflow_ids: string[] | string; + }; + /** SetWorkflowMenuSummary */ + SetWorkflowMenuSummary: { + /** + * Message + * @description The message of the operation. + */ + message: unknown | null; + /** + * Status + * @description The status of the operation. + */ + status: string; + }; /** ShareHistoryExtra */ ShareHistoryExtra: { /** @@ -15354,6 +15685,11 @@ export interface components { * @enum {string} */ Src: "url" | "pasted" | "files" | "path" | "composite" | "ftp_import" | "server_dir"; + /** StepIn */ + StepIn: { + /** Default */ + default: unknown; + }; /** StepReferenceByLabel */ StepReferenceByLabel: { /** @@ -15783,6 +16119,59 @@ export interface components { */ type: "string"; }; + /** TextComment */ + TextComment: { + /** + * Color + * @description Color this comment is displayed as. The exact color hex is determined by the client + * @enum {string} + */ + color: "none" | "black" | "blue" | "turquoise" | "green" | "lime" | "orange" | "yellow" | "red" | "pink"; + data: components["schemas"]["TextCommentData"]; + /** + * Id + * @description Unique identifier for this comment. Determined by the comments order + */ + id: number; + /** + * Position + * @description [x, y] position of this comment in the Workflow + */ + position: [number, number]; + /** + * Size + * @description [width, height] size of this comment + */ + size: [number, number]; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: "text"; + }; + /** TextCommentData */ + TextCommentData: { + /** + * Bold + * @description If the Comments text is bold. Absent is interpreted as false + */ + bold?: boolean | null; + /** + * Italic + * @description If the Comments text is italic. Absent is interpreted as false + */ + italic?: boolean | null; + /** + * Size + * @description Relative size (1 -> 100%) of the text compared to the default text sitz + */ + size: number; + /** + * Text + * @description The plaintext text of this comment + */ + text: string; + }; /** ToolDataDetails */ ToolDataDetails: { /** @@ -15863,6 +16252,51 @@ export interface components { */ values: string; }; + /** ToolModuleStepOutput */ + ToolModuleStepOutput: { + /** Is collection */ + collection?: true | null; + /** Tool module step output collection type */ + collection_type?: string | null; + /** Collection Type Source */ + collection_type_source?: string | null; + /** Tool module step output extensions */ + extensions: string[]; + /** Tool module step output label */ + label?: unknown | null; + /** Tool module step output name */ + name: string; + /** + * Is optional + * @constant + * @enum {boolean} + */ + optional: false; + /** Is parameter */ + parameter?: true | null; + /** Tool module step output type */ + type: string; + }; + /** ToolShedRepositorySummary */ + ToolShedRepositorySummary: { + /** Changeset Revision */ + changeset_revision: string; + /** + * Name + * @description The name of the repository. + */ + name: string; + /** + * Owner + * @description The owner of the repository. + */ + owner: string; + /** + * Tool Shed + * @description The Tool Shed base URL. + */ + tool_shed: string; + }; /** ToolStep */ ToolStep: { /** @@ -17020,169 +17454,1232 @@ export interface components { */ latest_revision: components["schemas"]["VisualizationRevisionResponse"]; /** - * Model class - * @description The name of the database model class. + * Model class + * @description The name of the database model class. + * @constant + * @enum {string} + */ + model_class: "Visualization"; + /** + * Plugin + * @description The plugin of this Visualization. + */ + plugin?: components["schemas"]["VisualizationPluginResponse"] | null; + /** + * Revisions + * @description A list of encoded IDs of the revisions of this Visualization. + */ + revisions: string[]; + /** + * Slug + * @description The slug of the visualization. + */ + slug?: string | null; + /** + * Tags + * @description A list of tags to add to this item. + */ + tags?: components["schemas"]["TagCollection"] | null; + /** + * Title + * @description The name of the visualization. + */ + title: string; + /** + * Type + * @description The type of the visualization. + */ + type: string; + /** + * URL + * @description The URL of the visualization. + */ + url: string; + /** + * User ID + * @description The ID of the user owning this Visualization. + * @example 0123456789ABCDEF + */ + user_id: string; + /** + * Username + * @description The name of the user owning this Visualization. + */ + username: string; + }; + /** VisualizationSummary */ + VisualizationSummary: { + /** + * Annotation + * @description The annotation of this Visualization. + */ + annotation?: string | null; + /** + * Create Time + * @description The time and date this item was created. + */ + create_time: string | null; + /** + * DbKey + * @description The database key of the visualization. + */ + dbkey?: string | null; + /** + * Deleted + * @description Whether this Visualization has been deleted. + */ + deleted: boolean; + /** + * ID + * @description Encoded ID of the Visualization. + * @example 0123456789ABCDEF + */ + id: string; + /** + * Importable + * @description Whether this Visualization can be imported. + */ + importable: boolean; + /** + * Published + * @description Whether this Visualization has been published. + */ + published: boolean; + /** + * Tags + * @description A list of tags to add to this item. + */ + tags: components["schemas"]["TagCollection"] | null; + /** + * Title + * @description The name of the visualization. + */ + title: string; + /** + * Type + * @description The type of the visualization. + */ + type: string; + /** + * Update Time + * @description The last time and date this item was updated. + */ + update_time: string | null; + /** + * Username + * @description The name of the user owning this Visualization. + */ + username: string; + } & { + [key: string]: unknown; + }; + /** + * VisualizationSummaryList + * @default [] + */ + VisualizationSummaryList: components["schemas"]["VisualizationSummary"][]; + /** VisualizationUpdatePayload */ + VisualizationUpdatePayload: { + /** + * Config + * @description The config of the visualization. + * @default {} + */ + config: Record | string | null; + /** + * DbKey + * @description The database key of the visualization. + */ + dbkey?: string | null; + /** + * Deleted + * @description Whether this Visualization has been deleted. + * @default false + */ + deleted: boolean | null; + /** + * Title + * @description The name of the visualization. + */ + title?: string | null; + }; + /** VisualizationUpdateResponse */ + VisualizationUpdateResponse: { + /** + * ID + * @description Encoded ID of the Visualization. + * @example 0123456789ABCDEF + */ + id: string; + /** + * Revision + * @description Encoded ID of the Visualization Revision. + * @example 0123456789ABCDEF + */ + revision: string; + }; + /** WorkflowCommentModel */ + WorkflowCommentModel: + | components["schemas"]["TextComment"] + | components["schemas"]["MarkdownComment"] + | components["schemas"]["FrameComment"] + | components["schemas"]["FreehandComment"]; + /** WorkflowDictEditorStep */ + WorkflowDictEditorStep: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation: string | null; + /** + * Config Form + * @description The configuration form for the step. + */ + config_form?: Record | null; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * ID + * @description The identifier of the step. It matches the index order of the step inside the workflow. + */ + id: number; + /** + * Input Connections + * @description The input connections for the step. + */ + input_connections?: { + [key: string]: + | components["schemas"]["InputConnectionEditor"] + | components["schemas"]["InputConnectionEditor"][]; + } | null; + /** + * Inputs + * @description The inputs of the step. + */ + inputs?: Record[] | null; + /** + * Label + * @description The label of the step. + */ + label?: string | null; + /** + * Name + * @description The descriptive name of the module or step. + */ + name?: string | null; + /** + * Outputs + * @description The outputs of the step. + */ + outputs?: + | ( + | components["schemas"]["InputDataModuleStepOutput"] + | components["schemas"]["InputDataCollectionModuleStepOutput"] + | components["schemas"]["InputParameterModuleStepOutput"] + | components["schemas"]["PauseModuleStepOutput"] + | components["schemas"]["ToolModuleStepOutput"] + )[] + | null; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Tool ID + * @description The unique name of the tool associated with this step. + */ + tool_id?: string | null; + /** + * Tool State + * @description The state of the tool associated with the step + */ + tool_state?: Record | string | null; + /** + * Tool Version + * @description The version of the tool associated with the step. + */ + tool_version?: string | null; + /** + * Tooltip + * @description The tooltip for the step. + */ + tooltip?: string | null; + /** + * Type + * @description The type of the module that represents a step in the workflow. + */ + type: string; + /** + * UUID + * @description Universal unique identifier of the workflow. + */ + uuid?: string | null; + /** + * When + * @description The when expression for the step. + */ + when?: string | null; + /** + * Workflow Outputs + * @description Workflow outputs associated with this step. + */ + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + }; + /** WorkflowDictEditorSummary */ + WorkflowDictEditorSummary: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation: string | null; + /** + * Comments + * @description Comments on the workflow. + */ + comments: components["schemas"]["WorkflowCommentModel"][]; + /** + * Creator + * @description Additional information about the creator (or multiple creators) of this workflow. + */ + creator?: + | (components["schemas"]["Person"] | components["schemas"]["galaxy__schema__schema__Organization"])[] + | null; + /** + * License + * @description SPDX Identifier of the license associated with this workflow. + */ + license: string | null; + /** + * Name + * @description The name of the workflow. + */ + name: string; + /** + * Report + * @description The reports configuration for the workflow. + */ + report: Record; + /** + * Source Metadata + * @description Metadata about the source of the workflow + */ + source_metadata: Record | null; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: { + [key: string]: components["schemas"]["WorkflowDictEditorStep"]; + }; + /** + * Upgrade Messages + * @description Upgrade messages for each step in the workflow. + */ + upgrade_messages: { + [key: string]: string; + }; + /** + * Version + * @description The version of the workflow represented by an incremental number. + */ + version: number; + }; + /** WorkflowDictExportStep */ + WorkflowDictExportStep: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation?: string | null; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * ID + * @description The identifier of the step. It matches the index order of the step inside the workflow. + */ + id: number; + /** In */ + in?: { + [key: string]: components["schemas"]["StepIn"]; + } | null; + /** + * Input Connections + * @description The input connections of the step. + */ + input_connections?: { + [key: string]: + | components["schemas"]["InputConnectionExport"] + | components["schemas"]["InputConnectionExport"][]; + } | null; + /** + * Inputs + * @description The inputs of the step. + */ + inputs?: components["schemas"]["WorkflowDictExportStepInput"][] | null; + /** + * Label + * @description The label of the step. + */ + label?: string | null; + /** + * Name + * @description The descriptive name of the module or step. + */ + name: string; + /** + * Outputs + * @description The outputs of the step. + */ + outputs?: components["schemas"]["ExportDictStepToolOutput"][] | null; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Sub Workflow + * @description Full information about the subworkflow associated with this step. + */ + subworkflow?: components["schemas"]["WorkflowDictExportSummary"] | null; + /** + * Tool ID + * @description The unique name of the tool associated with this step. + */ + tool_id?: string | null; + /** + * Tool Representation + * @description The representation of the tool associated with the step. + */ + tool_representation?: Record | null; + /** + * Tool Shed Repository + * @description Information about the tool shed repository associated with the tool. + */ + tool_shed_repository?: components["schemas"]["ToolShedRepositorySummary"] | null; + /** + * Tool State + * @description The state of the tool associated with the step + */ + tool_state?: Record | string | null; + /** + * Tool Version + * @description The version of the tool associated with the step. + */ + tool_version?: string | null; + /** + * Type + * @description The type of the module that represents a step in the workflow. + */ + type: string; + /** + * UUID + * Format: uuid4 + * @description Universal unique identifier of the workflow. + */ + uuid: string; + /** + * When + * @description The when expression for the step. + */ + when?: string | null; + /** + * Workflow Outputs + * @description Workflow outputs associated with this step. + */ + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + }; + /** WorkflowDictExportStepInput */ + WorkflowDictExportStepInput: { + /** + * Description + * @description The annotation or description of the input. + */ + description: string; + /** + * Name + * @description The name of the input. + */ + name: string; + }; + /** WorkflowDictExportSummary */ + WorkflowDictExportSummary: { + /** + * A Galaxy Workflow + * @description Whether this workflow is a Galaxy Workflow. + * @constant + * @enum {string} + */ + a_galaxy_workflow: "true"; + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation: string | null; + /** + * Comments + * @description Comments associated with the workflow. + */ + comments: components["schemas"]["WorkflowCommentModel"][]; + /** + * Creator + * @description Additional information about the creator (or multiple creators) of this workflow. + */ + creator?: + | (components["schemas"]["Person"] | components["schemas"]["galaxy__schema__schema__Organization"])[] + | null; + /** + * Format Version + * @description The version of the workflow format being used. + * @constant + * @enum {string} + */ + "format-version": "0.1"; + /** + * License + * @description SPDX Identifier of the license associated with this workflow. + */ + license?: string | null; + /** + * Name + * @description The name of the workflow. + */ + name: string; + /** + * Report + * @description The configuration for generating a report for the workflow. + */ + report?: Record | null; + /** + * Source Metadata + * @description Metadata about the source of the workflow. + */ + source_metadata?: Record | null; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: { + [key: string]: components["schemas"]["WorkflowDictExportStep"]; + }; + /** + * Tags + * @description The tags associated with the workflow. + */ + tags: components["schemas"]["TagCollection"]; + /** + * UUID + * @description The UUID (Universally Unique Identifier) of the workflow. + */ + uuid?: string | null; + /** + * Version + * @description The version of the workflow represented by an incremental number. + */ + version?: number | null; + }; + /** WorkflowDictFormat2Summary */ + WorkflowDictFormat2Summary: { + /** + * Class + * @description The class of the workflow. + * @constant + * @enum {string} + */ + class: "GalaxyWorkflow"; + /** + * Creator + * @description Additional information about the creator (or multiple creators) of this workflow. + */ + creator?: + | (components["schemas"]["Person"] | components["schemas"]["galaxy__schema__schema__Organization"])[] + | null; + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + doc?: string | null; + /** + * Inputs + * @description The inputs of the workflow. + */ + inputs: Record; + /** + * Label + * @description The label or name of the workflow. + */ + label?: string | null; + /** + * License + * @description SPDX Identifier of the license associated with this workflow. + */ + license?: string | null; + /** + * Outputs + * @description The outputs of the workflow. + */ + outputs: Record; + /** + * Release + * @description The release information for the workflow. + */ + release?: string | null; + /** + * Report + * @description The configuration for generating a report for the workflow. + */ + report?: Record | null; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: Record; + /** + * Tags + * @description The tags associated with the workflow. + */ + tags?: components["schemas"]["TagCollection"] | null; + /** + * UUID + * @description The UUID (Universally Unique Identifier) of the workflow. + */ + uuid?: string | null; + }; + /** WorkflowDictFormat2WrappedYamlSummary */ + WorkflowDictFormat2WrappedYamlSummary: { + /** + * YAML Content + * @description The content of the workflow in YAML . + */ + yaml_content: unknown; + }; + /** WorkflowDictPreviewStep */ + WorkflowDictPreviewStep: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation?: string | null; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * Inputs + * @description The inputs of the step. + */ + inputs: Record[]; + /** + * Label + * @description The label of the step. + */ + label: string; + /** + * Order Index + * @description The order index of the step. + */ + order_index: number; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Tool ID + * @description The unique name of the tool associated with this step. + */ + tool_id?: string | null; + /** + * Tool State + * @description The state of the tool associated with the step + */ + tool_state?: Record | string | null; + /** + * Tool Version + * @description The version of the tool associated with the step. + */ + tool_version?: string | null; + /** + * Type + * @description The type of the module that represents a step in the workflow. + */ + type: string; + /** + * When + * @description The when expression for the step. + */ + when?: string | null; + /** + * Workflow Outputs + * @description Workflow outputs associated with this step. + */ + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + }; + /** WorkflowDictPreviewSummary */ + WorkflowDictPreviewSummary: { + /** + * Name + * @description The name of the workflow. + */ + name: string; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: components["schemas"]["WorkflowDictPreviewStep"][]; + /** + * Version + * @description The version of the workflow represented by an incremental number. + */ + version: number; + }; + /** WorkflowDictRunStep */ + WorkflowDictRunStep: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation?: string | null; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * Inputs + * @description The inputs of the step. + */ + inputs: Record[]; + /** + * Messages + * @description Upgrade messages for the step. + */ + messages?: string[] | null; + /** + * Output Connections + * @description The output connections of the step. + */ + output_connections: Record[]; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Replacement Parameters + * @description Informal replacement parameters for the step. + */ + replacement_parameters?: (string | Record)[] | null; + /** + * Step Index + * @description The order index of the step. + */ + step_index: number; + /** + * Step Label + * @description The label of the step. + */ + step_label?: string | null; + /** + * Step Name + * @description The descriptive name of the module or step. + */ + step_name: string; + /** + * Step Type + * @description The type of the step. + */ + step_type: string; + /** + * Step Version + * @description The version of the step's module. + */ + step_version?: string | null; + /** + * Tool ID + * @description The unique name of the tool associated with this step. + */ + tool_id?: string | null; + /** + * Tool State + * @description The state of the tool associated with the step + */ + tool_state?: Record | string | null; + /** + * Tool Version + * @description The version of the tool associated with the step. + */ + tool_version?: string | null; + /** + * When + * @description The when expression for the step. + */ + when?: string | null; + /** + * Workflow Outputs + * @description Workflow outputs associated with this step. + */ + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + }; + /** WorkflowDictRunSummary */ + WorkflowDictRunSummary: { + /** + * Has Upgrade Messages + * @description Whether the workflow has upgrade messages. + */ + has_upgrade_messages: boolean; + /** + * History ID + * @description The encoded ID of the history associated with the workflow. + */ + history_id?: string | null; + /** + * ID + * @description The encoded ID of the stored workflow. + */ + id: string; + /** + * Name + * @description The name of the workflow. + */ + name: string; + /** + * Step Version Changes + * @description Version changes for the workflow steps. + */ + step_version_changes: (string | Record)[]; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: (components["schemas"]["WorkflowDictRunToolStep"] | components["schemas"]["WorkflowDictRunStep"])[]; + /** + * Version + * @description The version of the workflow represented by an incremental number. + */ + version: number; + /** + * Workflow Resource Parameters + * @description The resource parameters of the workflow. + */ + workflow_resource_parameters: Record | null; + }; + /** WorkflowDictRunToolStep */ + WorkflowDictRunToolStep: { + /** + * Action + * @description The action of the tool step. + */ + action: string; + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation?: string | null; + /** + * Citations + * @description The citations of the tool step. + */ + citations: boolean; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Creator + * @description The creator of the tool step. + */ + creator?: string | null; + /** + * Description + * @description The description of the tool step. + */ + description: string; + /** + * Display + * @description Indicates if the tool step should be displayed. + */ + display: boolean; + /** + * EDAM Operations + * @description The EDAM operations of the tool step. + */ + edam_operations: string[]; + /** + * EDAM Topics + * @description The EDAM topics of the tool step. + */ + edam_topics: string[]; + /** + * Enctype + * @description The enctype of the tool step. + */ + enctype: string; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * Form Style + * @description The form style of the tool step. + */ + form_style: string; + /** + * Help + * @description The help of the tool step. + */ + help: string; + /** + * Hidden + * @description The hidden status of the tool step. + */ + hidden: string; + /** + * History ID + * @description The ID of the history associated with the tool step. + */ + history_id: string; + /** + * ID + * @description The identifier of the tool step. + */ + id: string; + /** + * Inputs + * @description The inputs of the step. + */ + inputs: Record[]; + /** + * Is Workflow Compatible + * @description Indicates if the tool step is compatible with workflows. + */ + is_workflow_compatible: boolean; + /** + * Job ID + * @description The ID of the job associated with the tool step. + */ + job_id?: string | null; + /** + * Job Remap + * @description The remap of the job associated with the tool step. + */ + job_remap?: string | null; + /** + * Labels + * @description The labels of the tool step. + */ + labels: string[]; + /** + * License + * @description The license of the tool step. + */ + license?: string | null; + /** + * Link + * @description The link of the tool step. + */ + link?: string | null; + /** + * Message + * @description The message of the tool step. + */ + message: string; + /** + * Messages + * @description Upgrade messages for the step. + */ + messages?: string[] | null; + /** + * Method + * @description The method of the tool step. + */ + method: string; + /** + * Min Width + * @description The minimum width of the tool step. + */ + min_width?: unknown | null; + /** + * Model Class + * @description The model class of the tool step. * @constant * @enum {string} */ - model_class: "Visualization"; + model_class: "tool"; /** - * Plugin - * @description The plugin of this Visualization. + * Name + * @description The name of the tool step. */ - plugin?: components["schemas"]["VisualizationPluginResponse"] | null; + name: string; /** - * Revisions - * @description A list of encoded IDs of the revisions of this Visualization. + * Output Connections + * @description The output connections of the step. */ - revisions: string[]; + output_connections: Record[]; /** - * Slug - * @description The slug of the visualization. + * Outputs + * @description The outputs of the step. */ - slug?: string | null; + outputs: components["schemas"]["RunStepToolOutput"][]; /** - * Tags - * @description A list of tags to add to this item. + * Panel Section ID + * @description The panel section ID of the tool step. */ - tags?: components["schemas"]["TagCollection"] | null; + panel_section_id: string; /** - * Title - * @description The name of the visualization. + * Panel Section Name + * @description The panel section name of the tool step. */ - title: string; + panel_section_name: string; /** - * Type - * @description The type of the visualization. + * Position + * @description Layout position of this step in the graph */ - type: string; + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; /** - * URL - * @description The URL of the visualization. + * Post Job Actions + * @description Set of actions that will be run when the job finishes. */ - url: string; + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; /** - * User ID - * @description The ID of the user owning this Visualization. - * @example 0123456789ABCDEF + * Replacement Parameters + * @description Informal replacement parameters for the step. */ - user_id: string; + replacement_parameters?: (string | Record)[] | null; /** - * Username - * @description The name of the user owning this Visualization. + * Requirements + * @description The requirements of the tool step. */ - username: string; - }; - /** VisualizationSummary */ - VisualizationSummary: { + requirements: string[]; /** - * Annotation - * @description The annotation of this Visualization. + * Sharable URL + * @description The sharable URL of the tool step. */ - annotation?: string | null; + sharable_url?: string | null; /** - * Create Time - * @description The time and date this item was created. + * State Inputs + * @description The state inputs of the tool step. */ - create_time: string | null; + state_inputs: Record; /** - * DbKey - * @description The database key of the visualization. + * Step Index + * @description The order index of the step. */ - dbkey?: string | null; + step_index: number; /** - * Deleted - * @description Whether this Visualization has been deleted. + * Step Label + * @description The label of the step. */ - deleted: boolean; + step_label?: string | null; /** - * ID - * @description Encoded ID of the Visualization. - * @example 0123456789ABCDEF + * Step Name + * @description The descriptive name of the module or step. */ - id: string; + step_name: string; /** - * Importable - * @description Whether this Visualization can be imported. + * Step Type + * @description The type of the step. */ - importable: boolean; + step_type: string; /** - * Published - * @description Whether this Visualization has been published. + * Step Version + * @description The version of the step's module. */ - published: boolean; + step_version?: string | null; /** - * Tags - * @description A list of tags to add to this item. + * Target + * @description The target of the tool step. */ - tags: components["schemas"]["TagCollection"] | null; + target?: unknown | null; /** - * Title - * @description The name of the visualization. + * Tool Errors + * @description An message indicating possible errors in the tool step. */ - title: string; + tool_errors?: string | null; /** - * Type - * @description The type of the visualization. + * Tool ID + * @description The unique name of the tool associated with this step. */ - type: string; + tool_id: string; /** - * Update Time - * @description The last time and date this item was updated. + * Tool Shed Repository + * @description Information about the tool shed repository associated with the tool. */ - update_time: string | null; + tool_shed_repository?: components["schemas"]["ToolShedRepositorySummary"] | null; /** - * Username - * @description The name of the user owning this Visualization. + * Tool State + * @description The state of the tool associated with the step */ - username: string; - } & { - [key: string]: unknown; - }; - /** - * VisualizationSummaryList - * @default [] - */ - VisualizationSummaryList: components["schemas"]["VisualizationSummary"][]; - /** VisualizationUpdatePayload */ - VisualizationUpdatePayload: { + tool_state?: Record | string | null; /** - * Config - * @description The config of the visualization. - * @default {} + * Tool Version + * @description The version of the tool associated with the step. */ - config: Record | string | null; + tool_version?: string | null; /** - * DbKey - * @description The database key of the visualization. + * Version + * @description The version of the tool step. */ - dbkey?: string | null; + version: string; /** - * Deleted - * @description Whether this Visualization has been deleted. - * @default false + * Versions + * @description The versions of the tool step. */ - deleted: boolean | null; + versions: string[]; /** - * Title - * @description The name of the visualization. + * Warnings + * @description The warnings of the tool step. */ - title?: string | null; - }; - /** VisualizationUpdateResponse */ - VisualizationUpdateResponse: { + warnings?: string | null; /** - * ID - * @description Encoded ID of the Visualization. - * @example 0123456789ABCDEF + * When + * @description The when expression for the step. */ - id: string; + when?: string | null; /** - * Revision - * @description Encoded ID of the Visualization Revision. - * @example 0123456789ABCDEF + * Workflow Outputs + * @description Workflow outputs associated with this step. */ - revision: string; + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + /** + * XRefs + * @description The cross-references of the tool step. + */ + xrefs: string[]; }; /** WorkflowInput */ WorkflowInput: { @@ -17196,10 +18693,7 @@ export interface components { * @description Universal unique identifier of the input. */ uuid: string | null; - /** - * Value - * @description TODO - */ + /** Value */ value: unknown | null; }; /** WorkflowInvocationCollectionView */ @@ -17375,6 +18869,70 @@ export interface components { [key: string]: number; }; }; + /** WorkflowOutput */ + WorkflowOutput: { + /** + * Label + * @description Label of the output. + */ + label?: string | null; + /** + * Output Name + * @description The name of the step output. + */ + output_name: string; + /** + * UUID + * @description Universal unique identifier of the output. + */ + uuid?: string | null; + }; + /** + * WorkflowStepLayoutPosition + * @description Position and dimensions of the workflow step represented by a box on the graph. + */ + WorkflowStepLayoutPosition: { + /** + * Bottom + * @description Position of the bottom of the box. + */ + bottom?: number | null; + /** + * Height + * @description Height of the box. + */ + height?: number | null; + /** + * Left + * @description Left margin or left-most position of the box. + */ + left: number; + /** + * Right + * @description Right margin or right-most position of the box. + */ + right?: number | null; + /** + * Top + * @description Position of the top of the box. + */ + top: number; + /** + * Width + * @description Width of the box. + */ + width?: number | null; + /** + * X + * @description Horizontal coordinate of the top right corner of the box. + */ + x?: number | null; + /** + * Y + * @description Vertical coordinate of the top right corner of the box. + */ + y?: number | null; + }; /** WriteInvocationStoreToPayload */ WriteInvocationStoreToPayload: { /** @@ -33204,39 +34762,74 @@ export interface operations { }; }; workflow_dict_api_workflows_download__workflow_id__get: { - /** Returns a selected workflow. */ parameters: { - /** @description The history id to import a workflow from. */ - /** @description The default is 'export', which is the meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are more tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download. */ - /** @description The format to download the workflow in. */ - /** @description The version of the workflow to fetch. */ query?: { + /** @description The history id to import a workflow from. */ history_id?: string | null; - style?: string | null; + /** @description The default is 'export', which is meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download. */ + style?: + | ( + | "export" + | "format2" + | "editor" + | "legacy" + | "instance" + | "run" + | "preview" + | "format2_wrapped_yaml" + | "ga" + ) + | null; + /** @description The format to download the workflow in. */ format?: string | null; + /** @description The version of the workflow to fetch. */ version?: number | null; instance?: boolean | null; }; - /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ header?: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ "run-as"?: string | null; }; - /** @description The encoded database identifier of the Stored Workflow. */ path: { + /** @description The encoded database identifier of the Stored Workflow. */ workflow_id: string; }; + cookie?: never; }; + requestBody?: never; responses: { /** @description Successful Response */ 200: { + headers: { + [name: string]: unknown; + }; content: { - "application/json": Record; + "application/json": + | components["schemas"]["WorkflowDictEditorSummary"] + | components["schemas"]["StoredWorkflowDetailed"] + | components["schemas"]["WorkflowDictRunSummary"] + | components["schemas"]["WorkflowDictPreviewSummary"] + | components["schemas"]["WorkflowDictFormat2Summary"] + | components["schemas"]["WorkflowDictExportSummary"] + | components["schemas"]["WorkflowDictFormat2WrappedYamlSummary"]; + }; + }; + /** @description Request Error */ + "4XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; }; }; - /** @description Validation Error */ - 422: { + /** @description Server Error */ + "5XX": { + headers: { + [name: string]: unknown; + }; content: { - "application/json": components["schemas"]["HTTPValidationError"]; + "application/json": components["schemas"]["MessageExceptionModel"]; }; }; }; @@ -33291,6 +34884,51 @@ export interface operations { }; }; }; + set_workflow_menu_api_workflows_menu_put: { + parameters: { + query?: never; + header?: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + "run-as"?: string | null; + }; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": components["schemas"]["SetWorkflowMenuPayload"] | null; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SetWorkflowMenuSummary"]; + }; + }; + /** @description Request Error */ + "4XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; + }; + }; + /** @description Server Error */ + "5XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; + }; + }; + }; + }; show_workflow_api_workflows__workflow_id__get: { parameters: { query?: { @@ -33477,39 +35115,74 @@ export interface operations { }; }; workflow_dict_api_workflows__workflow_id__download_get: { - /** Returns a selected workflow. */ parameters: { - /** @description The history id to import a workflow from. */ - /** @description The default is 'export', which is the meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are more tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download. */ - /** @description The format to download the workflow in. */ - /** @description The version of the workflow to fetch. */ query?: { + /** @description The history id to import a workflow from. */ history_id?: string | null; - style?: string | null; + /** @description The default is 'export', which is meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download. */ + style?: + | ( + | "export" + | "format2" + | "editor" + | "legacy" + | "instance" + | "run" + | "preview" + | "format2_wrapped_yaml" + | "ga" + ) + | null; + /** @description The format to download the workflow in. */ format?: string | null; + /** @description The version of the workflow to fetch. */ version?: number | null; instance?: boolean | null; }; - /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ header?: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ "run-as"?: string | null; }; - /** @description The encoded database identifier of the Stored Workflow. */ path: { + /** @description The encoded database identifier of the Stored Workflow. */ workflow_id: string; }; + cookie?: never; }; + requestBody?: never; responses: { /** @description Successful Response */ 200: { + headers: { + [name: string]: unknown; + }; content: { - "application/json": Record; + "application/json": + | components["schemas"]["WorkflowDictEditorSummary"] + | components["schemas"]["StoredWorkflowDetailed"] + | components["schemas"]["WorkflowDictRunSummary"] + | components["schemas"]["WorkflowDictPreviewSummary"] + | components["schemas"]["WorkflowDictFormat2Summary"] + | components["schemas"]["WorkflowDictExportSummary"] + | components["schemas"]["WorkflowDictFormat2WrappedYamlSummary"]; + }; + }; + /** @description Request Error */ + "4XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; }; }; - /** @description Validation Error */ - 422: { + /** @description Server Error */ + "5XX": { + headers: { + [name: string]: unknown; + }; content: { - "application/json": components["schemas"]["HTTPValidationError"]; + "application/json": components["schemas"]["MessageExceptionModel"]; }; }; };