Skip to content
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

Remove options[:user_message] during miq_request_task creation. #17084

Merged

Conversation

tinaafitz
Copy link
Member

The miq_request options[:user_message] gets added when an Automate
method calls the user_message method during approval.
The request options are copied to each miq_request_task at task creation which
causes a problem during update_and_notify_parent.
Removing the task options[:user_message] resolves the issue.

calls the update_and_notify_parent with the display_message method:
https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_request_task.rb#L85

uses the user_message, if available:
https://github.com/ManageIQ/manageiq/blob/master/app/models/mixins/miq_request_mixin.rb#L13

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1482197

@miq-bot assign @gmcculloug
@miq-bot add_label bug, fine/yes, gaprindashvili/yes

@tinaafitz
Copy link
Member Author

@mkanoor Please review.

@@ -559,6 +559,7 @@ def my_records
def clean_up_keys_for_request_task
req_task_attributes = attributes.dup
(req_task_attributes.keys - MiqRequestTask.column_names + REQUEST_UNIQUE_KEYS).each { |key| req_task_attributes.delete(key) }
req_task_attributes["options"].delete(:user_message) if req_task_attributes["options"][:user_message]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tinaafitz No need for the if check here, just call the delete method unconditionally.

method calls the user_message method during approval. The request
options are copied to each miq_request_task at task creation which
causes a problem during update_and_notify_parent.
Removing the task options[:user_message] resolves the issue.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1482197
@tinaafitz tinaafitz force-pushed the remove_user_message_from_task branch from 3abbbf2 to 84a8c84 Compare March 6, 2018 15:16
@miq-bot
Copy link
Member

miq-bot commented Mar 6, 2018

Checked commit tinaafitz@84a8c84 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

@gmcculloug gmcculloug merged commit 330eb50 into ManageIQ:master Mar 6, 2018
@gmcculloug gmcculloug added this to the Sprint 81 Ending Mar 12, 2018 milestone Mar 6, 2018
simaishi pushed a commit that referenced this pull request Mar 8, 2018
Remove options[:user_message] during miq_request_task creation.
(cherry picked from commit 330eb50)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553408
@simaishi
Copy link
Contributor

simaishi commented Mar 8, 2018

Gaprindashvili backport details:

$ git log -1
commit 49c0f0bff26e6daace3f5e1651875804bb316b7c
Author: Greg McCullough <[email protected]>
Date:   Tue Mar 6 10:41:34 2018 -0500

    Merge pull request #17084 from tinaafitz/remove_user_message_from_task
    
    Remove options[:user_message] during miq_request_task creation.
    (cherry picked from commit 330eb505e1ecff872b9cb5d393159ff695fb39be)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553408

simaishi pushed a commit that referenced this pull request Apr 9, 2018
Remove options[:user_message] during miq_request_task creation.
(cherry picked from commit 330eb50)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553409
@simaishi
Copy link
Contributor

simaishi commented Apr 9, 2018

Fine backport details:

$ git log -1
commit ee5caad6cf949f05d9ec78fd8ddcfb728b6de044
Author: Greg McCullough <[email protected]>
Date:   Tue Mar 6 10:41:34 2018 -0500

    Merge pull request #17084 from tinaafitz/remove_user_message_from_task
    
    Remove options[:user_message] during miq_request_task creation.
    (cherry picked from commit 330eb505e1ecff872b9cb5d393159ff695fb39be)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553409

d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
…from_task

Remove options[:user_message] during miq_request_task creation.
(cherry picked from commit 330eb50)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants