Skip to content

Commit ae38ef5

Browse files
committed
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. (cherry picked from commit b5ba3e3)
1 parent 9a8d2f1 commit ae38ef5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

site/src/pages/WorkspacePage/Workspace.tsx

Lines changed: 5 additions & 4 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy