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

Place invocation state in list #17708

Draft
wants to merge 14 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 19 additions & 10 deletions client/src/api/invocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import { ApiResponse, components, fetcher } from "./schema";

export type WorkflowInvocationElementView = components["schemas"]["WorkflowInvocationElementView"];
export type WorkflowInvocationCollectionView = components["schemas"]["WorkflowInvocationCollectionView"];
export type WorkflowInvocationStepStatesView = components["schemas"]["WorkflowInvocationStepStatesView"];
export type InvocationJobsSummary = components["schemas"]["InvocationJobsResponse"];
export type InvocationStep = components["schemas"]["InvocationStep"];

export const invocationsFetcher = fetcher.path("/api/invocations").method("get").create();
export const invocationFetcher = fetcher.path("/api/invocations/{invocation_id}").method("get").create();
export const jobsSummaryFetcher = fetcher.path("/api/invocations/{invocation_id}/jobs_summary").method("get").create();

export type WorkflowInvocation = WorkflowInvocationElementView | WorkflowInvocationCollectionView;

export interface WorkflowInvocationJobsSummary {
id: string;
}
export type WorkflowInvocation =
| WorkflowInvocationElementView
| WorkflowInvocationCollectionView
| WorkflowInvocationStepStatesView;

export interface WorkflowInvocationStep {
id: string;
Expand All @@ -32,19 +34,26 @@ export async function invocationForJob(params: { jobId: string }): Promise<Workf

// TODO: Replace these provisional functions with fetchers after https://github.com/galaxyproject/galaxy/pull/16707 is merged
export async function fetchInvocationDetails(params: { id: string }): Promise<ApiResponse<WorkflowInvocation>> {
const { data } = await axios.get(`${getAppRoot()}api/invocations/${params.id}`);
const { data } = await invocationFetcher({ invocation_id: params.id });
return {
data,
} as ApiResponse<WorkflowInvocation>;
}

export async function fetchInvocationJobsSummary(params: {
export async function fetchInvocationStepStateDetails(params: {
id: string;
}): Promise<ApiResponse<WorkflowInvocationJobsSummary>> {
const { data } = await axios.get(`${getAppRoot()}api/invocations/${params.id}/jobs_summary`);
}): Promise<ApiResponse<WorkflowInvocationStepStatesView>> {
const { data } = await invocationFetcher({ invocation_id: params.id, view: "step_states" });
return {
data,
} as ApiResponse<WorkflowInvocationStepStatesView>;
}

export async function fetchInvocationJobsSummary(params: { id: string }): Promise<ApiResponse<InvocationJobsSummary>> {
const { data } = await jobsSummaryFetcher({ invocation_id: params.id });
return {
data,
} as ApiResponse<WorkflowInvocationJobsSummary>;
} as ApiResponse<InvocationJobsSummary>;
}

export async function fetchInvocationStep(params: { id: string }): Promise<ApiResponse<WorkflowInvocationStep>> {
Expand Down
251 changes: 242 additions & 9 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7979,7 +7979,7 @@ export interface components {
* InvocationSerializationView
* @enum {string}
*/
InvocationSerializationView: "element" | "collection";
InvocationSerializationView: "element" | "collection" | "step_states";
/**
* InvocationSortByEnum
* @enum {string}
Expand All @@ -7990,10 +7990,7 @@ export interface components {
* @enum {string}
*/
InvocationState: "new" | "ready" | "scheduled" | "cancelled" | "cancelling" | "failed";
/**
* InvocationStep
* @description Information about workflow invocation step
*/
/** InvocationStep */
InvocationStep: {
/**
* Action
Expand All @@ -8005,8 +8002,6 @@ export interface components {
* @example 0123456789ABCDEF
*/
id: string;
/** Job Id */
job_id: string | null;
/**
* Jobs
* @description Jobs associated with the workflow invocation step.
Expand Down Expand Up @@ -8045,7 +8040,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"];
/** Subworkflow Invocation Id */
subworkflow_invocation_id: string | null;
/**
Expand Down Expand Up @@ -8916,6 +8911,82 @@ export interface components {
*/
value: string;
};
/** LegacyInvocationStep */
LegacyInvocationStep: {
/**
* Action
* @description Whether to take action on the invocation step.
*/
action: boolean | null;
/**
* Invocation Step ID
* @example 0123456789ABCDEF
*/
id: string;
/** Job Id */
job_id: string | null;
/**
* Jobs
* @description Jobs associated with the workflow invocation step.
* @default []
*/
jobs?: components["schemas"]["JobBaseModel"][];
/**
* Model class
* @description The name of the database model class.
* @constant
*/
model_class: "WorkflowInvocationStep";
/**
* Order index
* @description The index of the workflow step in the workflow.
*/
order_index: number;
/**
* Output collections
* @description The dataset collection outputs of the workflow invocation step.
* @default {}
*/
output_collections?: {
[key: string]: components["schemas"]["InvocationStepCollectionOutput"] | undefined;
};
/**
* Outputs
* @description The outputs of the workflow invocation step.
* @default {}
*/
outputs?: {
[key: string]: components["schemas"]["InvocationStepOutput"] | undefined;
};
/**
* State of the invocation step
* @description Describes the job state corresponding to this invocation step.
*/
state: components["schemas"]["JobState"] | null;
/** Subworkflow Invocation Id */
subworkflow_invocation_id: string | null;
/**
* Update Time
* @description The last time and date this item was updated.
*/
update_time: string | null;
/**
* Workflow step ID
* @description The encoded ID of the workflow step associated with this workflow invocation step.
* @example 0123456789ABCDEF
*/
workflow_step_id: string;
/**
* Step label
* @description The label of the workflow step
*/
workflow_step_label?: string | null;
/**
* UUID
* @description Universal unique identifier of the workflow step.
*/
workflow_step_uuid?: string | null;
};
/** LegacyLibraryPermissionsPayload */
LegacyLibraryPermissionsPayload: {
/**
Expand Down Expand Up @@ -8943,6 +9014,110 @@ export interface components {
*/
LIBRARY_MODIFY_in?: string[] | string | null;
};
/** LegacyWorkflowInvocationElementView */
LegacyWorkflowInvocationElementView: {
/**
* Create Time
* Format: date-time
* @description The time and date this item was created.
*/
create_time: string;
/**
* History ID
* @description The encoded ID of the history associated with the invocation.
* @example 0123456789ABCDEF
*/
history_id: string;
/**
* ID
* @description The encoded ID of the workflow invocation.
* @example 0123456789ABCDEF
*/
id: string;
/**
* Input step parameters
* @description Input step parameters of the workflow invocation.
*/
input_step_parameters: {
[key: string]: components["schemas"]["InvocationInputParameter"] | undefined;
};
/**
* Inputs
* @description Input datasets/dataset collections of the workflow invocation.
*/
inputs: {
[key: string]: components["schemas"]["InvocationInput"] | undefined;
};
/**
* Messages
* @description A list of messages about why the invocation did not succeed.
*/
messages: (
| components["schemas"]["InvocationCancellationReviewFailedResponse"]
| components["schemas"]["InvocationCancellationHistoryDeletedResponse"]
| components["schemas"]["InvocationCancellationUserRequestResponse"]
| components["schemas"]["InvocationFailureDatasetFailedResponse"]
| components["schemas"]["InvocationFailureCollectionFailedResponse"]
| components["schemas"]["InvocationFailureJobFailedResponse"]
| components["schemas"]["InvocationFailureOutputNotFoundResponse"]
| components["schemas"]["InvocationFailureExpressionEvaluationFailedResponse"]
| components["schemas"]["InvocationFailureWhenNotBooleanResponse"]
| components["schemas"]["InvocationUnexpectedFailureResponse"]
| components["schemas"]["InvocationEvaluationWarningWorkflowOutputNotFoundResponse"]
)[];
/**
* Model class
* @description The name of the database model class.
* @constant
*/
model_class: "WorkflowInvocation";
/**
* Output collections
* @description Output dataset collections of the workflow invocation.
*/
output_collections: {
[key: string]: components["schemas"]["InvocationOutputCollection"] | undefined;
};
/**
* Output values
* @description Output values of the workflow invocation.
*/
output_values: Record<string, never>;
/**
* Outputs
* @description Output datasets of the workflow invocation.
*/
outputs: {
[key: string]: components["schemas"]["InvocationOutput"] | undefined;
};
/**
* Invocation state
* @description State of workflow invocation.
*/
state: components["schemas"]["InvocationState"];
/**
* Steps
* @description Steps of the workflow invocation (legacy view using job state).
*/
steps: components["schemas"]["LegacyInvocationStep"][];
/**
* Update Time
* Format: date-time
* @description The last time and date this item was updated.
*/
update_time: string;
/**
* UUID
* @description Universal unique identifier of the workflow invocation.
*/
uuid?: string | string | null;
/**
* Workflow ID
* @description The encoded Workflow ID associated with the invocation.
* @example 0123456789ABCDEF
*/
workflow_id: string;
};
/** LibraryAvailablePermissions */
LibraryAvailablePermissions: {
/**
Expand Down Expand Up @@ -12911,7 +13086,9 @@ export interface components {
/** WorkflowInvocationResponse */
WorkflowInvocationResponse:
| components["schemas"]["WorkflowInvocationElementView"]
| components["schemas"]["WorkflowInvocationCollectionView"];
| components["schemas"]["LegacyWorkflowInvocationElementView"]
| components["schemas"]["WorkflowInvocationCollectionView"]
| components["schemas"]["WorkflowInvocationStepStatesView"];
/** WorkflowInvocationStateSummary */
WorkflowInvocationStateSummary: {
/**
Expand Down Expand Up @@ -12940,6 +13117,60 @@ export interface components {
[key: string]: number | undefined;
};
};
/** WorkflowInvocationStepStatesView */
WorkflowInvocationStepStatesView: {
/**
* Create Time
* Format: date-time
* @description The time and date this item was created.
*/
create_time: string;
/**
* History ID
* @description The encoded ID of the history associated with the invocation.
* @example 0123456789ABCDEF
*/
history_id: string;
/**
* ID
* @description The encoded ID of the workflow invocation.
* @example 0123456789ABCDEF
*/
id: string;
/**
* Model class
* @description The name of the database model class.
* @constant
*/
model_class: "WorkflowInvocation";
/**
* Invocation state
* @description State of workflow invocation.
*/
state: components["schemas"]["InvocationState"];
/**
* Steps
* @description Steps of the workflow invocation.
*/
steps: components["schemas"]["InvocationStep"][];
/**
* Update Time
* Format: date-time
* @description The last time and date this item was updated.
*/
update_time: string;
/**
* UUID
* @description Universal unique identifier of the workflow invocation.
*/
uuid?: string | string | null;
/**
* Workflow ID
* @description The encoded Workflow ID associated with the invocation.
* @example 0123456789ABCDEF
*/
workflow_id: string;
};
/** WriteInvocationStoreToPayload */
WriteInvocationStoreToPayload: {
/**
Expand Down Expand Up @@ -18711,6 +18942,7 @@ export interface operations {
show_invocation_api_invocations__invocation_id__get: {
/** Get detailed description of a workflow invocation. */
parameters: {
/** @description View to be passed to the serializer */
/** @description Include details for individual invocation steps and populate a steps attribute in the resulting dictionary. */
/**
* @description Populate the invocation step state with the job state instead of the invocation step state.
Expand All @@ -18719,6 +18951,7 @@ export interface operations {
* are not the mapped over step outputs but the individual job outputs.
*/
query?: {
view?: string | null;
step_details?: boolean;
legacy_job_state?: boolean;
};
Expand Down
Loading
Loading