Skip to content

Commit

Permalink
🐛 Update task terminal state check to include "SucceededWithErrors" (k…
Browse files Browse the repository at this point in the history
…onveyor#2018)

Resolves: konveyor#2017

The check used to only allow starting an analysis if an application's
analysis task is still running (i.e. not in a terminal state) needs to also
consider the frontend synthetic state `SucceededWithErrors` as a 
non-running / terminal state.

Signed-off-by: Scott J Dickerson <[email protected]>
  • Loading branch information
sjd78 authored Jul 17, 2024
1 parent 4182243 commit 2ee9fe9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import {
useFetchApplications,
} from "@app/queries/applications";
import {
TaskStates,
useCancelTaskMutation,
useFetchTaskDashboard,
} from "@app/queries/tasks";
Expand Down Expand Up @@ -609,12 +610,10 @@ export const ApplicationsTable: React.FC = () => {
.flatMap((app) => app.tasks.currentAnalyzer)
.filter(Boolean);

const terminalStates = ["Succeeded", "Failed", "Canceled", ""];

return (
currentAnalyzerTasksForSelected.length === 0 ||
currentAnalyzerTasksForSelected.every(({ state }) =>
terminalStates.includes(state ?? "")
TaskStates.Terminal.includes(state ?? "")
)
);
};
Expand Down
1 change: 1 addition & 0 deletions client/src/app/queries/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const TaskStates = {
Running: ["Running"],
Success: ["Succeeded", "SucceededWithErrors"],
SuccessWithErrors: ["SucceededWithErrors"],
Terminal: ["Succeeded", "SucceededWithErrors", "Failed", "Canceled"],
};

export const TasksQueryKey = "tasks";
Expand Down

0 comments on commit 2ee9fe9

Please sign in to comment.