-
Notifications
You must be signed in to change notification settings - Fork 74
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
Don't overwrite message in create_automation_object #287
Conversation
This comment has been minimized.
This comment has been minimized.
Ugh, @bdunne, it's a stupid one-liner and I can't tag you for review here, any chance you could 👀 anyway please? |
Pull Request Test Coverage Report for Build 1980
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1984
💛 - Coveralls |
Sorry, I'm not familiar enough with this to comment. |
@miq-bot remove_label wip |
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.
Looks like the right change to me. There can be a key "message" in the generic key/pair section as well as the message which drives automate resolution.
Just looking for tests on this.
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.
LGTM
@@ -258,7 +258,6 @@ def self.create_automation_object(name, attrs, options = {}) | |||
options[:instance_name] = name | |||
|
|||
options[:attrs] = create_ae_attrs(attrs, name, options[:vmdb_object]) | |||
options[:message] = options[:attrs][:message] |
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.
e5ef8f6
to
6e761d8
Compare
6e761d8
to
7becae8
Compare
host = FactoryBot.create(:host) | ||
message = "request_message" | ||
attrs = {"Host::host" => host.id, :message => "attr_message"} | ||
extras = "MiqServer%3A%3Amiq_server=#{@miq_server_id}" |
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.
Prefer this iteration which does not add the MiqServer
key/value in the attrs
hash.
We should look to refactor @miq_server_id
along with the other instance variables at the top of this spec into let
blocks in a separate PR.
Checked commit d-m-u@7becae8 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Don't overwrite message in create_automation_object (cherry picked from commit f38c83c) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1672693
Hammer backport details:
|
Creation of a custom button to request call_instance_with_message is overwriting the message in create_automation_object and we shouldn't do that. We can have one message stored in
attrs
and the other inoptions[:message]
and they are distinct entities and should remain so. This appears to have been wrong for quite a while (9c5233b) (and also slightly less relevant but still worth noting, ManageIQ/manageiq@227afe6). This worked in most cases because we don't usually have a message attribute in the attr value pairs, just the request message (which defaults tocreate
), so the message in the attrs was nil.Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1651099
This is coming back into the edit screen for the button, note the fact that the messages are different, one hasn't been overwritten by the other.