Bug 1668023

Summary: Custom Button: unable to collect events for custom button with dialog
Product: Red Hat CloudForms Management Engine Reporter: Nikhil Dhandre <ndhandre>
Component: UI - OPSAssignee: drew uhlmann <duhlmann>
Status: CLOSED CURRENTRELEASE QA Contact: Nikhil Dhandre <ndhandre>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.10.0CC: bmidwood, dmetzger, duhlmann, hkataria, lavenel, mpovolny, ndhandre, obarenbo, tfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.11.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1702490 (view as bug list) Environment:
Last Closed: 2019-12-13 15:08:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1702490    

Description Nikhil Dhandre 2019-01-21 17:41:42 UTC
Description of problem:
-----------------------
Automation helped me lot to found this BZ. I was automating custom button event count for all objects tested by core qe. previously, I was checking events for simple button execution some objects with dialog. With automation; I parametrize dialog and found that some objects not able to collect events. 

1.Host (Infra)
2. Storage Manger (Cloud Provider)
3. Cloud Network

Note: Those are related to infra and cloud need to find Physical provider, container objects. 


Version-Release number of selected component (if applicable):
-------------------------------------------------------------
Version 5.10.0.32.20190115185124_c957ada


How reproducible:
-----------------
always

Steps to Reproduce:
-------------------
1. create custom button with dialog
2. execute custom button
3. check for custom button event count

Actual results:
---------------
custom button event count not update after execution. It work awesome without dialog but fails with dialog for some objects

Expected results:
-----------------
It should update


Additional info:

Comment 2 drew uhlmann 2019-01-21 19:53:33 UTC
I can't reproduce this for hosts. CustomButtonEvent count increases just fine when run with a dialog.

Comment 3 drew uhlmann 2019-01-21 20:22:23 UTC
I'm also not sure what kind of button is being described in case 2. What's the object type for storage manager?

Comment 4 drew uhlmann 2019-01-21 21:10:20 UTC
I can, however, reproduce for cloud networks.

Comment 5 drew uhlmann 2019-01-21 21:39:57 UTC
But it almost looks like this is an API issue, the invoke_custom_action doesn't ever get called.

Comment 6 Nikhil Dhandre 2019-01-22 07:09:20 UTC
(In reply to drew uhlmann from comment #3)

Drew, thank for attention,

> I'm also not sure what kind of button is being described in case 2. What's
> the object type for storage manager?
`Provider` is object type. If we add custom button on provider object type then for cloud provider it reflect on:
1. Cloud provider (eg. RHOS)
2. Storage Mangers (both)
3. Network Manger

Comment 10 drew uhlmann 2019-01-22 17:44:00 UTC
The logic inside https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/services/dialog_local_service.rb#L80 is missing a few different cases. 
Host.last.class.name.demodulize
=> "HostEsx"
and 
CloudNetwork.last.class.name.demodulize
=> "Public"

We're going to need to do something a little different in a few cases here.

Comment 14 Nikhil Dhandre 2019-05-15 11:31:33 UTC
The expected result satisfied with this fix. I would like to open new BZ for a landing problem.

Comment 15 drew uhlmann 2019-05-15 11:32:23 UTC
As discussed with Nikhil I think this ticket can be verified and a new one open for the outstanding issue found in comment 13, though to be honest that sounds like an issue that should first be looked at by the UI team because I can't speak to what page the product should be hitting for Storage Manager things.