Bug 1633815

Summary: UI allows adding embedded method to itself.
Product: Red Hat CloudForms Management Engine Reporter: William Fitzgerald <wfitzger>
Component: UI - OPSAssignee: Dávid Halász <dhalasz>
Status: CLOSED CURRENTRELEASE QA Contact: John Dupuy <jdupuy>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.10.0CC: dhalasz, dmetzger, hkataria, jdupuy, lavenel, mpovolny, obarenbo, wfitzger
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:
: 1672691 (view as bug list) Environment:
Last Closed: 2019-12-13 15:09:13 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: 1672691    
Attachments:
Description Flags
Embedded method in multiple domains none

Description William Fitzgerald 2018-09-27 19:38:03 UTC
Description of problem: You can add an embedded method to itself.  The UI should not allow this.


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

How reproducible:

100%
Steps to Reproduce:
1. Edit a method
2. Select 'Add Method' button
3. Navigate and select the method you are editing.
4. Save method

Actual results:
It will allow you to add embedded method to itself

Expected results:
You should be stopped from adding the method to itself.

Additional info:

Comment 4 William Fitzgerald 2018-10-11 16:02:41 UTC
You can have the same embedded method in different domains so we need to handle this condition.  There is an existing method to check all domains so you may need this.

Will add a screenshot.

Hope this helps ...

Thanks

Billy

Comment 5 William Fitzgerald 2018-10-11 16:05:39 UTC
Created attachment 1492978 [details]
Embedded method in multiple domains

Comment 8 William Fitzgerald 2018-12-07 14:50:54 UTC
David,

Madhu made this comment in the PR 

A user can copy the methods into their own domain, so now we would have the same named methods in multiple domains and none of these methods can be embedded.

There is a method called
MiqAeMethod.get_homonymic_across_domains(@user, '/DOM1/A/B/C/CLASS1/method1')

Which gets a list of all the places where this method exists and we should prevent it from being embedded.

The UI currently uses this to display a list of methods and instances across domains

Is this what your looking for ?

Comment 9 Dávid Halász 2018-12-07 14:53:02 UTC
Yes, thanks!

Comment 10 Dávid Halász 2019-01-22 09:58:07 UTC
Merged commit fcbbc9052c1cb0e1feb0bcc018f292f6a9010a5e

Comment 12 John Dupuy 2019-07-02 19:05:23 UTC
Verified in 5.11.0.11

Steps of verification:
1) Navigate to Automate->Explorer
2) Create local domain
3) Copy a method from the MIQ domain
4) Edit the method
5) Try to add the method to itself
6) Verified that nothing happens when you click on the same method so you cannot add the method to itself