-
Notifications
You must be signed in to change notification settings - Fork 898
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
Simplify tag list reconstruct #12670
Simplify tag list reconstruct #12670
Conversation
33aa471
to
8629121
Compare
@@ -21,11 +21,11 @@ def tag_prefix | |||
def tag_list_reconstruct | |||
tag_list = tag_names | |||
|
|||
if resource_type == Container.name | |||
if resource.instance_of?(Container) |
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 think this may lead to extra Select
query.
Although, this is minor nitpick and can be ignored.
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 am not sure about it I thought that resource
is preloaded in by include
base_rollup
query, isn't ?
https://github.com/ManageIQ/manageiq/blob/master/app/models/chargeback.rb#L26
if resource.instance_of?(Container) | ||
state = resource.vim_performance_state_for_ts(timestamp.to_s) | ||
tag_list += state.image_tag_names if state.present? | ||
image_tag_name = "#{state.try(:image_tag_name)}|" if state |
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 think either that if
or that try
is enough. I think, there is no need to have both.
This is however minor nitpick and can be ignored.
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.
yes, I think we also avoid to use try
because then you can easily overlook that there is typo
👍 Thanks! |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
Rates cache is now in. We can rebase and unwip. 🍔 |
and add here also TAG_MANAGED_PREFIX and move /tag/managed/ to constant
8629121
to
48363fb
Compare
48363fb
to
70bd693
Compare
Checked commits lpichler/manageiq@2009cc4~...70bd693 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@miq-bot remove_label wip |
👍 LGTM |
Backported to Euwe via #13419 |
continuing of #12608 (created on top of this PR - reason for WIP)
🎁 @isimluk
@miq-bot add_label wip
@miq-bot add_label chargeback, refactoring