-
Notifications
You must be signed in to change notification settings - Fork 897
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
Return provider_class on provider requests #14657
Conversation
cc: @imtayadeway |
This might break some clients that expect the href to not include anything else (intent of our href). Is this a current issue reported ? what collection & collection_class specifically ? clients calling our API would normally specify/add the provider_class in the URL in each request, this is how provider_class=provider for /api/providers is documented. |
Checked commit jntullo@60e75da with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
There is a BZ for this. This will only add a suffix if
The EDIT action has an href
Which is a different object completely - or the object itself doesn't exist. Although the API client might add in the provider_class, I don't think we should send back misleading information or rely on them to do so. I can add in tests for other collections that there are concerns about breaking. |
hmm, ok. provider_class=provider would be the only concern, others are implemented for subclass refinement, so the original /api/:collection would hold true. we need to play with the API client with this as it uses returned href's for accessing subsequent resources. |
Ok, I've tested this Fix with the API Client and it's a definite 👍 miq.vms.search_options(:provider_class => "provider").first.delete deleted the first Provider instance and not ExtMangementSystem. The href with the included ?provider_class was honored as is with the client while running the action. Without this fix, the wrong provider would have been deleted. Thanks @jntullo for fixing this 😍 |
Return provider_class on provider requests (cherry picked from commit 58efc71)
Fine backport details:
|
@jntullo @abellotti Will it be a problem backporting this to Euwe and Darga as well (as per flags on the BZ)? |
@simaishi I don't think it's a straight backport, the PR touches files from a refactored API source base, so those releases will need separate PRs done for them. |
Backported to Euwe via #14866 |
Backported to Darga via #14874 |
Before:
After:
This PR resolves the issue where the provider_class is not being appended to the hrefs returned on both the object or actions. This could cause them to perform an action on a different object or get a different object in return.
@miq-bot add_label bug, api
@miq-bot assign @abellotti
Links