Skip to content
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

move AvailabilityMixin over to SupportsFeatureMixin #8266

Merged
merged 1 commit into from
May 19, 2022

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented May 19, 2022

  • convert is_available? to supports?
  • convert supports_#{feature} to supports?(:feature)

- convert is_available? to supports?
- convert supports_#{feature} to supports?(:feature)
Comment on lines -204 to -210
Array.wrap(records).all? do |record|
if record.respond_to?("supports_#{feature}?")
record.supports?(feature)
else # TODO: remove with deleting AvailabilityMixin module
record.is_available?(feature)
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

unless @feature.nil? || @record.nil?
if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager)
return true if %w[start stop].include?(@feature.to_s)
return false
end

return @record.is_available?(@feature) if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager::Host)
return @record.supports?(@feature) if @record.kind_of?(ManageIQ::Providers::Openstack::InfraManager::Host)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this change, but really want to get rid of this I'm very confused why this is in a seemingly generic "host_feature_button"

@miq-bot
Copy link
Member

miq-bot commented May 19, 2022

Some comments on commit kbrock@5c7d144

spec/controllers/storage_controller_spec.rb

  • ⚠️ - 93 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.

@miq-bot
Copy link
Member

miq-bot commented May 19, 2022

Checked commit kbrock@5c7d144 with ruby 2.6.9, rubocop 1.19.1, haml-lint 0.35.0, and yamllint
10 files checked, 11 offenses detected

app/helpers/application_helper/button/generic_feature_button_with_disable.rb

app/helpers/application_helper/button/host_feature_button.rb

app/helpers/application_helper/button/host_feature_button_with_disable.rb

@agrare agrare merged commit d35963a into ManageIQ:master May 19, 2022
@kbrock kbrock deleted the supports_available branch May 19, 2022 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants