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
Bug 1868426: Unfilter OS dropdown in VM wizard when choosing flavor or workload #6316
Bug 1868426: Unfilter OS dropdown in VM wizard when choosing flavor or workload #6316
Conversation
getTemplatesOfLabelType(templates, TEMPLATE_TYPE_BASE), | ||
[getWorkloadLabel(workload), getFlavorLabel(flavor)], | ||
); | ||
]); |
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.
why?
this will cause to return the wrong OSs not reflecting the workload and flavor selection.
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.
@suomiy hi,
from UX side this is wrong to change the selection options of a field by using another field below it.
from a user perspective a common problem this can fix is:
a - a user selects an OS then selects a Flavor or Workload
b - a user want to fix their selection of OS, but the correct OS is missing from the list.
the fix:
a - a user select and OS
b - the user select some flavor
c - all OS options are presented and they can currect the OS selection.
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.
this is not about UX, but about correct template selection. The user should be aware of comon templates and create his own if such template is missing (based on os/flavor etc.)
disscussing more in BZ
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.
Note:
in the BZ discussion we decided that a viable fix for the problem wil be to:
1: override the user selection of flavor/workload upon OS selection
Ido, can we override the values to "null" (or what ever the default value is) ?
this will make sure users know that the values where changed ?
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.
yeah good idea
@irosenzw: This pull request references Bugzilla bug 1868426, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh |
@irosenzw: This pull request references Bugzilla bug 1868426, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
4 similar comments
/retest |
/retest |
/retest |
/retest |
0f3e506
to
1753dee
Compare
@irosenzw: This pull request references Bugzilla bug 1868426, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
/hold |
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.
IMO this PR still can be improved on.
isHidden: asHidden(!isWindows, VMSettingsField.OPERATING_SYSTEM), | ||
value: isWindows, | ||
}, | ||
[VMSettingsField.WORKLOAD_PROFILE]: { value: null }, |
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.
we should not reset the values if we can supply the right template
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.
additional idea: we could also show a small warning to the user that a combination is invalid and reset the warning on any new value selection
thoughts?
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 agree with the first comment.
for the warning I think it's redundant. when following the first comment behavior, it is clear that if the workload/flavor would set to null it is because the combination is invalid, thus no need for any warning message.
what do you think @matthewcarleton ?
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.
Note:
two os may have the same flavor label, but it may mean different things, for example:
flavor: tiny os:ubuntu => mem: 2Gi
flavor: tiny os:fedora => mem: 1Gi
IMHO, not re-seting the flavor each time we change an os is not nice to users
https://github.com/kubevirt/common-templates/blob/e127881c7fb7f77ba84f0571478d4507e3e6b8e7/generate-templates.yaml#L204
https://github.com/kubevirt/common-templates/blob/e127881c7fb7f77ba84f0571478d4507e3e6b8e7/generate-templates.yaml#L162
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.
why is it not nice? the user just sees the label tiny and probably does not know which template will be used, ie does not have an association with how much memory. And if he does know, it shouldn't matter either. The user is selecting a tiny flavor for a reason.
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.
why is it not nice?
All the times I ordered a VM, I used numbers (or looked up doc to see the numbers) to specify the mem/cpu/disk I needed , I think that a user like me, will be confused if they choose 2Gb (tiny on ubuntu) and got 1Gb (tiny on fedora) while they should have chosen small because it's the 2Gb for fedora.
But I don't feel strongly about this, so just ignore if you feel differently, the bug is about having the ability to choose any OS, so any fix that will show all the OS options for any given flavour/workload is good for me :-)
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 know it is a bit confusing, I just meant it in the context of this PR. Sure if we plan to redesign this feature, we should tackle this problem in a separate effort. As this concerns the basic flow as well, and not just this fix.
1753dee
to
bd5790a
Compare
dispatch( | ||
vmWizardInternalActions[InternalActionType.UpdateVmSettings](id, { | ||
[VMSettingsField.FLAVOR]: { value: null }, | ||
[VMSettingsField.MEMORY]: { |
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.
this is done by flavorUpdater. Let's move the flavorUpdater down if we need its functionality later
if (os && !iTemplate) { | ||
const keepFlavor = Object.assign({}, relevantOptions); | ||
Object.assign(keepFlavor, { workload: null }); | ||
// Check for a valid common-template that contain the chosen Flavor |
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.
let's not try to find combinations which could work. We don't know if the user prefers to keep his flavor or workload so let's reset both if we have to reset one of them.
); | ||
} else { | ||
// Reset both Workload and Flavor as no valid common-template has been found | ||
dispatch( |
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.
btw workloadConsistencyUpdater does a similar thing. It might be easier for understanding to have the same logic in one place for both
bd5790a
to
f21715f
Compare
f21715f
to
1245a0c
Compare
osUpdater, | ||
baseImageUpdater, | ||
cloneCommonBaseDiskImageUpdater, | ||
workloadConsistencyUpdater, | ||
provisioningSourceUpdater, | ||
nativeK8sUpdater, | ||
flavorUpdater, |
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.
please move the code as well. We want to ensure that the updaters can be read from top to bottom in the same order they are executed in
8e16c1c
to
29e519b
Compare
); | ||
} | ||
}; | ||
|
||
const provisioningSourceUpdater = ({ id, prevState, dispatch, getState }: UpdateOptions) => { |
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.
+1 for moving this as well
const state = getState(); | ||
if (!hasVMSettingsValueChanged(prevState, state, id, VMSettingsField.WORKLOAD_PROFILE)) { | ||
if ( | ||
!hasVMSettingsValueChanged(prevState, state, id, VMSettingsField.WORKLOAD_PROFILE) && |
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.
this can be done in one call, look at the args of this func
return; | ||
} | ||
const selectors = iGetRelevantTemplateSelectors(state, id); | ||
const iUserTemplates = iGetLoadedCommonData(state, id, VMWizardProps.userTemplates); | ||
const iCommonTemplates = iGetLoadedCommonData(state, id, VMWizardProps.commonTemplates); | ||
|
||
if (!iGetRelevantTemplate(iUserTemplates, iCommonTemplates, selectors)) { | ||
// reset workload profile if no relevant template found - could be triggered by provider prefil | ||
// reset workload and flavor profile if no relevant template found - could be triggered by provider prefil |
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.
// reset workload and flavor profile if no relevant template found - could be triggered by provider prefil | |
// reset workload and flavor profile if no relevant template found - could be triggered by provider prefil or os selection |
When switching OS, the flavor or the workload values will be set to NULL if there is no common-template that respects the new OS with one of them. Signed-off-by: Ido Rosenzwig <irosenzw@redhat.com>
29e519b
to
ace1e6c
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: irosenzw, suomiy, yaacov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@irosenzw: All pull requests linked via external trackers have merged: openshift/console#6316. Bugzilla bug 1868426 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
When switching OS, the flavor and workload will be set to NULL
thus the user would have to pick suitable flavor & workload
for the new OS.
Signed-off-by: Ido Rosenzwig irosenzw@redhat.com