-
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
Accept Hash object as result of inter region api invocation #18210
Accept Hash object as result of inter region api invocation #18210
Conversation
This comment has been minimized.
This comment has been minimized.
@miq-bot add-label hammer/yes |
59b2870
to
65aac7e
Compare
@miq-bot add-label blocker |
\cc @gtanzillo @carbonin |
@miq-bot remove-label wip |
Checked commits yrudman/manageiq@1e89ce1~...65aac7e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@yrudman did you open a BZ against the API to standardize responses? /cc @bdunne @abellotti |
Also, do we know what happens in this case if we fail to retire the service? Will the client raise an Http error (I assume we will get a 5xx error of some sort) or will the hash contain a failure notification? |
API Client is raising the same error which was raised on remote region:
|
Okay, that's fine, just make sure to open a BZ against the API so we can remove this in the future. |
@@ -80,6 +80,11 @@ def self.exec_api_call(region, collection_name, action, api_args = nil, id = nil | |||
result.attributes | |||
when ManageIQ::API::Client::Resource | |||
instance_for_resource(result) | |||
when Hash |
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 that this is the wrong solution.
Vm
retirement returns an action result, which I believe is correct.
However, retiring anything else (see api/base_controller/generic.rb) is returning the resource, which I believe is wrong.
I think retirement of anything should return the action result. @abellotti Any thoughts on this?
@bdunne I agree with you, but I don't think we're going to push an API refactoring for this in time to fix this blocker. That's why I asked that a BZ be opened to address the API's return value inconsistencies. |
I wouldn't call it a refactoring... It's a bug in the API that retiring different things gives you different responses (resource hash vs action result).
Tracking down and fixing all of the API response inconsistencies is an exponentially harder task than fixing the retirement responses and I'm afraid that it will never happen due to the difficulty level. |
I think Yuri was also concerned with introducing breaking API changes by backporting the switch from resource to action result. We could also fix the API for hammer and backport only this to Gaprindashvili. But I don't know what kind of compatibility rules we follow (or don't follow) for the manageiq REST API. @abellotti ? |
I've started working on changing return value : ManageIQ/manageiq-api#511. |
…f-inter-region-api-invocation Accept Hash object as result of inter region api invocation (cherry picked from commit 0f85990) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1650335
Hammer backport details:
|
I think we should proceed for now with this solution (even if it looks wrong) since it is closing blockers for hammer and gaprindashvili and discuss/decide when we want to do breaking changes on API |
@carbonin @bdunne API's return value inconsistencies BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1650696 |
…f-inter-region-api-invocation Accept Hash object as result of inter region api invocation (cherry picked from commit 0f85990) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1650691
Gaprindashvili backport details:
|
Issue:
Setting retirement date on Service via Centralized Administration generates error in log:
Blocking: #18195 and ManageIQ/manageiq-ui-classic#4874
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1650335
@miq-bot add-label bug, blocker. hammer/yes, gaprindashvili/yes, core