-
Notifications
You must be signed in to change notification settings - Fork 876
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
Changes from 1 commit
7df3b27
1e1262f
0f78afc
f0f7216
a3eeb9c
3cf53ef
e281d6b
2baa81e
0cab768
b228257
8b91dc0
bec2913
4796a32
b6f99a6
aec9cba
75e7394
0aed543
0bd9478
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
import Alert, { type AlertColor } from "@mui/material/Alert"; | ||
import AlertTitle from "@mui/material/AlertTitle"; | ||
import { Stack } from "components/Stack/Stack"; | ||
import { Alert, type AlertColor } from "components/Alert/Alert"; | ||
import { AlertDetail } from "components/Alert/Alert"; | ||
import type { FC } from "react"; | ||
import { Stack } from "components/Stack/Stack"; | ||
import { ProvisionerTag } from "modules/provisioners/ProvisionerTag"; | ||
import type { FC } from "react"; | ||
|
||
interface ProvisionerAlertProps { | ||
matchingProvisioners: number | undefined, | ||
availableProvisioners: number | undefined, | ||
tags: Record<string, string> | ||
matchingProvisioners: number | undefined; | ||
availableProvisioners: number | undefined; | ||
tags: Record<string, string>; | ||
} | ||
|
||
export const ProvisionerAlert : FC<ProvisionerAlertProps> = ({ | ||
export const ProvisionerAlert: FC<ProvisionerAlertProps> = ({ | ||
matchingProvisioners, | ||
availableProvisioners, | ||
tags | ||
tags, | ||
}) => { | ||
let title: string; | ||
let detail: string; | ||
switch (true) { | ||
case (matchingProvisioners === 0): | ||
title="Provisioning Cannot Proceed" | ||
detail="There are no provisioners that accept the required tags. Please contact your administrator. Once a compatible provisioner becomes available, provisioning will continue." | ||
case matchingProvisioners === 0: | ||
title = "Provisioning Cannot Proceed"; | ||
detail = | ||
"There are no provisioners that accept the required tags. Please contact your administrator. Once a compatible provisioner becomes available, provisioning will continue."; | ||
break; | ||
case (availableProvisioners === 0): | ||
title="Provisioning Delayed" | ||
detail="Provisioners that accept the required tags are currently anavailable. This may delay your build. Please contact your administrator if your build does not complete." | ||
case availableProvisioners === 0: | ||
title = "Provisioning Delayed"; | ||
detail = | ||
"Provisioners that accept the required tags are currently anavailable. This may delay your build. Please contact your administrator if your build does not complete."; | ||
break; | ||
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. Are we able to show a queue length, like we do in the workspaces page? If nontrivial, this copy LGTM! 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. I think it might be non-trivial so let's leave it as a follow-up?
SasSwart marked this conversation as resolved.
Show resolved
Hide resolved
|
||
default: | ||
return null; | ||
|
@@ -48,11 +50,7 @@ export const ProvisionerAlert : FC<ProvisionerAlertProps> = ({ | |
{Object.entries(tags) | ||
.filter(([key]) => key !== "owner") | ||
.map(([key, value]) => ( | ||
<ProvisionerTag | ||
key={key} | ||
tagName={key} | ||
tagValue={value} | ||
/> | ||
<ProvisionerTag key={key} tagName={key} tagValue={value} /> | ||
))} | ||
</Stack> | ||
</AlertDetail> | ||
|
@@ -61,13 +59,13 @@ export const ProvisionerAlert : FC<ProvisionerAlertProps> = ({ | |
}; | ||
|
||
interface ProvisionerJobAlertProps { | ||
title: string | ||
detail: string | ||
severity: AlertColor | ||
tags: Record<string, string> | ||
title: string; | ||
detail: string; | ||
severity: AlertColor; | ||
tags: Record<string, string>; | ||
} | ||
|
||
export const ProvisionerJobAlert : FC<ProvisionerJobAlertProps> = ({ | ||
export const ProvisionerJobAlert: FC<ProvisionerJobAlertProps> = ({ | ||
title, | ||
detail, | ||
severity, | ||
|
@@ -90,11 +88,7 @@ export const ProvisionerJobAlert : FC<ProvisionerJobAlertProps> = ({ | |
{Object.entries(tags) | ||
.filter(([key]) => key !== "owner") | ||
.map(([key, value]) => ( | ||
<ProvisionerTag | ||
key={key} | ||
tagName={key} | ||
tagValue={value} | ||
/> | ||
<ProvisionerTag key={key} tagName={key} tagValue={value} /> | ||
))} | ||
</Stack> | ||
</AlertDetail> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, are we able to link to the docs on external provisioners?
If the user is an admin, it may be nice to remove "Contact your administrator." And also link to the provisioners page for the given organization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK to do this as a follow-up? I've seen plenty of systems where a "contact your administrator" is shown regardless of your user's capabilities.