-
Notifications
You must be signed in to change notification settings - Fork 973
feat: show workspace health error alert above agents in WorkspacePage #19400
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
Changes from all commits
e3f1b21
9b89bb1
2d5b791
b6cfffc
988c3d3
eb0711f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ import { | |
WorkspaceBuildProgress, | ||
} from "./WorkspaceBuildProgress"; | ||
import { WorkspaceDeletedBanner } from "./WorkspaceDeletedBanner"; | ||
import { NotificationActionButton } from "./WorkspaceNotifications/Notifications"; | ||
import { findTroubleshootingURL } from "./WorkspaceNotifications/WorkspaceNotifications"; | ||
import { WorkspaceTopbar } from "./WorkspaceTopbar"; | ||
|
||
interface WorkspaceProps { | ||
|
@@ -95,6 +97,8 @@ export const Workspace: FC<WorkspaceProps> = ({ | |
(workspace.latest_build.matched_provisioners?.available ?? 1) > 0; | ||
const shouldShowProvisionerAlert = | ||
workspacePending && !haveBuildLogs && !provisionersHealthy && !isRestarting; | ||
const troubleshootingURL = findTroubleshootingURL(workspace.latest_build); | ||
const hasActions = permissions.updateWorkspace || troubleshootingURL; | ||
|
||
return ( | ||
<div className="flex flex-col flex-1 min-h-0"> | ||
|
@@ -192,6 +196,41 @@ export const Workspace: FC<WorkspaceProps> = ({ | |
</Alert> | ||
)} | ||
|
||
{!workspace.health.healthy && ( | ||
<Alert severity="warning"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Does it make sense to keep these colors? Or should we do something like give There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the existing popup has the same problem. it should definitely get fixed eventually but our colors are a bit of a mess right now. probably out of scope for this issue. |
||
<AlertTitle>Workspace is unhealthy</AlertTitle> | ||
<AlertDetail> | ||
<p> | ||
Your workspace is running but{" "} | ||
{workspace.health.failing_agents.length > 1 | ||
? `${workspace.health.failing_agents.length} agents are unhealthy` | ||
: "1 agent is unhealthy"} | ||
. | ||
</p> | ||
{hasActions && ( | ||
<div className="flex items-center gap-2"> | ||
{permissions.updateWorkspace && ( | ||
<NotificationActionButton | ||
onClick={() => handleRestart()} | ||
> | ||
Restart | ||
</NotificationActionButton> | ||
)} | ||
{troubleshootingURL && ( | ||
<NotificationActionButton | ||
onClick={() => | ||
window.open(troubleshootingURL, "_blank") | ||
} | ||
> | ||
Troubleshooting | ||
</NotificationActionButton> | ||
)} | ||
</div> | ||
)} | ||
</AlertDetail> | ||
</Alert> | ||
)} | ||
|
||
{transitionStats !== undefined && ( | ||
<WorkspaceBuildProgress | ||
workspace={workspace} | ||
|
Uh oh!
There was an error while loading. Please reload this page.