-
Notifications
You must be signed in to change notification settings - Fork 141
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
Request cancel #421
Request cancel #421
Conversation
@bdunne v2v RFE needs task level cancellation. Do we expect another PR? |
@bdunne Since the back-end is really only supporting this feature for v2v can we reduce the models this is exposed on? At the moment we return "Unsupported" for all other request/task types so I would prefer limiting the action as much as possible. |
@gmcculloug Many thoughts..
|
I was not involved in building out the API so do not have any insight into why there are 4 endpoints. @gtanzillo @abellotti Are likely to know the answer. |
@miq-bot add_label blocker |
@bdunne if this can be backported, can you add the gaprindashvili/yes label |
d537d04
to
c3902ee
Compare
@gtanzillo @abellotti Any thoughts on #421 (comment) |
8bb22e4
to
5317105
Compare
@gmcculloug Regarding
I was also not involved so I'm not sure either. It seems in some places we've exposed a single endpoint for the base class and in other places we exposed separate endpoints for each subclass like was done here. Perhaps @abellotti or @Fryguy can comment on that. It would be good to understand which convention we should be following, if there is one. |
Okay, I think this is ready for review. @jrafanie can you put another set of 👀 on the tests? |
LGTM. It's a bit hard to follow at first with the indirection but the alternative is 1000 lines of duplicated tests, so It would be good if @Fryguy can comment on the separate collections for each subclass. It seems strange. I can't imagine having separate collections for vmware vms, redhat vms, etc. On the fipside, these things are not the same and are actual tasks for completely different end user features. 🤷♂️ |
@@ -0,0 +1,14 @@ | |||
module Api | |||
module Mixins | |||
module ResourceCancel |
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.
Should this be ResourceCancel or TaskCancel?
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.
It's for ServiceOrder
, MiqRequest
X4 or MiqRequestTask
primary collections.
spec/support/api/helpers.rb
Outdated
@@ -224,6 +224,12 @@ def expect_options_results(type, data = {}) | |||
expect(response.headers['Access-Control-Allow-Methods']).to include('OPTIONS') | |||
end | |||
|
|||
def expect_unauthorized_request |
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.
minor, but this might read better as expect_forbidden_request, since the status is :forbidden
Talking to Alberto, it sounds like it just grew this way over time. Hopefully we don't need to create new endpoints for the other 12 subclasses of |
Checked commits bdunne/manageiq-api@7cad510~...1064cf9 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/controllers/api/mixins/resource_cancel.rb
app/controllers/api/subcollections/request_tasks.rb
app/controllers/api/subcollections/service_requests.rb
spec/requests/automation_requests_spec.rb
spec/requests/provision_requests_spec.rb
spec/requests/requests_spec.rb
spec/requests/service_orders_spec.rb
spec/requests/service_requests_spec.rb
spec/requests/service_templates_spec.rb
|
Can we get this merged today? |
@gtanzillo @gmcculloug @blomquisg we will need this merged ASAP for 5.9.4-2 build for tomorrow. Anything here left to finish/review? |
@bthurber I responded in: #421 (comment) |
@miq-bot add_labels gaprindashvili/yes enhancement transformation |
@bdunne Cannot apply the following label because they are not recognized: gaprindashvili/yes enhancement transformation |
Request cancel (cherry picked from commit 62de390) https://bugzilla.redhat.com/show_bug.cgi?id=1610533
Gaprindashvili backport details:
|
Based on changes in: ManageIQ/manageiq#17687
https://bugzilla.redhat.com/show_bug.cgi?id=1564257
cc @abellotti @gtanzillo @gmcculloug @bzwei