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.
This commit is contained in:
Dannon Baker
2026-05-02 19:12:18 -04:00
parent efbf5e1629
commit 2cb7189482
5 changed files with 15 additions and 19 deletions
+2 -2
View File
@@ -30,12 +30,12 @@ from galaxy.schema.invocation import InvocationSerializationParams
from galaxy.schema.schema import (
CreateHistoryPayload,
DatasetSourceType,
InvocationIndexPayload,
WorkflowIndexPayload,
)
from galaxy.schema.workflows import InvokeWorkflowPayload
from galaxy.structured_app import MinimalManagerApp
from galaxy.tool_util_models.dynamic_tool_models import DynamicUnprivilegedToolCreatePayload
from galaxy.webapps.galaxy.services.invocations import InvocationIndexPayload
from galaxy.webapps.galaxy.services.workflows import WorkflowIndexPayload
log = logging.getLogger(__name__)
+8
View File
@@ -1637,6 +1637,10 @@ class WorkflowIndexQueryPayload(Model):
skip_step_counts: bool = False
class WorkflowIndexPayload(WorkflowIndexQueryPayload):
missing_tools: bool = False
class JobIndexSortByEnum(str, Enum):
create_time = "create_time"
update_time = "update_time"
@@ -1689,6 +1693,10 @@ class InvocationIndexQueryPayload(Model):
include_nested_invocations: bool = True
class InvocationIndexPayload(InvocationIndexQueryPayload):
instance: bool = Field(default=False, description="Is provided workflow id for Workflow instead of StoredWorkflow?")
PageSortByEnum = Literal["create_time", "title", "update_time", "username"]
+3 -5
View File
@@ -73,12 +73,14 @@ from galaxy.schema.schema import (
AsyncTaskResultSummary,
ClaimLandingPayload,
CreateWorkflowLandingRequestPayload,
InvocationIndexPayload,
InvocationSortByEnum,
InvocationsStateCounts,
SetSlugPayload,
ShareWithPayload,
ShareWithStatus,
SharingStatus,
WorkflowIndexPayload,
WorkflowJobMetric,
WorkflowLandingRequest,
WorkflowSortByEnum,
@@ -120,15 +122,11 @@ from galaxy.webapps.galaxy.services.base import (
ServesExportStores,
)
from galaxy.webapps.galaxy.services.invocations import (
InvocationIndexPayload,
InvocationsService,
PrepareStoreDownloadPayload,
WriteInvocationStoreToPayload,
)
from galaxy.webapps.galaxy.services.workflows import (
WorkflowIndexPayload,
WorkflowsService,
)
from galaxy.webapps.galaxy.services.workflows import WorkflowsService
from galaxy.workflow.extract import extract_workflow
from galaxy.workflow.modules import module_factory
@@ -4,8 +4,6 @@ from typing import (
Any,
)
from pydantic import Field
from galaxy.celery.helpers import async_task_summary
from galaxy.celery.tasks import (
prepare_invocation_download,
@@ -51,7 +49,7 @@ from galaxy.schema.schema import (
AsyncTaskResultSummary,
BcoGenerationParametersMixin,
ExportObjectType,
InvocationIndexQueryPayload,
InvocationIndexPayload,
StoreExportPayload,
WriteStoreToPayload,
)
@@ -71,10 +69,6 @@ from galaxy.webapps.galaxy.services.base import (
log = logging.getLogger(__name__)
class InvocationIndexPayload(InvocationIndexQueryPayload):
instance: bool = Field(default=False, description="Is provided workflow id for Workflow instead of StoredWorkflow?")
class PrepareStoreDownloadPayload(StoreExportPayload, BcoGenerationParametersMixin):
pass
@@ -29,7 +29,7 @@ from galaxy.schema.fields import DecodedDatabaseIdField
from galaxy.schema.invocation import WorkflowInvocationResponse
from galaxy.schema.schema import (
InvocationsStateCounts,
WorkflowIndexQueryPayload,
WorkflowIndexPayload,
)
from galaxy.schema.workflows import (
InvokeWorkflowPayload,
@@ -45,10 +45,6 @@ from galaxy.workflow.run_request import build_workflow_run_configs
log = logging.getLogger(__name__)
class WorkflowIndexPayload(WorkflowIndexQueryPayload):
missing_tools: bool = False
class WorkflowsService(ServiceBase):
def __init__(
self,