Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5ba3e3

Browse files
authored
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.
1 parent d35de45 commit b5ba3e3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

site/src/pages/WorkspacePage/Workspace.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,13 @@ export const Workspace: FC<WorkspaceProps> = ({
111111
);
112112

113113
const workspaceRunning = workspace.latest_build.status === "running";
114+
const workspacePending = workspace.latest_build.status === "pending";
114115
const haveBuildLogs = (buildLogs ?? []).length > 0;
116+
const shouldShowBuildLogs = haveBuildLogs && !workspaceRunning;
115117
const provisionersHealthy =
116-
(workspace.latest_build.matched_provisioners?.available ?? 0) > 0;
117-
const shouldDisplayBuildLogs = haveBuildLogs && !workspaceRunning;
118+
(workspace.latest_build.matched_provisioners?.available ?? 1) > 0;
118119
const shouldShowProvisionerAlert =
119-
!workspaceRunning && !haveBuildLogs && !provisionersHealthy;
120+
workspacePending && !haveBuildLogs && !provisionersHealthy && !isRestarting;
120121

121122
return (
122123
<div
@@ -244,7 +245,7 @@ export const Workspace: FC<WorkspaceProps> = ({
244245
/>
245246
)}
246247

247-
{shouldDisplayBuildLogs && (
248+
{shouldShowBuildLogs && (
248249
<WorkspaceBuildLogsSection logs={buildLogs} />
249250
)}
250251

0 commit comments

Comments
 (0)