Skip to content

Commit 2cb7189

Browse files
committed
Move workflow/invocation index payloads into central schema
WorkflowIndexPayload and InvocationIndexPayload were defined in the webapps service layer, which forced operations.py (in galaxy-app) to reach across the package boundary into galaxy-webapps just to construct them. They're plain Pydantic models that extend a base already living in galaxy.schema.schema, so move them next to their parents. Services keep the same names via re-export so external consumers don't break, and operations.py can now import them at module level alongside the rest of the galaxy.schema imports.
1 parent efbf5e1 commit 2cb7189

5 files changed

Lines changed: 15 additions & 19 deletions

File tree

lib/galaxy/agents/operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
from galaxy.schema.schema import (
3131
CreateHistoryPayload,
3232
DatasetSourceType,
33+
InvocationIndexPayload,
34+
WorkflowIndexPayload,
3335
)
3436
from galaxy.schema.workflows import InvokeWorkflowPayload
3537
from galaxy.structured_app import MinimalManagerApp
3638
from galaxy.tool_util_models.dynamic_tool_models import DynamicUnprivilegedToolCreatePayload
37-
from galaxy.webapps.galaxy.services.invocations import InvocationIndexPayload
38-
from galaxy.webapps.galaxy.services.workflows import WorkflowIndexPayload
3939

4040
log = logging.getLogger(__name__)
4141

lib/galaxy/schema/schema.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,10 @@ class WorkflowIndexQueryPayload(Model):
16371637
skip_step_counts: bool = False
16381638

16391639

1640+
class WorkflowIndexPayload(WorkflowIndexQueryPayload):
1641+
missing_tools: bool = False
1642+
1643+
16401644
class JobIndexSortByEnum(str, Enum):
16411645
create_time = "create_time"
16421646
update_time = "update_time"
@@ -1689,6 +1693,10 @@ class InvocationIndexQueryPayload(Model):
16891693
include_nested_invocations: bool = True
16901694

16911695

1696+
class InvocationIndexPayload(InvocationIndexQueryPayload):
1697+
instance: bool = Field(default=False, description="Is provided workflow id for Workflow instead of StoredWorkflow?")
1698+
1699+
16921700
PageSortByEnum = Literal["create_time", "title", "update_time", "username"]
16931701

16941702

lib/galaxy/webapps/galaxy/api/workflows.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@
7373
AsyncTaskResultSummary,
7474
ClaimLandingPayload,
7575
CreateWorkflowLandingRequestPayload,
76+
InvocationIndexPayload,
7677
InvocationSortByEnum,
7778
InvocationsStateCounts,
7879
SetSlugPayload,
7980
ShareWithPayload,
8081
ShareWithStatus,
8182
SharingStatus,
83+
WorkflowIndexPayload,
8284
WorkflowJobMetric,
8385
WorkflowLandingRequest,
8486
WorkflowSortByEnum,
@@ -120,15 +122,11 @@
120122
ServesExportStores,
121123
)
122124
from galaxy.webapps.galaxy.services.invocations import (
123-
InvocationIndexPayload,
124125
InvocationsService,
125126
PrepareStoreDownloadPayload,
126127
WriteInvocationStoreToPayload,
127128
)
128-
from galaxy.webapps.galaxy.services.workflows import (
129-
WorkflowIndexPayload,
130-
WorkflowsService,
131-
)
129+
from galaxy.webapps.galaxy.services.workflows import WorkflowsService
132130
from galaxy.workflow.extract import extract_workflow
133131
from galaxy.workflow.modules import module_factory
134132

lib/galaxy/webapps/galaxy/services/invocations.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Any,
55
)
66

7-
from pydantic import Field
8-
97
from galaxy.celery.helpers import async_task_summary
108
from galaxy.celery.tasks import (
119
prepare_invocation_download,
@@ -51,7 +49,7 @@
5149
AsyncTaskResultSummary,
5250
BcoGenerationParametersMixin,
5351
ExportObjectType,
54-
InvocationIndexQueryPayload,
52+
InvocationIndexPayload,
5553
StoreExportPayload,
5654
WriteStoreToPayload,
5755
)
@@ -71,10 +69,6 @@
7169
log = logging.getLogger(__name__)
7270

7371

74-
class InvocationIndexPayload(InvocationIndexQueryPayload):
75-
instance: bool = Field(default=False, description="Is provided workflow id for Workflow instead of StoredWorkflow?")
76-
77-
7872
class PrepareStoreDownloadPayload(StoreExportPayload, BcoGenerationParametersMixin):
7973
pass
8074

lib/galaxy/webapps/galaxy/services/workflows.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from galaxy.schema.invocation import WorkflowInvocationResponse
3030
from galaxy.schema.schema import (
3131
InvocationsStateCounts,
32-
WorkflowIndexQueryPayload,
32+
WorkflowIndexPayload,
3333
)
3434
from galaxy.schema.workflows import (
3535
InvokeWorkflowPayload,
@@ -45,10 +45,6 @@
4545
log = logging.getLogger(__name__)
4646

4747

48-
class WorkflowIndexPayload(WorkflowIndexQueryPayload):
49-
missing_tools: bool = False
50-
51-
5248
class WorkflowsService(ServiceBase):
5349
def __init__(
5450
self,

0 commit comments

Comments
 (0)