Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Workflow API routes - Part 3 #17978

Draft
wants to merge 89 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
0601660
Add set_workflow_menu method to service layer of the Workflows API
heisner-tillman Feb 26, 2024
39f40a4
Create pydantic models for the set_workflow_menu operation of the Wor…
heisner-tillman Feb 26, 2024
51b3829
Refactor set_workflow_menu operation to FastAPI
heisner-tillman Feb 26, 2024
db06f25
Remove the mapping to the legacy route
heisner-tillman Feb 26, 2024
e02a6c0
Add TODO
heisner-tillman Feb 27, 2024
9137991
Type payload of set_workflow_menu operation properly
heisner-tillman Feb 27, 2024
e40f265
Mark HistoryId query param as invocation specific
heisner-tillman Feb 27, 2024
26a8394
Refactor workflow_dict operation to FastAPI
heisner-tillman Feb 28, 2024
f425223
Create service method for workflow_dict operation
heisner-tillman Feb 28, 2024
b5b84f8
Remove mapping to legacy routes
heisner-tillman Feb 28, 2024
e202eef
Regenerate the client schema
heisner-tillman Feb 28, 2024
0e77c3b
Remove unused internal method in legacy WorkflowsAPIController
heisner-tillman Feb 29, 2024
2c67981
Use the correct get_workflow method from WorkflowsManager
heisner-tillman Feb 29, 2024
6014151
Type yaml return of download_workflow method
heisner-tillman Feb 29, 2024
0474eef
Add pydantic models for return of workflow_dict operation
heisner-tillman Mar 3, 2024
8d400fa
Type return of download method
heisner-tillman Mar 3, 2024
183b27d
Add return model
heisner-tillman Mar 11, 2024
6325d20
Make label optional in steps model of editor and run workflowdictsummary
heisner-tillman Mar 11, 2024
fd4c5c4
Add step model for WorkflowDictExportSummary
heisner-tillman Mar 11, 2024
6e7c6dd
Change type of input_connections field in step model for WorkflowExpo…
heisner-tillman Mar 11, 2024
1db0e5d
Add pydantic model for workflowdict in format2 version
heisner-tillman Mar 13, 2024
e084b8e
Add pydantic models to return of workflow_dict operation
heisner-tillman Mar 13, 2024
37c8a9a
Add further typing to return of download_workflow method
heisner-tillman Mar 13, 2024
a08dee5
Regenerate the client schema
heisner-tillman Mar 13, 2024
41f9c3b
Properly type creator in pydantic models of workflowdict operation
heisner-tillman Mar 14, 2024
25d39c3
Add alias for format_version field in pydantic model of workflowdict …
heisner-tillman Mar 14, 2024
79ff465
Regenerate the client schema
heisner-tillman Mar 14, 2024
b15262e
Create base model for step models of WorkflowSummary models
heisner-tillman Mar 14, 2024
c22d285
Regenerate the client schema
heisner-tillman Mar 14, 2024
1ccf715
Create base model for step models of WorkflowSummary models
heisner-tillman Mar 15, 2024
71e9188
Regenerate the client schema
heisner-tillman Mar 15, 2024
8051440
Add annotation field to pydantic model of workflow_dict operation
heisner-tillman Mar 18, 2024
68048d9
Regenerate the client schema
heisner-tillman Mar 18, 2024
3b4f5ba
Fix typing of error field in base of step models of workflowdictsumma…
heisner-tillman Mar 20, 2024
b88dd00
Fix typing in WorkflowDictFormat2WrappedYamlSummary model
heisner-tillman Mar 20, 2024
56ed6dd
Add test for set_workflow_menu operation from WorfklowAPI
heisner-tillman Mar 21, 2024
01f9265
Refine descriptions in pydantic models for workflow_dict operation
heisner-tillman Mar 21, 2024
b2f68a1
Move old and unused WorkflowToExport model to workflow schema file
heisner-tillman Mar 21, 2024
f7eb565
Fix style error in test_set_workflow_menu
heisner-tillman Mar 21, 2024
1869a92
Regenerate the client schema
heisner-tillman Mar 21, 2024
abbf507
Add type to uuid field
heisner-tillman Mar 24, 2024
2086457
Move workflow specific model to the workflow schema file
heisner-tillman Mar 24, 2024
3eed847
Add typing to position field in base model of workflowdictsteps
heisner-tillman Mar 24, 2024
162503a
Add further typing to step models of workflowdict
heisner-tillman Mar 24, 2024
e11bc75
Allow float type for fields WorkflowStepLayoutPosition model
heisner-tillman Mar 27, 2024
dd97e03
Allow str as replacement_parameter in WorkflowDictRunSteps model
heisner-tillman Mar 27, 2024
fdd14c0
Allow str type for step_version_changes field in WorkflowDictRunSumma…
heisner-tillman Mar 28, 2024
79ddcfc
Move workflow specific models to the workflow schema file
heisner-tillman Mar 29, 2024
4efb80c
Refine tpying in pydantic models of workflow_dict operation
heisner-tillman Mar 29, 2024
2b9a93c
Type in_parameter field in WorkflowDictExportSteps with new model and…
heisner-tillman Apr 1, 2024
8d53fbb
Adjsut typing of field post_job_actions in model WorkflowDictStepsBase
heisner-tillman Apr 1, 2024
8da9592
Remove comments
heisner-tillman Apr 12, 2024
ec2da0f
Refine return models of the workflow_dict operation from the WorkflowAPI
heisner-tillman Apr 15, 2024
3621fcf
Remove comments
heisner-tillman Apr 15, 2024
51824e8
Refine return models of the workflow_dict operation from the WorkflowAPI
heisner-tillman Apr 16, 2024
d54d6c4
Refine return models of the workflow_dict operation from the Workflow…
heisner-tillman Apr 17, 2024
f5bc878
Remove comment
heisner-tillman Apr 17, 2024
bc3288d
Remove unused imports
heisner-tillman May 4, 2024
b576477
Apply suggested changes
heisner-tillman May 23, 2024
dcf005e
Remove the description from fields, where the description equals to TODO
heisner-tillman May 23, 2024
523ab4c
Limit type of field x and y fields in WorkflowStepLayoutPosition to i…
heisner-tillman May 23, 2024
22638ba
Regenerate the client schema
heisner-tillman Mar 20, 2024
4cac26e
Refactor the update operation
heisner-tillman Apr 12, 2024
78067bb
Add pydantic model for payload update operation
heisner-tillman Apr 12, 2024
469f21a
Remove the mapping to the legacy route
heisner-tillman Apr 12, 2024
3eab46f
Add method for update operation from Workflows API
heisner-tillman Apr 12, 2024
051de86
Add pydantic model for create operation
heisner-tillman Apr 12, 2024
a81a69d
Remove unused imports
heisner-tillman May 7, 2024
8e3d21b
Add pydantic model to return of update operation
heisner-tillman May 10, 2024
341ee15
Fix creating worfklow_dict in the service method of update operation
heisner-tillman May 10, 2024
577aa15
Add missing fields to payload of update operation
heisner-tillman May 10, 2024
e09ed1c
Change instance that will be passed to sa_session via add in service …
heisner-tillman May 11, 2024
c2c1522
Add json key word to tests
heisner-tillman May 14, 2024
6bd134c
Extend the payload model of the create oepration
heisner-tillman May 14, 2024
2b60170
Refactor the create operation and move several helper methods to the …
heisner-tillman May 14, 2024
ce1d00d
Add json keyword when posting to route 'workflows' in tests
heisner-tillman May 16, 2024
322d34c
Add more fields to field_validator that decodes json fields in payloa…
heisner-tillman May 25, 2024
3fb8457
Allow integer type for some id fields in payload model of create oper…
heisner-tillman May 26, 2024
51dc9a7
Add possibility to load app from trans in get_stored_workflow method
heisner-tillman May 26, 2024
0a0b709
Remove leftovers from debugging create method in workflow service layer
heisner-tillman May 26, 2024
5572717
Remove unused internal method of WorkflowAPIController
heisner-tillman May 26, 2024
f867f1a
Fix typing of id fields in payload of create opperation
heisner-tillman May 29, 2024
049f6ec
Fix typing of field upgrade_messages in one of the return models of t…
heisner-tillman May 29, 2024
27c533f
Fix typing of field upgrade_messages in return model of workflow_dict…
heisner-tillman May 29, 2024
2cf5bac
Reuse unused import
heisner-tillman Jun 2, 2024
0af6514
Add more fields to the payload of the create method
heisner-tillman Jun 2, 2024
01d9e3a
Add more fields to the payload of the create method
heisner-tillman Jun 2, 2024
1ed4648
Decode fields job_ids and from_history_id in payload model instead of…
heisner-tillman Jun 3, 2024
bdbc8f4
Regenerate the client schema
heisner-tillman Sep 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,969 changes: 1,873 additions & 96 deletions client/src/api/schema/schema.ts

Large diffs are not rendered by default.

229 changes: 0 additions & 229 deletions lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
BeforeValidator,
ConfigDict,
Field,
Json,
model_validator,
RootModel,
UUID4,
Expand Down Expand Up @@ -2277,42 +2276,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(
...,
Expand Down Expand Up @@ -2451,201 +2414,9 @@ 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]]


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(
...,
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 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."
)


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")]
Expand Down
Loading
Loading