[WIP] Convert console_supported? to supports?#21990
Conversation
| supports :vmrc_console do | ||
| unsupported_reason_add(:vmrc_console, _("VMRC Console not supported")) unless console_supported?('VMRC') | ||
| supports :console do | ||
| unless supports?(:spice_console) || supports?(:vnc_console) |
There was a problem hiding this comment.
Realize this was pulled from https://github.com/ManageIQ/manageiq/pull/21990/files#diff-1cd4edb18c242ba5e1f5795da3f815cde970e5e9672cdd7d96b1a101fe7c465fL1679 but I wonder why webmks isn't an option here
There was a problem hiding this comment.
I was doing it blind but I think that is a good idea
There was a problem hiding this comment.
TODO: Add to provider classes supports :console
There was a problem hiding this comment.
this changes vmware cloud manager and no others
| supports :native_console do | ||
| unsupported_reason_add(:native_console, _("VM NATIVE Console not supported")) unless console_supported?('NATIVE') | ||
| supports :html5_console do | ||
| unless %w[vnc_console webmks_console spice_console].any? { |type| supports?(type) } |
There was a problem hiding this comment.
This is begging for supports_any? 😉
There was a problem hiding this comment.
Huh. most of the cases are actually supports_all?
For supports_all, I had wanted to add supports :html5_console => [:vnc_console ...] but it added too much mental complexity in the definition of supports and unsupported_reason(:a) || unsupported_reason(:b) is easy enough to read.
with the new merge, we really only want unsupported_reason for the all case, not sure how to type that unsupported_any_reason
But for the any case, I guess supports_any would work great. will think on that
There was a problem hiding this comment.
TODO: add to providers: supports :html5_console
|
This pull request is not mergeable. Please rebase and repush. |
|
This pull request has been automatically closed because it has not been updated for at least 3 months. Feel free to reopen this pull request if these changes are still valid. Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
|
If this seems like a good idea, maybe we should just add the supports into the children classes and not do a block here at all |
|
This pull request is not mergeable. Please rebase and repush. |
|
This pull request has been automatically closed because it has not been updated for at least 3 months. Feel free to reopen this pull request if these changes are still valid. Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
|
The consensus is we want to remove any dynamic calculations we are doing here grep for console_supported spice |
|
update:
If you like the direction this is headed, then we need a big cross repo test. |
- moving all supports into provider classes - moving :console from vm_or_template to vm/operations with the rest of them. - explicitly stating html5_console and console - native_console had half in supports and half in console_supported. so less of a change - dropping console_supported?
|
update:
|
|
Checked commit kbrock@4a4f57d with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
| supports :native_console do | ||
| _("VM NATIVE Console not supported") unless console_supported?('NATIVE') | ||
| end | ||
| supports_not :console |
There was a problem hiding this comment.
I saw a comment about ovirt, but what exactly is this one? @agrare?
|
Hard to tell from this PR, but if the actual supported features are changing, then I think we need to update the service UI as well. cc @DavidResende0 as he's looking at those specifically as we speak. |
|
WIP:
NEXT STEPS: Some providers have conditional logic in the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
7 similar comments
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
part of #21989
supports :html5_consoleto all providers that currently supportspice_console,vnc_consoleorwebmks_console. This will remove unnecessary logic that derives it. (A trend we have followed for the past 10 years.supports :consoleto providers with the same logic. Note:webmks_consolewas not in this list before.:html5_consoleand:consoleare now basically identical. Do we need both?console_supported?method and usesupports :consoleinstead.supports :console*.Do we want to make this consistent?
:launch_html5_console,:launch_native_console,:launch_vmrc_consoletosupports :{}_consoleblocks.supports :*_consolenow consistently have blocks checking vm for required attributes.Notes:
supported_console?to be more prevalent. Felt like it was defined in a bunch of places, but not really used that much.supportsfor providers changed. Feels like we could normalize these, but it's probably best to make as few changes here as possible to avoid too many changes to the localization strings.supports :html5_console, but unlike others, doesn't have thesupports :*_console.supports :console, but doesn't state the specific types. (same as above)html5_consolesupport based upon a feature flag or the state of the vm (e.g.archived?). Other providers seem to do this logic insupports :launch_html5_consolesupports :html5_consoleand:consoleare looking the sameThis requires the following PRs in other providers:
all were modified to handle the supports
Put DONE by the ones that also converted
validateandlaunch_The wording on some of the older ones may be a little different.
Here are the old values:
I would have preferred that the feature name not be included in the definition. It feels like "not supported" is good enough for the text, but unsure of the implications in the ui.