-
Notifications
You must be signed in to change notification settings - Fork 900
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
[WIP] Convert console_supported? to supports? #21990
base: master
Are you sure you want to change the base?
Conversation
app/models/vm/operations.rb
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was doing it blind but I think that is a good idea
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.
TODO: Add to provider classes supports :console
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 changes vmware cloud manager and no others
app/models/vm/operations.rb
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is begging for supports_any?
😉
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
3 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 |
part of #21989
First:
supports :html5_console
to providers instead of deriving it in main. (it is supported if any of the following is supported:spice_console
,vnc_console
,webmks_console
.supports :console
to providers with the same logic. Note: before,webmks_console
was not in this list.:html5_console
and:console
are now basically identical.console_supported?
method.:launch_html5_console
,:launch_native_console
,:launch_vmrc_console
tosupports :{}_console
blocks.supports :*_console
now 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.supports
for providers changed. Feels like we could normalize these but probably best to make as few changes here to not produce too many changes the he 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_console
support based upon a feature flag or the state of the vm (e.g.archived?
). Other providers seem to do his logic insupports :launch_html5_console
supports :html5_console
and:console
are 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 validate and launch_
The wording on some of the older ones may be a little different.
Here are the old values:
I would have preferred it if the feature name were not included in the definition. It feels like "not supported" is good enough for the text, but unsure of the implications in the ui.