-
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
Allow rate assignment to enterprise for ContainerImages #14090
Conversation
858bc04
to
e70ed2d
Compare
Checked commit isimluk@e70ed2d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Overall i think its correct to inherit the rate from the enterprise here since we do inherit from the 'Selected Containers Provider' but we need to confirm with @simon3z and Loicavenel .
|
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.
@isimluk I think I am missing something... in your PR #12608 you removed this from ChargebackContainerImage
:
- def get_rate_parents(_perf)
- # get rates from image tags only
- []
- end
and added:
+ def parents_determining_rate
+ case resource_type
...
+ when Container.name
+ []
+ end
+ end
The correctness of this change isn't evident to me. I would expected that the entity involved here was ContainerImage
(and its parent).
Bottom line I don't know when this Container.name
case is used and in what Chargeback type (cc @zeari)
@simon3z this is the type if the metric. Container image chargeback goes over container metrics since metrics for images doesnt make a lot of sense. |
That makes sense but if the method is named So is the current value |
@simon3z well it is
nope, if theres an assigned rate to the provider it get the rate from the |
@zeari to make sure we all get it right:
In all the cases is a rate is not assigned, chargeback report will be empty. CORRECT? I am letting Tagged Image out of the discussion for now. |
@zeari @isimluk @gtanzillo @Loicavenel it seems to me that we would need to discuss some aspects here and I think we can do it on Thursday in our meeting. |
Could you please expand on this? What do you mean by uncovered parts? By the way, what was the result of discussion? I didn't get the invite. 😢 |
@isimluk we didn't discuss this last week. Let's do it this week (same meeting you joined a couple of weeks ago with @zeari and @gtanzillo). |
@Loicavenel Yes (sorry for the ultra late reply) |
I would prefer to keep all the technical details written in the pr. I have another meeting in the given time slot. |
The decision in the meeting was to produce the two specific examples of possible Chargeback Assignments/Reports to leverage the existing Unless we have these examples there is no way for us and QE to assess correctness and we don't want to incur in an another case where the side-effect of these enable an unsupported report. If it's not possible to leverage/test any of these ( |
Well, that's sounds good. Being thorough and diligent tends to pay of. Although, I have a feeling that the following information may have got lost in translation. This is pr is a fix for customer bug and it has been verified in their environment. Actually, it is a fix for regression introduced in https://github.com/ManageIQ/manageiq/pull/10677/files#diff-9cccefb74f0723b14c5bae2ab4474a53R108 |
@isimluk the fix for the customer bug was delivered with #14079 where the use-case is clear ( |
Aha. I was confident it was about both, ContainerImage and ContainerProject. I think we dive deep into ContainerImage on the last two calls. But I could be wrong, it has been a long time... Sorry for confusion then. |
I am afraid to remove parent_ems, as I feel there is lack of clarity of what is going on. It seems we are going in circles, perhaps we can sit down and write a docs how this is supposed to work? What is the matrix of all the possible assignments? More importantly, it would be helpful to put down all the possible use-cases and requirements users may have. Please note the I am all confused. I don't want to remove it unless there is more clarity. In one of the previous messages, you said Additionally, it feels to me that if we merge this pr, we could remove |
Addressing: [NoMethodError]: undefined method `base_model' for NilClass:Class Method:[rescue in _async_generate_table] app/models/mixins/assignment_mixin.rb:146:in `block in get_assigned_for_target' app/models/mixins/assignment_mixin.rb:146:in `collect' app/models/mixins/assignment_mixin.rb:146:in `get_assigned_for_target' app/models/chargeback/rates_cache.rb:13:in `rates' app/models/chargeback/rates_cache.rb:7:in `get' app/models/chargeback.rb:9:in `block in build_results_for_report_chargeback' app/models/chargeback/consumption_history.rb:31:in `block (2 levels) in for_report' Introduced in 31fac86 Lesson learned: when you see two lists with [].compact, it is usually good idea to use compact too. If we merged ManageIQ#14090 we wouldn't see this at customer.
Relates to https://bugzilla.redhat.com/show_bug.cgi?id=1426467
@miq-bot add_label bug, chargeback, euwe/yes
@miq-bot assign @gtanzillo