- Notifications
You must be signed in to change notification settings - Fork920
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
18 commits Select commitHold shift + click to select a range
7df3b27
add alert to the create workspace page
SasSwart1e1262f
improve error case documentation
SasSwart0f78afc
add provisioner health hook
SasSwartf0f7216
show provisioner health warnings for templates
SasSwarta3eeb9c
consistent formatting for alerts across pages
SasSwart3cf53ef
Finalise Provisioner Warnings for Templates and template versions
SasSwarte281d6b
linter fixes
SasSwart2baa81e
Merge remote-tracking branch 'origin/main' into jjs/15048-fe
SasSwart0cab768
use matched_provisioners instead of a second api call
SasSwartb228257
provide a key to provisioner tags to keep react happy
SasSwart8b91dc0
fix linting issues
SasSwartbec2913
make fmt
SasSwart4796a32
Copy updates
SasSwartb6f99a6
make fmt
SasSwartaec9cba
add loader back in to build logs drawer
SasSwart75e7394
simplify logic
SasSwart0aed543
fix logic
SasSwart0bd9478
make fmt
SasSwartFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
10 changes: 9 additions & 1 deletionsite/src/api/api.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 10 additions & 8 deletionssite/src/api/queries/organizations.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletionssite/src/components/Alert/Alert.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletionssite/src/modules/provisioners/ProvisionerAlert.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
importtype{Meta,StoryObj}from"@storybook/react"; | ||
import{chromatic}from"testHelpers/chromatic"; | ||
import{ProvisionerAlert}from"./ProvisionerAlert"; | ||
constmeta:Meta<typeofProvisionerAlert>={ | ||
title:"modules/provisioners/ProvisionerAlert", | ||
parameters:{ | ||
chromatic, | ||
layout:"centered", | ||
}, | ||
component:ProvisionerAlert, | ||
args:{ | ||
title:"Title", | ||
detail:"Detail", | ||
severity:"info", | ||
tags:{tag:"tagValue"}, | ||
}, | ||
}; | ||
exportdefaultmeta; | ||
typeStory=StoryObj<typeofProvisionerAlert>; | ||
exportconstInfo:Story={}; | ||
exportconstNullTags:Story={ | ||
args:{ | ||
tags:undefined, | ||
}, | ||
}; |
45 changes: 45 additions & 0 deletionssite/src/modules/provisioners/ProvisionerAlert.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
importAlertTitlefrom"@mui/material/AlertTitle"; | ||
import{Alert,typeAlertColor}from"components/Alert/Alert"; | ||
import{AlertDetail}from"components/Alert/Alert"; | ||
import{Stack}from"components/Stack/Stack"; | ||
import{ProvisionerTag}from"modules/provisioners/ProvisionerTag"; | ||
importtype{FC}from"react"; | ||
interfaceProvisionerAlertProps{ | ||
title:string; | ||
detail:string; | ||
severity:AlertColor; | ||
tags:Record<string,string>; | ||
} | ||
exportconstProvisionerAlert:FC<ProvisionerAlertProps>=({ | ||
title, | ||
detail, | ||
severity, | ||
tags, | ||
})=>{ | ||
return( | ||
<Alert | ||
severity={severity} | ||
css={(theme)=>{ | ||
return{ | ||
borderRadius:0, | ||
border:0, | ||
borderBottom:`1px solid${theme.palette.divider}`, | ||
borderLeft:`2px solid${theme.palette[severity].main}`, | ||
}; | ||
}} | ||
> | ||
<AlertTitle>{title}</AlertTitle> | ||
<AlertDetail> | ||
<div>{detail}</div> | ||
<Stackdirection="row"spacing={1}wrap="wrap"> | ||
{Object.entries(tags??{}) | ||
.filter(([key])=>key!=="owner") | ||
.map(([key,value])=>( | ||
<ProvisionerTagkey={key}tagName={key}tagValue={value}/> | ||
))} | ||
</Stack> | ||
</AlertDetail> | ||
</Alert> | ||
); | ||
}; |
55 changes: 55 additions & 0 deletionssite/src/modules/provisioners/ProvisionerStatusAlert.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
importtype{Meta,StoryObj}from"@storybook/react"; | ||
import{chromatic}from"testHelpers/chromatic"; | ||
import{MockTemplateVersion}from"testHelpers/entities"; | ||
import{ProvisionerStatusAlert}from"./ProvisionerStatusAlert"; | ||
constmeta:Meta<typeofProvisionerStatusAlert>={ | ||
title:"modules/provisioners/ProvisionerStatusAlert", | ||
parameters:{ | ||
chromatic, | ||
layout:"centered", | ||
}, | ||
component:ProvisionerStatusAlert, | ||
args:{ | ||
matchingProvisioners:0, | ||
availableProvisioners:0, | ||
tags:MockTemplateVersion.job.tags, | ||
}, | ||
}; | ||
exportdefaultmeta; | ||
typeStory=StoryObj<typeofProvisionerStatusAlert>; | ||
exportconstHealthyProvisioners:Story={ | ||
args:{ | ||
matchingProvisioners:1, | ||
availableProvisioners:1, | ||
}, | ||
}; | ||
exportconstUndefinedMatchingProvisioners:Story={ | ||
args:{ | ||
matchingProvisioners:undefined, | ||
availableProvisioners:undefined, | ||
}, | ||
}; | ||
exportconstUndefinedAvailableProvisioners:Story={ | ||
args:{ | ||
matchingProvisioners:1, | ||
availableProvisioners:undefined, | ||
}, | ||
}; | ||
exportconstNoMatchingProvisioners:Story={ | ||
args:{ | ||
matchingProvisioners:0, | ||
}, | ||
}; | ||
exportconstNoAvailableProvisioners:Story={ | ||
args:{ | ||
matchingProvisioners:1, | ||
availableProvisioners:0, | ||
}, | ||
}; |
47 changes: 47 additions & 0 deletionssite/src/modules/provisioners/ProvisionerStatusAlert.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
importtype{AlertColor}from"components/Alert/Alert"; | ||
importtype{FC}from"react"; | ||
import{ProvisionerAlert}from"./ProvisionerAlert"; | ||
interfaceProvisionerStatusAlertProps{ | ||
matchingProvisioners:number|undefined; | ||
availableProvisioners:number|undefined; | ||
tags:Record<string,string>; | ||
} | ||
exportconstProvisionerStatusAlert:FC<ProvisionerStatusAlertProps>=({ | ||
matchingProvisioners, | ||
availableProvisioners, | ||
tags, | ||
})=>{ | ||
lettitle:string; | ||
letdetail:string; | ||
letseverity:AlertColor; | ||
switch(true){ | ||
casematchingProvisioners===0: | ||
title="Build pending provisioner deployment"; | ||
detail= | ||
"Your build has been enqueued, but there are no provisioners that accept the required tags. Once a compatible provisioner becomes available, your build will continue. Please contact your administrator."; | ||
severity="warning"; | ||
break; | ||
caseavailableProvisioners===0: | ||
title="Build delayed"; | ||
detail= | ||
"Provisioners that accept the required tags have not responded for longer than expected. This may delay your build. Please contact your administrator if your build does not complete."; | ||
severity="warning"; | ||
break; | ||
default: | ||
title="Build enqueued"; | ||
detail= | ||
"Your build has been enqueued and will begin once a provisioner becomes available to process it."; | ||
severity="info"; | ||
} | ||
return( | ||
<ProvisionerAlert | ||
title={title} | ||
detail={detail} | ||
severity={severity} | ||
tags={tags} | ||
/> | ||
); | ||
}; |
36 changes: 36 additions & 0 deletionssite/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletionsite/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.