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

Add security group subcollection to providers, cloud tenants, and vms #81

Merged
merged 8 commits into from
Oct 5, 2017

Conversation

tzumainn
Copy link
Contributor

No description provided.

@tzumainn
Copy link
Contributor Author

Required by ManageIQ/manageiq-ui-classic#1997

@tzumainn tzumainn force-pushed the security-group-subcollection branch from bec9298 to 7a60ed2 Compare September 26, 2017 21:27
@tzumainn tzumainn changed the title Add security group subcollection to vms and providers Add security group subcollection to providers, cloud tenants, and vms Sep 26, 2017
module Subcollections
module SecurityGroups
def security_groups_query_resource(object)
object.respond_to?(:security_groups) ? object.security_groups : []
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a test that executes the case when the object does not respond to :security_groups?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - thanks!

@abellotti abellotti self-assigned this Oct 2, 2017
@abellotti
Copy link
Member

@tzumainn when you get a chance, can you add tests for accessing security_groups subcollection for vms and cloud_tenants, similar to what you did for providers ? Thanks.

@tzumainn
Copy link
Contributor Author

tzumainn commented Oct 5, 2017

@abellotti Thanks for taking a look! I've added the tests; they depend on ManageIQ/manageiq#16127 being merged in manageiq, though.

@abellotti
Copy link
Member

Thanks @tzumainn for the update, I'll look at both.

@abellotti
Copy link
Member

abellotti commented Oct 5, 2017

@tzumainn can you fix the Style/Align rubocop issue and repush ? Thanks.

@tzumainn
Copy link
Contributor Author

tzumainn commented Oct 5, 2017

@abellotti Done! (I think - I'm a bit uncertain about the frozen string comment, but I guess I'll see).

@@ -2,7 +2,7 @@ module Api
module Subcollections
module SecurityGroups
def security_groups_query_resource(object)
object.respond_to?(:security_groups) ? object.security_groups : []
object.respond_to?(:security_groups) ? object.security_groups : [].freeze
Copy link
Member

Choose a reason for hiding this comment

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

this .freeze is not needed. can you remove it/repush ? Thanks. the frozen literal rubocop is unrelated.

@tzumainn
Copy link
Contributor Author

tzumainn commented Oct 5, 2017

@abellotti Ah, that's good to know. I've removed it!

@miq-bot
Copy link
Member

miq-bot commented Oct 5, 2017

Checked commits tzumainn/manageiq-api@6fcfe7e~...fed2730 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
7 files checked, 1 offense detected

app/controllers/api/subcollections/security_groups.rb

@abellotti
Copy link
Member

Thanks @tzumainn for the API Enhancement. LGTM!! 👍

@abellotti abellotti merged commit c25a180 into ManageIQ:master Oct 5, 2017
@abellotti abellotti added this to the Sprint 71 Ending Oct 16, 2017 milestone Oct 5, 2017
@himdel
Copy link
Contributor

himdel commented Oct 20, 2017

Looks like create & update (& delete) will also be needed for ManageIQ/manageiq-ui-classic#1997 .

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.

5 participants