Bug 1753523 - Attribute value pairs message is not considered while simulation
Summary: Attribute value pairs message is not considered while simulation
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.11.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.11.z
Assignee: Tina Fitzgerald
QA Contact: Devidas Gaikwad
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-19 07:46 UTC by Ganesh Hubale
Modified: 2021-01-11 15:11 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-11 15:11:25 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
simulation page (41.19 KB, image/png)
2019-09-19 07:46 UTC, Ganesh Hubale
no flags Details
simulation page (81.91 KB, image/png)
2019-09-19 07:51 UTC, Ganesh Hubale
no flags Details

Description Ganesh Hubale 2019-09-19 07:46:25 UTC
Created attachment 1616592 [details]
simulation page

Description of problem:
If you put 'message' in 'attribute/value pairs' field then it does not consider while simulation.

Version-Release number of selected component (if applicable):
5.11.0.25.20190913144023_5682444

How reproducible:
100%

Steps to Reproduce:
1. Create domain, namespace, class and instance pointing to method
2. Navigate to automate > automation > simulation page
3. Fill values as shown in screenshot.
4. See automation.logs

Actual results:
[----] I, [2019-09-19T03:29:39.214008 #10804:41c3a00]  INFO -- : Followed  Relationship [miqaedb:/test_name/test_class/test_instance#create]
[----] I, [2019-09-19T03:29:39.214742 #10804:41c3a00]  INFO -- : Followed  Relationship [miqaedb:/System/Request/Call_Instance#create]

It does not consider attribute 'message' in logs with test_instance.

Expected results:
[----] I, [2019-09-19T03:29:39.214008 #10804:41c3a00]  INFO -- : Followed  Relationship [miqaedb:/test_name/test_class/test_instance#hello]
[----] I, [2019-09-19T03:29:39.214742 #10804:41c3a00]  INFO -- : Followed  Relationship [miqaedb:/System/Request/Call_Instance#create]

It should consider attribute message in logs with test_instance as per BZ fixed for custom button simulation: https://bugzilla.redhat.com/show_bug.cgi?id=1651099

Additional info:
- This behaviour is same for simulation on 5.10 and 5.11. Hence not adding it as a regression.

Comment 2 Ganesh Hubale 2019-09-19 07:51:36 UTC
Created attachment 1616596 [details]
simulation page

Comment 3 Tina Fitzgerald 2019-09-19 15:06:14 UTC
Hi Ganesh,

From simulate, you'll need to specify the call_instance_with_message instance as described here:
https://bugzilla.redhat.com/show_bug.cgi?id=1672693

Please let me know if you have any questions.

Thanks,
Tina

Comment 4 Ganesh Hubale 2019-09-19 15:46:05 UTC
Hi Tina,

As per this comment https://bugzilla.redhat.com/show_bug.cgi?id=1672693#c6

>> Simulate does not have the message specified(or has create as the message)
>> [----] I, [2019-02-18T04:51:47.631004 #10135:fc295c]  INFO -- : Followed  Relationship [miqaedb:/System/custom_request/instance_1#create]
>> [----] I, [2019-02-18T04:51:47.631902 #10135:fc295c]  INFO -- : Followed  Relationship [miqaedb:/System/Request>> >>/Call_Instance_With_Message#create]


I can see that 'message' attribute was not added while simulation. So that I shows #create message.

But in my case, I have added 'message' attribute and expecting this message with instance. as described above.

As you said, I tried with "call_instance_with_message" but I am still able to reproduce this issue:

[----] I, [2019-09-19T11:44:10.309890 #7834:2ad9700d06b4]  INFO -- : <AEMethod test_meth> hello
[----] I, [2019-09-19T11:44:10.333773 #7834:2ad969a8a2ec]  INFO -- : <AEMethod [/test_domain/test_name/test_class/test_meth]> Ending
[----] I, [2019-09-19T11:44:10.333909 #7834:2ad969a8a2ec]  INFO -- : Method exited with rc=MIQ_OK
[----] I, [2019-09-19T11:44:10.334371 #7834:2ad969a8a2ec]  INFO -- : Followed  Relationship [miqaedb:/test_name/test_class/test_instance#create]
[----] I, [2019-09-19T11:44:10.335290 #7834:2ad969a8a2ec]  INFO -- : Followed  Relationship [miqaedb:/System/Request/call_instance_with_message#create]

Please let me know if something is missing.

Thanks,
Ganesh

Comment 5 drew uhlmann 2019-10-01 11:20:39 UTC
in def build_results inside the ui/app/controllers/application_controller/automate.rb

    144:   ws = MiqAeEngine.resolve_automation_object(@sb[:name],
    145:                                              User.current_user,
    146:                                              automation_attrs,
    147:                                              options,
    148:                                              @resolve[:new][:readonly])
    149:   ws.root['ae_result'] ||= 'ok'
    150:   @results = ws.to_expanded_xml
    151:   @resolve[:uri] = options[:uri]
    152:   @resolve[:ae_result] = ws.root['ae_result']
    153:   @resolve[:state_attributes] = ws.root['ae_result'] == 'retry' ? state_attributes(ws) : {}
    154:   @ae_simulation_tree = TreeBuilderAutomateSimulationResults.new(:ae_simulation_tree, @sb, true, :root => @results)
    155: end

[1] pry(#<MiqAeToolsController>)> automation_attrs["message"] 
=> "create"
[2] pry(#<MiqAeToolsController>)> automation_attrs
=> {"namespace"=>"system", "class"=>"request", "instance"=>"inspectme", "message"=>"create", "request"=>"call_instance_with_message"}
[3] pry(#<MiqAeToolsController>)> options
=> {:vmdb_object=>nil, :fqclass=>"SYSTEM/PROCESS"}
[4] pry(#<MiqAeToolsController>)> @sb
=> {"perf_options"=>
  #<struct ApplicationController::Performance::Options
...
 "name"=>"Request",
 "attrs"=>{"namespace"=>"system", "class"=>"request", "instance"=>"inspectme", "message"=>"drewwww", "request"=>"call_instance_with_message"},
 "obj"=>nil}



 @sb["attrs"]["message"] has the simulate attribute, and automation_attrs["message"] has the other message. 

However, we next call 
ws = MiqAeEngine.resolve_automation_object(@sb[:name],
                                               User.current_user,
                                               automation_attrs,
                                               options,
                                               @resolve[:new][:readonly])

and only have the automation_attrs so the simulate attribute gets dropped.

Comment 6 Tina Fitzgerald 2019-10-23 15:25:27 UTC
Hi Patrik,

Let me know if you have any questions, and/or if you would like to get together to discuss this issue.

Thanks,
Tina

Comment 9 Tina Fitzgerald 2021-01-11 15:11:25 UTC
A Github Issue has been opened to track the resolution of the reported defect. Moving
to a Github Issue provides access to the larger ManageIQ community for
assistance in resolving this defect.

Please refer to https://github.com/ManageIQ/manageiq-automation_engine/issues/469 for
future updates regarding this issue.

If you have any concerns about this, please let us know.

Thanks and regards!


Note You need to log in before you can comment on or make changes to this bug.