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

Support container/infra/cloud provider policies in the UI #11002

Merged
merged 2 commits into from
Nov 22, 2016

Conversation

alongoldboim
Copy link
Contributor

@alongoldboim alongoldboim commented Sep 4, 2016

Enable provider policies definitions.
Control panel ( added option for providers policies )
selection_167
Control panel Add Policy
selection_168
Providers panel ( added policies actions )
selection_169

@alongoldboim alongoldboim force-pushed the enable_proider_policies branch 2 times, most recently from 63f007f to 162b83e Compare September 5, 2016 13:04
@chessbyte chessbyte added the wip label Sep 5, 2016
@alongoldboim alongoldboim force-pushed the enable_proider_policies branch 3 times, most recently from 023cb47 to d503ffe Compare September 6, 2016 11:38
@miq-bot
Copy link
Member

miq-bot commented Sep 6, 2016

<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush.

@alongoldboim alongoldboim force-pushed the enable_proider_policies branch 11 times, most recently from baa9333 to f999f1a Compare September 8, 2016 14:30
@alongoldboim alongoldboim reopened this Sep 12, 2016
@alongoldboim
Copy link
Contributor Author

@cben @simon3z @enoodle please have a look.

@@ -27,6 +27,9 @@ def self.supported_types_and_descriptions_hash

belongs_to :provider
belongs_to :tenant
include ComplianceMixin
include CustomAttributeMixin
after_initialize :load_custom_attributes
Copy link
Member

Choose a reason for hiding this comment

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

This scares me. after_initialize is a harsh penalty. Also, this will be called for each individual EMS even if you don't need it.

Copy link
Member

Choose a reason for hiding this comment

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

@alongoldboim you probably want to move this functionality down to the container manager. If we need to expose this type of relationship for all managers, we can look at that later.

Also, miq_report, another class that uses load_custom_attributes_for via the CustomAttributeMixin, uses lazy loading to pull in the custom attributes only when they're accessed.

If there's definitely not a way to do this lazily, then at least having it isolated in the container manager would be better than exposing in ext_management_system.

Copy link
Contributor

Choose a reason for hiding this comment

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

@alongoldboim you probably want to move this functionality down to the container manager. If we need to expose this type of relationship for all managers, we can look at that later.

@alongoldboim @blomquisg idea was to bring this functionality to all type of providers. If this changed then it needs to be properly advertised to everyone (it's very important that it is going to be clear).

Copy link
Contributor

@lpichler lpichler Sep 20, 2016

Choose a reason for hiding this comment

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

in this PR(#11369 ) is loading of virtual custom attributes moved to constructor MiqExpression, @alongoldboim is it enough for your case ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Fryguy the idea is to use lazy loading as @lpichler suggested, just need to make sure it works for me in all the cases.
@blomquisg I think we should enable policies for all kinds of providers, do you see a reason why not to do it?
@lpichler going over that patch, will try it later on today, thanks for the help.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lpichler seems to work well 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

@alongoldboim so this #11369 needs to be merged first ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, added a depends on comment.

@alongoldboim alongoldboim force-pushed the enable_proider_policies branch 3 times, most recently from 8f4240a to fe03957 Compare September 20, 2016 12:51
@alongoldboim
Copy link
Contributor Author

@miq-bot remove_label wip

@alongoldboim alongoldboim changed the title [WIP] Support provider policies Support provider policies Sep 20, 2016
@miq-bot miq-bot removed the wip label Sep 20, 2016
@alongoldboim
Copy link
Contributor Author

depends on: #11369

@alongoldboim
Copy link
Contributor Author

@Fryguy Looks OK now?

@alongoldboim
Copy link
Contributor Author

@h-kataria any idea why the tests are failing?

@alongoldboim
Copy link
Contributor Author

@h-kataria tests are passing, anything else is missing? :)

end
process_emss(emss, "check_compliance")
showlist ? show_list : show
emss.count
Copy link
Contributor

Choose a reason for hiding this comment

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

@alongoldboim why do we need emss.count here, i don't see that being used.

:task => "Compliance Check"}, :error)
end
process_emss(emss, "check_compliance")
showlist ? show_list : show
Copy link
Contributor

Choose a reason for hiding this comment

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

@alongoldboim dont need to set showlist variable as it is not being used anywhere else, you could just do

@lastaction == "show_list" ? show_list : show

@alongoldboim
Copy link
Contributor Author

@h-kataria fixed.

@miq-bot
Copy link
Member

miq-bot commented Nov 22, 2016

Checked commits alongoldboim/manageiq@d25120a~...a40ee2b with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
17 files checked, 3 offenses detected

app/controllers/application_controller/tree_support.rb

app/controllers/ems_common.rb

app/controllers/miq_policy_controller.rb

@h-kataria
Copy link
Contributor

looks good now.

@h-kataria h-kataria added this to the Sprint 50 Ending Dec 5, 2016 milestone Nov 22, 2016
@h-kataria h-kataria merged commit 6434490 into ManageIQ:master Nov 22, 2016
@cben
Copy link
Contributor

cben commented Nov 22, 2016

@alongoldboim compliance events need icons:
ems-event-missing-icons

@simaishi
Copy link
Contributor

simaishi commented Jan 6, 2017

@alongoldboim is there a BZ for this?

@cben
Copy link
Contributor

cben commented Jan 8, 2017

Alon left the team. The feature was motivated by "CM-Ops" effort, probably doesn't have a BZ. @simon3z?

The missing icons I mention above also don't have BZ. And while I look at it, shouldn't say "ExtManagementSystem". => ManageIQ/manageiq-ui-classic#94, #13388.

@simaishi
Copy link
Contributor

simaishi commented Jan 9, 2017

simaishi pushed a commit that referenced this pull request Jan 9, 2017
Support container/infra/cloud provider policies in the UI
(cherry picked from commit 6434490)

https://bugzilla.redhat.com/show_bug.cgi?id=1411364
@simaishi
Copy link
Contributor

simaishi commented Jan 9, 2017

Euwe backport details:

$ git log -1
commit 11bace9720205ed40505c9c4c510259bf1534fc4
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Tue Nov 22 12:15:50 2016 -0500

    Merge pull request #11002 from alongoldboim/enable_proider_policies
    
    Support container/infra/cloud provider policies in the UI
    (cherry picked from commit 6434490304856b340a5628e4fade95b1848e77f6)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1411364

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.