From b5ba3e3da8c97b048f497011d641a01f64f40f0c Mon Sep 17 00:00:00 2001 From: Sas Swart Date: Fri, 13 Dec 2024 11:58:19 +0200 Subject: [PATCH] fix(site): only show provisioner warnings for pending workspaces (#15858) When creating, starting, stopping or otherwise mutating a workspace, we used to erroneously and briefly display a provisioner health warning alert. This PR updates the component to only display this warning if the build is pending, not "starting" or any other state that means a provisioner has already acquired the job. --- site/src/pages/WorkspacePage/Workspace.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/site/src/pages/WorkspacePage/Workspace.tsx b/site/src/pages/WorkspacePage/Workspace.tsx index af4883e737..f28cb775bd 100644 --- a/site/src/pages/WorkspacePage/Workspace.tsx +++ b/site/src/pages/WorkspacePage/Workspace.tsx @@ -111,12 +111,13 @@ export const Workspace: FC = ({ ); const workspaceRunning = workspace.latest_build.status === "running"; + const workspacePending = workspace.latest_build.status === "pending"; const haveBuildLogs = (buildLogs ?? []).length > 0; + const shouldShowBuildLogs = haveBuildLogs && !workspaceRunning; const provisionersHealthy = - (workspace.latest_build.matched_provisioners?.available ?? 0) > 0; - const shouldDisplayBuildLogs = haveBuildLogs && !workspaceRunning; + (workspace.latest_build.matched_provisioners?.available ?? 1) > 0; const shouldShowProvisionerAlert = - !workspaceRunning && !haveBuildLogs && !provisionersHealthy; + workspacePending && !haveBuildLogs && !provisionersHealthy && !isRestarting; return (
= ({ /> )} - {shouldDisplayBuildLogs && ( + {shouldShowBuildLogs && ( )}