-
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
Fixing subservice task creation for service bundles #18283
Fixing subservice task creation for service bundles #18283
Conversation
@miq-bot add_label bug |
fd5ce90
to
1345539
Compare
e220d96
to
10bf5c6
Compare
@miq-bot remove_label wip |
@@ -218,10 +218,6 @@ def composite? | |||
children.present? | |||
end | |||
|
|||
def retireable? | |||
type.present? | |||
end |
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.
This method is now included from the CiFeatureMixin which always returns true
. 👍
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.
The rational for changing this check is that, while the blanket check for type being present has some logical issues since not all services have types but all are retireable, the part that's being omitted at the moment is subservices. Per #17317 (comment), I think checking to see if the service is a subservice first makes more sense.
@miq-bot add_label hammer/yes |
54cdfa5
to
9da82b4
Compare
225556e
to
1cba151
Compare
@miq-bot remove_label wip |
5d05837
to
0136071
Compare
Failures look unrelated to this code. |
end | ||
end | ||
|
||
context "without type" do |
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.
Doesn't this still need to be tested?
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.
43a3771
to
c5ef83f
Compare
c5ef83f
to
97537a4
Compare
Checked commit d-m-u@97537a4 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@@ -16,7 +16,9 @@ def update_and_notify_parent(*args) | |||
end | |||
|
|||
def task_finished | |||
update_attributes(:status => status == 'Ok' ? 'Completed' : 'Failed') | |||
if status != 'Ok' | |||
update_attributes(:status => 'Error') |
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.
Is this already set to "Completed" before this method is called?
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.
Well, we needed the completed gone, because it's not a valid state for the task. It should either be ok or error.
…for_bundled_service_bundles Fixing subservice task creation for service bundles (cherry picked from commit 7889bd0) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1608958 Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1653648
Hammer backport details:
|
Subservices aren't being correctly retired. The task creation should be using src_ids, and the recursive call to create tasks for subservices is wrong. Also, the service retireable check should handle subservices for bundles, and the request and task should be able to mark themselves as finished after the status update to "retired", just like we do for provisioning.
req_state = (states.length == 1) ? states.keys.first : "active"
, the check we're currently using at https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_request.rb#L383 is being overriden here to set the request to finished to work for bundles. We should be checking state and status for all the child tasks and if they're all ok and finished, then the parent can be updated.Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1608958
Also fixes https://bugzilla.redhat.com/show_bug.cgi?id=1653648
They're related.