diff --git a/lib/galaxy/schema/invocation.py b/lib/galaxy/schema/invocation.py index 55c083edcbd6..c68556242135 100644 --- a/lib/galaxy/schema/invocation.py +++ b/lib/galaxy/schema/invocation.py @@ -343,21 +343,34 @@ class InvocationStep(Model, WithModelClass): model_class: INVOCATION_STEP_MODEL_CLASS = ModelClassField(INVOCATION_STEP_MODEL_CLASS) id: Annotated[EncodedDatabaseIdField, Field(..., title="Invocation Step ID")] update_time: Optional[datetime] = schema.UpdateTimeField - job_id: Optional[EncodedDatabaseIdField] = Field( - default=None, - title="Job ID", - description="The encoded ID of the job associated with this workflow invocation step.", - ) - workflow_step_id: EncodedDatabaseIdField = Field( - ..., - title="Workflow step ID", - description="The encoded ID of the workflow step associated with this workflow invocation step.", - ) - subworkflow_invocation_id: Optional[EncodedDatabaseIdField] = Field( - default=None, - title="Subworkflow invocation ID", - description="The encoded ID of the subworkflow invocation.", - ) + job_id: Optional[ + Annotated[ + EncodedDatabaseIdField, + Field( + default=None, + title="Job ID", + description="The encoded ID of the job associated with this workflow invocation step.", + ), + ] + ] + workflow_step_id: Annotated[ + EncodedDatabaseIdField, + Field( + ..., + title="Workflow step ID", + description="The encoded ID of the workflow step associated with this workflow invocation step.", + ), + ] + subworkflow_invocation_id: Optional[ + Annotated[ + EncodedDatabaseIdField, + Field( + default=None, + title="Subworkflow invocation ID", + description="The encoded ID of the subworkflow invocation.", + ), + ] + ] state: Optional[Union[InvocationStepState, JobState]] = Field( default=None, title="State of the invocation step", diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 7e59383d133a..876576ba6681 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -1429,18 +1429,14 @@ class InvocationSortByEnum(str, Enum): class InvocationIndexQueryPayload(Model): - workflow_id: Optional[DecodedDatabaseIdField] = Field( + workflow_id: Optional[int] = Field( None, title="Workflow ID", description="Return only invocations for this Workflow ID" ) - history_id: Optional[DecodedDatabaseIdField] = Field( + history_id: Optional[int] = Field( None, title="History ID", description="Return only invocations for this History ID" ) - job_id: Optional[DecodedDatabaseIdField] = Field( - None, title="Job ID", description="Return only invocations for this Job ID" - ) - user_id: Optional[DecodedDatabaseIdField] = Field( - None, title="User ID", description="Return invocations for this User ID" - ) + job_id: Optional[int] = Field(None, title="Job ID", description="Return only invocations for this Job ID") + user_id: Optional[int] = Field(None, title="User ID", description="Return invocations for this User ID") sort_by: Optional[InvocationSortByEnum] = Field( None, title="Sort By", description="Sort Workflow Invocations by this attribute" ) diff --git a/lib/galaxy/webapps/galaxy/api/common.py b/lib/galaxy/webapps/galaxy/api/common.py index 952d1bbf5975..f4f38ed0a20d 100644 --- a/lib/galaxy/webapps/galaxy/api/common.py +++ b/lib/galaxy/webapps/galaxy/api/common.py @@ -153,7 +153,7 @@ def parse_serialization_params( def query_serialization_params( - view: Annotated[Optional[str], SerializationViewQueryParam] = None, + view: SerializationViewQueryParam = None, keys: Optional[str] = SerializationKeysQueryParam, ) -> SerializationParams: return parse_serialization_params(view=view, keys=keys) diff --git a/lib/galaxy/webapps/galaxy/api/configuration.py b/lib/galaxy/webapps/galaxy/api/configuration.py index 7e6006b97bed..7450103197dc 100644 --- a/lib/galaxy/webapps/galaxy/api/configuration.py +++ b/lib/galaxy/webapps/galaxy/api/configuration.py @@ -11,7 +11,6 @@ ) from fastapi import Path -from typing_extensions import Annotated from galaxy.managers.configuration import ConfigurationManager from galaxy.managers.context import ProvidesUserContext @@ -61,7 +60,7 @@ def whoami(self, trans: ProvidesUserContext = DependsOnTrans) -> Optional[UserMo def index( self, trans: ProvidesUserContext = DependsOnTrans, - view: Annotated[Optional[str], SerializationViewQueryParam] = None, + view: SerializationViewQueryParam = None, keys: Optional[str] = SerializationKeysQueryParam, ) -> Dict[str, Any]: """ diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 5e969e0f19b2..3422bd3d5076 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -56,7 +56,6 @@ InvocationMessageResponseModel, InvocationReport, InvocationSerializationParams, - InvocationSerializationView, InvocationStep, InvocationStepJobsResponseCollectionJobsModel, InvocationStepJobsResponseJobModel, @@ -1122,8 +1121,8 @@ def undelete_workflow( ) def show_versions( self, + workflow_id: StoredWorkflowIDPathParam, trans: ProvidesUserContext = DependsOnTrans, - workflow_id: DecodedDatabaseIdField = StoredWorkflowIDPathParam, instance: Annotated[Optional[bool], InstanceQueryParam] = False, ): return self.service.get_versions(trans, workflow_id, instance) @@ -1278,7 +1277,7 @@ class FastAPIInvocations: ) def create_invocations_from_store( self, - payload: Annotated[CreateInvocationsFromStorePayload, CreateInvocationsFromStoreBody], + payload: CreateInvocationsFromStoreBody, trans: ProvidesHistoryContext = DependsOnTrans, ) -> List[WorkflowInvocationResponse]: """ @@ -1299,18 +1298,18 @@ def create_invocations_from_store( def index_invocations( self, response: Response, - workflow_id: Annotated[Optional[DecodedDatabaseIdField], WorkflowIdQueryParam] = None, - history_id: Annotated[Optional[DecodedDatabaseIdField], HistoryIdQueryParam] = None, - job_id: Annotated[Optional[DecodedDatabaseIdField], JobIdQueryParam] = None, - user_id: Annotated[Optional[DecodedDatabaseIdField], UserIdQueryParam] = None, - sort_by: Annotated[Optional[InvocationSortByEnum], InvocationsSortByQueryParam] = None, - sort_desc: Annotated[Optional[bool], InvocationsSortDescQueryParam] = False, - include_terminal: Annotated[Optional[bool], InvocationsIncludeTerminalQueryParam] = True, - limit: Annotated[Optional[int], InvocationsLimitQueryParam] = None, - offset: Annotated[Optional[int], InvocationsOffsetQueryParam] = None, - instance: Annotated[Optional[bool], InvocationsInstanceQueryParam] = False, - view: Annotated[Optional[InvocationSerializationView], SerializationViewQueryParam] = None, - step_details: Annotated[Optional[bool], StepDetailQueryParam] = False, + workflow_id: WorkflowIdQueryParam = None, + history_id: HistoryIdQueryParam = None, + job_id: JobIdQueryParam = None, + user_id: UserIdQueryParam = None, + sort_by: InvocationsSortByQueryParam = None, + sort_desc: InvocationsSortDescQueryParam = False, + include_terminal: InvocationsIncludeTerminalQueryParam = True, + limit: InvocationsLimitQueryParam = None, + offset: InvocationsOffsetQueryParam = None, + instance: InvocationsInstanceQueryParam = False, + view: SerializationViewQueryParam = None, + step_details: StepDetailQueryParam = False, trans: ProvidesUserContext = DependsOnTrans, ) -> List[WorkflowInvocationResponse]: """If workflow_id is supplied (either via URL or query parameter) it should be an @@ -1322,6 +1321,10 @@ def index_invocations( :raises: exceptions.MessageException, exceptions.ObjectNotFound """ invocation_payload = InvocationIndexPayload( + workflow_id=workflow_id, + history_id=history_id, + job_id=job_id, + user_id=user_id, sort_by=sort_by, sort_desc=sort_desc, include_terminal=include_terminal, @@ -1329,10 +1332,6 @@ def index_invocations( offset=offset, instance=instance, ) - invocation_payload.workflow_id = workflow_id - invocation_payload.history_id = history_id - invocation_payload.job_id = job_id - invocation_payload.user_id = user_id serialization_params = InvocationSerializationParams( view=view, step_details=step_details, @@ -1349,18 +1348,18 @@ def index_invocations( def index_workflow_invocations( self, response: Response, - workflow_id: Annotated[DecodedDatabaseIdField, StoredWorkflowIDPathParam], - history_id: Annotated[Optional[DecodedDatabaseIdField], HistoryIdQueryParam] = None, - job_id: Annotated[Optional[DecodedDatabaseIdField], JobIdQueryParam] = None, - user_id: Annotated[Optional[DecodedDatabaseIdField], UserIdQueryParam] = None, - sort_by: Annotated[Optional[InvocationSortByEnum], InvocationsSortByQueryParam] = None, - sort_desc: Annotated[Optional[bool], InvocationsSortDescQueryParam] = False, - include_terminal: Annotated[Optional[bool], InvocationsIncludeTerminalQueryParam] = True, - limit: Annotated[Optional[int], InvocationsLimitQueryParam] = None, - offset: Annotated[Optional[int], InvocationsOffsetQueryParam] = None, - instance: Annotated[Optional[bool], InvocationsInstanceQueryParam] = False, - view: Annotated[Optional[InvocationSerializationView], SerializationViewQueryParam] = None, - step_details: Annotated[Optional[bool], StepDetailQueryParam] = False, + workflow_id: StoredWorkflowIDPathParam, + history_id: HistoryIdQueryParam = None, + job_id: JobIdQueryParam = None, + user_id: UserIdQueryParam = None, + sort_by: InvocationsSortByQueryParam = None, + sort_desc: InvocationsSortDescQueryParam = False, + include_terminal: InvocationsIncludeTerminalQueryParam = True, + limit: InvocationsLimitQueryParam = None, + offset: InvocationsOffsetQueryParam = None, + instance: InvocationsInstanceQueryParam = False, + view: SerializationViewQueryParam = None, + step_details: StepDetailQueryParam = False, trans: ProvidesUserContext = DependsOnTrans, ) -> List[WorkflowInvocationResponse]: """An alias for GET '/api/invocations'"""