-
Notifications
You must be signed in to change notification settings - Fork 25
Conversation
Passing run #12560 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
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.
looks great, just had a few comments!
sshKey: { | ||
type: "string" as "string", | ||
title: "SSH Key", | ||
}, |
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.
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.
Whoops thank you! I opened evergreen-ci/evergreen#6993 to expose this field.
describe("provider tab", () => { | ||
describe("static provider", () => { |
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.
nit. update test descriptions
}) satisfies GqlToFormFunction<Tab>; | ||
|
||
export const formToGql = (({ allocation, setup, sshConfig }, distro) => { | ||
const { bootstrapMethod } = setup; |
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.
any reason this one is destuctured in particular? :o
hostAllocatorSettings: { | ||
acceptableHostIdleTime: allocation.acceptableHostIdleTime, | ||
feedbackRule: allocation.feedbackRule, | ||
futureHostFraction: allocation.futureHostFraction, | ||
hostsOverallocatedRule: allocation.hostsOverallocatedRule, | ||
maximumHosts: allocation.maximumHosts, | ||
minimumHosts: allocation.minimumHosts, | ||
roundingRule: allocation.roundingRule, | ||
version: allocation.version, | ||
}, |
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.
I think you could also just write
hostAllocatorSettings: { | |
acceptableHostIdleTime: allocation.acceptableHostIdleTime, | |
feedbackRule: allocation.feedbackRule, | |
futureHostFraction: allocation.futureHostFraction, | |
hostsOverallocatedRule: allocation.hostsOverallocatedRule, | |
maximumHosts: allocation.maximumHosts, | |
minimumHosts: allocation.minimumHosts, | |
roundingRule: allocation.roundingRule, | |
version: allocation.version, | |
}, | |
hostAllocatorSettings: allocation |
allocation: { | ||
version: hostAllocatorSettings.version, | ||
roundingRule: hostAllocatorSettings.roundingRule, | ||
feedbackRule: hostAllocatorSettings.feedbackRule, | ||
hostsOverallocatedRule: hostAllocatorSettings.hostsOverallocatedRule, | ||
minimumHosts: hostAllocatorSettings.minimumHosts, | ||
maximumHosts: hostAllocatorSettings.maximumHosts, | ||
acceptableHostIdleTime: hostAllocatorSettings.acceptableHostIdleTime, | ||
futureHostFraction: hostAllocatorSettings.futureHostFraction, | ||
}, |
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.
same here, but if you prefer to write them out, that's okay with me too 🙂
sshOptions: { | ||
"ui:addButtonText": "Add SSH option", | ||
"ui:orderable": false, | ||
}, |
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.
is there a way to make these full length? not sure if that might be difficult 🥹
it("errors when selecting an incompatible host communication method", () => { | ||
cy.selectLGOption("Host Communication Method", "RPC"); | ||
save(); | ||
cy.validateToast("error"); |
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.
nit: does it make sense to populate the second parameter for description assertion
const formSchema = useMemo(() => getFormSchema({ provider }), [provider]); | ||
|
||
return ( | ||
<BaseTab formSchema={formSchema} initialFormState={initialFormState} /> |
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.
<BaseTab formSchema={formSchema} initialFormState={initialFormState} /> | |
<BaseTab formSchema={formSchema} initialFormState={distroData} /> |
import { TabProps } from "./types"; | ||
|
||
export const HostTab: React.FC<TabProps> = ({ distroData, provider }) => { | ||
const initialFormState = distroData; |
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.
const initialFormState = distroData; |
const hasStaticProvider = provider === Provider.Static; | ||
const hasDockerProvider = provider === Provider.Docker; |
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.
const hasStaticProvider = provider === Provider.Static; | |
const hasDockerProvider = provider === Provider.Docker; | |
const hideWidget = provider === Provider.Static || provider === Provider.Docker; |
"ui:data-cy": "minimum-hosts-input", | ||
...((hasStaticProvider || hasDockerProvider) && { | ||
"ui:widget": "hidden", | ||
}), | ||
}, | ||
maximumHosts: { | ||
"ui:data-cy": "maximum-hosts-input", | ||
...((hasStaticProvider || hasDockerProvider) && { | ||
"ui:widget": "hidden", | ||
}), | ||
}, | ||
acceptableHostIdleTime: { | ||
"ui:data-cy": "idle-time-input", | ||
...((hasStaticProvider || hasDockerProvider) && { | ||
"ui:widget": "hidden", | ||
}), | ||
}, | ||
futureHostFraction: { | ||
"ui:data-cy": "future-fraction-input", | ||
...((hasStaticProvider || hasDockerProvider) && { |
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.
"ui:data-cy": "minimum-hosts-input", | |
...((hasStaticProvider || hasDockerProvider) && { | |
"ui:widget": "hidden", | |
}), | |
}, | |
maximumHosts: { | |
"ui:data-cy": "maximum-hosts-input", | |
...((hasStaticProvider || hasDockerProvider) && { | |
"ui:widget": "hidden", | |
}), | |
}, | |
acceptableHostIdleTime: { | |
"ui:data-cy": "idle-time-input", | |
...((hasStaticProvider || hasDockerProvider) && { | |
"ui:widget": "hidden", | |
}), | |
}, | |
futureHostFraction: { | |
"ui:data-cy": "future-fraction-input", | |
...((hasStaticProvider || hasDockerProvider) && { | |
"ui:data-cy": "minimum-hosts-input", | |
...(hideWidget && { | |
"ui:widget": "hidden", | |
}), | |
}, | |
maximumHosts: { | |
"ui:data-cy": "maximum-hosts-input", | |
...(hideWidget && { | |
"ui:widget": "hidden", | |
}), | |
}, | |
acceptableHostIdleTime: { | |
"ui:data-cy": "idle-time-input", | |
...(hideWidget && { | |
"ui:widget": "hidden", | |
}), | |
}, | |
futureHostFraction: { | |
"ui:data-cy": "future-fraction-input", | |
...(hideWidget && { |
Object.entries(enumObject).map(([value, title]) => ({ | ||
type: "string" as "string", | ||
title, | ||
enum: [value], |
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.
nit: this reads a little better without aliasing the object key with "value"
Object.entries(enumObject).map(([value, title]) => ({ | |
type: "string" as "string", | |
title, | |
enum: [value], | |
Object.entries(enumObject).map(([key, title]) => ({ | |
type: "string" as "string", | |
title, | |
enum: [key], |
...(!hasStaticProvider && { "ui:widget": "hidden" }), | ||
}, | ||
sshOptions: { | ||
"ui:addButtonText": "Add SSH option", |
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.
Is there any guidance we can give the user for a valid SSH option? I'm not sure what to submit here.
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.
host logic itself lgtm, just had some comments about styling
"ui:fullWidth": true, | ||
"ui:orderable": false, | ||
items: { | ||
"ui:elementWrapperCSS": css` | ||
max-width: unset; | ||
`, | ||
"ui:placeholder": "ConnectTimeout=10", | ||
}, |
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.
oops my bad for not specifying! I think I meant something more like this, like in the designs!
"ui:fullWidth": true, | |
"ui:orderable": false, | |
items: { | |
"ui:elementWrapperCSS": css` | |
max-width: unset; | |
`, | |
"ui:placeholder": "ConnectTimeout=10", | |
}, | |
"ui:orderable": false, | |
items: { | |
"ui:placeholder": "ConnectTimeout=10", | |
}, |
@@ -50,4 +50,5 @@ const DefaultFieldContainer = styled.div<{ border?: "top" | "bottom" }>` | |||
${({ border }) => | |||
border && | |||
`border-${border}: 1px solid ${gray.light1}; padding-${border}: ${size.s};`} | |||
width: 100%; |
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.
EVG-19950
Description
Screenshots
Testing
Evergreen PR
evergreen-ci/evergreen#6993