Bug 962841

Summary: [as7] resource type admin pages missing some child services from as7 plugin
Product: [Other] RHQ Project Reporter: Thomas Segismont <tsegismo>
Component: Core ServerAssignee: John Mazzitelli <mazz>
Status: ON_QA --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.7CC: hrupp, mazz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 962845 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 962845    

Description Thomas Segismont 2013-05-14 14:42:46 UTC
Description of problem:
Metric Collection Template screen does not show all metrics from as7 plugin

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

How reproducible:
Always

Steps to Reproduce:
1.Open the Administration > Metric Collection templates page
  
Actual results:
Some as7 plugin metrics are missing (for example all metrics from child services of the JVM service)

Expected results:
All metrics should appear and the user should be able to define its own values

Comment 1 John Mazzitelli 2013-05-16 19:49:11 UTC
In fact, not just the metrics are missing, the the child services themselves are missing from the tree.

This is not just a problem in the metric template admin page, its all the admin pages with resource types - like Alert Definition Templates, Drift Def Templates and Ignore Resource Types.

Comment 2 John Mazzitelli 2013-05-16 19:50:47 UTC
renamed the title of this issue - i'm also not sure its isolated to just the AS7 plugin. I think this is a generic issue that could happen for any plugin.

Comment 3 John Mazzitelli 2013-05-16 19:54:24 UTC
Look at "JVM" and "webservices" types as examples where the resource type admin pages don't show any child service types but there should be.

Comment 4 John Mazzitelli 2013-05-16 20:36:26 UTC
I don't know if this has anything to do with it, but staring at the descriptor looking for anything in common with the "bad" types, I noticed in all but one type that has child services and this:

    <runs-inside>
      <parent-resource-type name="Profile" plugin="&pluginName;"/>
      <parent-resource-type name="JBossAS7 Standalone Server" plugin="&pluginName;"/>
    </runs-inside>

they are "bad" (in the sense they don't show their child services in the tree). There is one that does - "CMP" - but I'm wondering if "the first one" is OK but the remaining go bad.

Comment 5 John Mazzitelli 2013-05-16 22:06:08 UTC
This isn't specific to the AS7 plugin. It just so happens the AS7 plugin has a hierarchy that exposes a bug in the GWT code. 

I believe the error is in:

org.rhq.enterprise.gui.coregui.client.admin.templates.ResourceTypeTreeNodeBuilder.ResourceTypeTreeNodeBuilder(ListGrid, ListGrid, TreeGrid)

I'm still doing some debugging, but I think the problem is in here.

Note: if you look, the resource type hierarchy is fine under the "JBossAS7 Host Controller" server. Its only under the "JBossAS7 Standalone Server" type where things are missing.

I think its because there are types in here with multiple parents - the type shows up under one parent, but not under the other parents.

Comment 6 John Mazzitelli 2013-05-16 22:52:34 UTC
ok, I just replicated this very easily - in fact, this also illustrates a second issue that didn't show up with the AS7 plugin types. Take the etc/samples/skeleton-plugin and change its descriptor so its types look like this:

<server name="AAA" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent" />
<server name="BBB" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent" />
<service name="YYY" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent">
   <runs-inside>
       <parent-resource-type name="AAA" plugin="SkeletonPlugin"/>
       <parent-resource-type name="BBB" plugin="SkeletonPlugin"/>
   </runs-inside>
   <service name="ZZZ" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent" />
</service>

This mimics what the AS7 plugin does. Deploy the skeleton plugin and look at the resource type admin pages - type AAA shows child service ZZZ (in fact, it shows two of them, which is the second problem I don't see in the AS7 types) but type BBB does not show child service ZZZ.

Comment 7 John Mazzitelli 2013-05-20 19:44:00 UTC
The main problem here is that we render the resource types as a SmartGWT Tree, but the data we have isn't really a Tree, its a Graph (with multiple parents).

We need to re-implement the "Servers" UI component (the third area at the bottom of the resource type admin pages) so it renders the data as a graph, not a tree.

Will need to investigate if SmartGWT has a graph ui component that we could use.

Comment 8 John Mazzitelli 2013-05-23 19:05:00 UTC
git commit to master: b335646