Skip to content

feat(site): warn on provisioner health during builds #15589

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

Merged
merged 18 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
consistent formatting for alerts across pages
  • Loading branch information
SasSwart committed Nov 21, 2024
commit a3eeb9c52d4ce16e8135dcbc1885b489327fe162
28 changes: 26 additions & 2 deletions site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { WorkspaceBuildLogs } from "modules/workspaces/WorkspaceBuildLogs/Worksp
import { type FC, useLayoutEffect, useRef } from "react";
import { navHeight } from "theme/constants";
import { provisionersUnhealthy, useCompatibleProvisioners } from "modules/provisioners/useCompatibleProvisioners";
import { Alert, AlertTitle } from "@mui/material";
import { AlertDetail } from "components/Alert/Alert";

type BuildLogsDrawerProps = {
error: unknown;
Expand Down Expand Up @@ -74,11 +76,33 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({

{ !compatibleProvisioners && !logs ? (
// If there are no compatible provisioners, warn that this job may be stuck
<>No compatible provisioners</>
<Alert
severity="warning"
css={{
borderRadius: 0,
border: 0,
// borderBottom: `1px solid ${theme.palette.divider}`,
// borderLeft: `2px solid ${theme.palette.error.main}`,
}}
>
<AlertTitle>Build stuck</AlertTitle>
<AlertDetail>No Compatible Provisioner Daemons have been configured</AlertDetail>
</Alert>
) : compatibleProvisionersUnhealthy && !logs && (
// If there are compatible provisioners in the db, but they have not reported recent health checks,
// warn that the job might be stuck
<>Compatible provisioners are potentially unhealthy. Your job might be delayed</>
<Alert
severity="warning"
css={{
borderRadius: 0,
border: 0,
// borderBottom: `1px solid ${theme.palette.divider}`,
// borderLeft: `2px solid ${theme.palette.error.main}`,
}}
>
<AlertTitle>Build may be delayed</AlertTitle>
<AlertDetail>Compatible Provisioner Daemons have been silent for a while. This may result in a delayed build</AlertDetail>
</Alert>
)}

{isMissingVariables ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,19 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
<AlertDetail>{templateVersion.job.error}</AlertDetail>
</Alert>
</div>
) : !compatibleProvisioners ? (
<Alert
severity="warning"
css={{
borderRadius: 0,
border: 0,
borderBottom: `1px solid ${theme.palette.divider}`,
borderLeft: `2px solid ${theme.palette.error.main}`,
}}
>
<AlertTitle>Build stuck</AlertTitle>
<AlertDetail>No Compatible Provisioner Daemons have been configured</AlertDetail>
</Alert>
) : compatibleProvisionersUnhealthy && (
<div>
<Alert
Expand All @@ -615,7 +628,7 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
}}
>
<AlertTitle>Build may be delayed</AlertTitle>
<AlertDetail>No Compatible Provisioner Daemons have been recently seen</AlertDetail>
<AlertDetail>Compatible Provisioner Daemons have been silent for a while. This may result in a delayed build</AlertDetail>
</Alert>
</div>
)}
Expand Down
Loading