-
Notifications
You must be signed in to change notification settings - Fork 356
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
Do not store openshift env in the controller, use lookup helper instead #1077
Conversation
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.
Reduced the number of queries and got rid of a controller @variable
LGTM
full disclosure: I did not run in the ui
@@ -0,0 +1,12 @@ | |||
module ReportHelper::Editor | |||
def cb_entities_by_provider_id(provider_id, entity_type) | |||
provider = ManageIQ::Providers::ContainerManager.find(provider_id) |
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.
Did we just introduce an N+1 for looking up providers?
I guess if we were really concerned about this, we would use ContainerProject.where(:ems_id => provider_id)...
- which is overkill at the moment.
The number of reduced queries for container_projects
and container_images
has been reduced, so I'm good with the change
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 aware, I decided it is good enough for the moment.
use lookup helper instead. Lookup only subset of the environment. This should have been done in manageiq-ui-classic#532 Most of the time using session or instance variable is not encouraged.
Checked commits https://github.com/isimluk/manageiq-ui-classic/compare/4a65c3428dc82286958720e8d45bb81b707ec841~...ee2d8b3bd6c7a9c29ef832eb15a5d0356eace2d5 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@isimluk Cannot apply the following labels because they are not recognized: reporting, chargeback, ui, scalability |
Do not store openshift env in the controller, use lookup helper instead (cherry picked from commit 287dc37) https://bugzilla.redhat.com/show_bug.cgi?id=1444038
Fine backport details:
|
Euwe backport (to manageiq repo) details:
|
This is also fixing error about missing `ManageIQ::Providers::Openshift::ContainerManager::ContainerImage` ManageIQ/manageiq-providers-openshift#23 (comment)
https://bugzilla.redhat.com/show_bug.cgi?id=1442158
Alternative to #1069