From 694ae09d12ee7a569eddb5fd1f104153f67b388a Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 12 Mar 2024 12:29:48 -0400 Subject: [PATCH] Assume invocation step state is not null. --- client/src/api/schema/schema.ts | 2 +- .../WorkflowInvocationState/InvocationJobsProgressBar.vue | 3 ++- .../InvocationStepsProgressBar.vue | 4 ++-- .../WorkflowInvocationState/WorkflowInvocationSummary.vue | 8 +++----- lib/galaxy/schema/invocation.py | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 44f5457df6bf..d5b19fd6cc31 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -7501,7 +7501,7 @@ export interface components { * State of the invocation step * @description Describes where in the scheduling process the workflow invocation step is. */ - state?: components["schemas"]["InvocationStepState"] | components["schemas"]["JobState"] | null; + state: components["schemas"]["InvocationStepState"] | components["schemas"]["JobState"]; /** Subworkflow Invocation Id */ subworkflow_invocation_id: string | null; /** diff --git a/client/src/components/WorkflowInvocationState/InvocationJobsProgressBar.vue b/client/src/components/WorkflowInvocationState/InvocationJobsProgressBar.vue index 9610656b71c6..82546ea39559 100644 --- a/client/src/components/WorkflowInvocationState/InvocationJobsProgressBar.vue +++ b/client/src/components/WorkflowInvocationState/InvocationJobsProgressBar.vue @@ -2,7 +2,6 @@ import { computed } from "vue"; import { InvocationJobsSummary } from "@/api/invocations"; -import ProgressBar from "@/components/ProgressBar.vue"; import { errorCount as jobStatesSummaryErrorCount, @@ -12,6 +11,8 @@ import { runningCount as jobStatesSummaryRunningCount, } from "./util"; +import ProgressBar from "@/components/ProgressBar.vue"; + interface Props { jobStatesSummary: InvocationJobsSummary; invocationSchedulingTerminal: boolean; diff --git a/client/src/components/WorkflowInvocationState/InvocationStepsProgressBar.vue b/client/src/components/WorkflowInvocationState/InvocationStepsProgressBar.vue index e7fe24d39fe6..f2ad0ba277b0 100644 --- a/client/src/components/WorkflowInvocationState/InvocationStepsProgressBar.vue +++ b/client/src/components/WorkflowInvocationState/InvocationStepsProgressBar.vue @@ -2,6 +2,7 @@ import { computed } from "vue"; import { InvocationStep, WorkflowInvocationElementView } from "@/api/invocations"; + import ProgressBar from "@/components/ProgressBar.vue"; interface Props { @@ -28,8 +29,7 @@ const stepStates = computed(() => { if (!step) { continue; } - // the API defined state here allowing null and undefined is odd... - const stepState: string = step.state || "unknown"; + const stepState: string = step.state; if (!stepStates[stepState]) { stepStates[stepState] = 1; } else { diff --git a/client/src/components/WorkflowInvocationState/WorkflowInvocationSummary.vue b/client/src/components/WorkflowInvocationState/WorkflowInvocationSummary.vue index 21bc1cbdcda7..35cb06d42214 100644 --- a/client/src/components/WorkflowInvocationState/WorkflowInvocationSummary.vue +++ b/client/src/components/WorkflowInvocationState/WorkflowInvocationSummary.vue @@ -5,13 +5,11 @@ import { InvocationJobsSummary, WorkflowInvocationElementView } from "@/api/invo import { runningCount as jobStatesSummaryRunningCount } from "./util"; -import LoadingSpan from "@/components/LoadingSpan.vue"; -import ProgressBar from "@/components/ProgressBar.vue"; - -import InvocationMessage from "./InvocationMessage.vue"; -import InvocationSummaryActionButtons from "./InvocationSummaryActionButtons.vue"; import InvocationJobsProgressBar from "./InvocationJobsProgressBar.vue"; +import InvocationMessage from "./InvocationMessage.vue"; import InvocationStepsProgressBar from "./InvocationStepsProgressBar.vue"; +import InvocationSummaryActionButtons from "./InvocationSummaryActionButtons.vue"; +import LoadingSpan from "@/components/LoadingSpan.vue"; interface Props { invocation: WorkflowInvocationElementView; diff --git a/lib/galaxy/schema/invocation.py b/lib/galaxy/schema/invocation.py index df81f450de32..2fecc1eb1dfb 100644 --- a/lib/galaxy/schema/invocation.py +++ b/lib/galaxy/schema/invocation.py @@ -371,8 +371,8 @@ class InvocationStep(Model, WithModelClass): ), ] ] - state: Optional[Union[InvocationStepState, JobState]] = Field( - default=None, + state: Union[InvocationStepState, JobState] = Field( + ..., title="State of the invocation step", description="Describes where in the scheduling process the workflow invocation step is.", )