Bug 1633815 - UI allows adding embedded method to itself.
Summary: UI allows adding embedded method to itself.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.10.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.11.0
Assignee: Dávid Halász
QA Contact: John Dupuy
URL:
Whiteboard:
Depends On:
Blocks: 1672691
TreeView+ depends on / blocked
 
Reported: 2018-09-27 19:38 UTC by William Fitzgerald
Modified: 2019-12-13 15:09 UTC (History)
8 users (show)

Fixed In Version: 5.11.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1672691 (view as bug list)
Environment:
Last Closed: 2019-12-13 15:09:13 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Embedded method in multiple domains (56.92 KB, image/png)
2018-10-11 16:05 UTC, William Fitzgerald
no flags Details

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


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