Bug 1628727

Summary: Button enablement and visibility by tag not working for buttons on Ansible services
Product: Red Hat CloudForms Management Engine Reporter: Saif Ali <saali>
Component: ApplianceAssignee: Yuri Rudman <yrudman>
Status: CLOSED CURRENTRELEASE QA Contact: Nikhil Dhandre <ndhandre>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.4CC: abellott, anikifor, dmetzger, gtanzill, hkataria, lavenel, mfeifer, mpovolny, ndhandre, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0Flags: ndhandre: automate_bug+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.18 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1634809 (view as bug list) Environment:
Last Closed: 2019-02-12 16:50:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1634809    
Attachments:
Description Flags
Button
none
Button2 none

Description Saif Ali 2018-09-13 19:52:37 UTC
Created attachment 1483153 [details]
Button

Description of problem:
Expressions configured on a button for enablement and visibility are not working when used against Ansible services.  If I'm understanding this correctly, I should be able to build the expression as shown in attached images and then tag the service with the same and the button should only be available when the expression is true.  However as you can see in the other attached image, the tag is set on the service but the button is disabled still.

Version-Release number of selected component (if applicable):
Tested on both 4.6.2 and 4.6.4 with same results.


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Saif Ali 2018-09-13 19:53:12 UTC
Created attachment 1483154 [details]
Button2

Comment 4 CFME Bot 2018-10-01 13:21:07 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/b74e3df296c80520a0469adaba4a7c131105e8e0
commit b74e3df296c80520a0469adaba4a7c131105e8e0
Author:     Yuri Rudman <yrudman>
AuthorDate: Tue Sep 25 17:13:20 2018 -0400
Commit:     Yuri Rudman <yrudman>
CommitDate: Tue Sep 25 17:13:20 2018 -0400

    MiqExpression defined on Service does not evaluate tag correctly when instance of class descendent from Service passed: class descendent from Service has `service` method and string "service" passed to MiqExpression as reference, so MiqExpression trying to obtaine 'real' object using passed reference by invoking `service` method on instance of class descendent from Service, which is wrong. Passed object should not be subsrituted using reference if reference is "service" and object < ... <  Service
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628727

 app/models/condition.rb | 9 +-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comment 6 CFME Bot 2018-10-01 16:57:32 UTC
New commit detected on ManageIQ/manageiq/hammer:

https://github.com/ManageIQ/manageiq/commit/5d30389b1fbda1627073b466f344eb3059d3dd1c
commit 5d30389b1fbda1627073b466f344eb3059d3dd1c
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Mon Oct  1 09:17:44 2018 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Mon Oct  1 09:17:44 2018 -0400

    Merge pull request #18020 from yrudman/fixed-expression-with-tag-on-service

    Fixed MiqExpression evaluation on tagged Services

    (cherry picked from commit d670fe8fa67f1cd6acb1c3405016062592fbeb6d)

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

 app/models/condition.rb | 9 +-
 spec/models/condition_spec.rb | 8 +
 2 files changed, 16 insertions(+), 1 deletion(-)

Comment 7 Angelina Vasileva 2018-10-11 07:55:48 UTC
Fixed and verified in 5.10.0.19.20181009184346_1c8bf5d