-
Notifications
You must be signed in to change notification settings - Fork 41
Conversation
@bzwei Please review |
@jameswnl The idea is good. Need to add |
@miq-bot add_label bug |
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 need to investigate further to figure out how we got here, but this feels pretty drastic.
Checked commits jameswnl/ansible_tower_client_ruby@15ad288~...699b2f6 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@bdunne The model class and methods are created while converting the first hash. If the second hash has some keys that do not appear in the first hash, you will get method not exist error if trying to access them. The fix tries to add new methods if possible. |
@bdunne yes please! |
@bdunne check my workaround fix for ManageIQ/manageiq-providers-ansible_tower#9 to get the spec to pass |
@miq-bot add_label blocker |
@jameswnl Cannot apply the following label because they are not recognized: blocker |
I reviewed this with @jameswnl and @bdunne and what we discovered is (ignoring the current hack that's in the refresher_v2.yml) that every credential in the v2 yml does not have a domain and every credential in the v3 yaml does have a domain. This means that when talking to the same provider, the API is consistent and this issue doesn't exist. However, the tests don't do that. One set of tests runs against a v2 API, and another set of tests run against v3. Since the models are shared, they are effectively creating test contamination depending on which one loads first and defines the class. The only way this could happen in the real world is if 2 different towers are accessed in the same process and those towers are two different API versions. IMO, the only way to handle this is to create separate class sets based on the tower version. Those class sets can be subclasses of a common class to allow simpler
Within a kind, we're not sure if different kinds of the same type have different payloads. If they do, we may need to further subclass by kind.
In the above I just tacked on the V2/V3...it could also be done like one of the following
|
It seems this is sort of already done for JobTemplate: ansible_tower_client_ruby/lib/ansible_tower_client/api.rb Lines 155 to 163 in 3af723b
|
@jameswnl Cannot apply the following label because they are not recognized: blocker |
#95