Bug 962841 - [as7] resource type admin pages missing some child services from as7 plugin
[as7] resource type admin pages missing some child services from as7 plugin
Status: ON_QA
Product: RHQ Project
Classification: Other
Component: Core Server (Show other bugs)
Unspecified Unspecified
high Severity high (vote)
: ---
: ---
Assigned To: John Mazzitelli
Mike Foley
Depends On:
Blocks: 962845
  Show dependency treegraph
Reported: 2013-05-14 10:42 EDT by Thomas Segismont
Modified: 2013-05-23 15:05 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 962845 (view as bug list)
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Thomas Segismont 2013-05-14 10:42:46 EDT
Description of problem:
Metric Collection Template screen does not show all metrics from as7 plugin

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

How reproducible:

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 15:49:11 EDT
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 15:50:47 EDT
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 15:54:24 EDT
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 16:36:26 EDT
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:

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

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 18:06:08 EDT
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 18:52:34 EDT
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">
       <parent-resource-type name="AAA" plugin="SkeletonPlugin"/>
       <parent-resource-type name="BBB" plugin="SkeletonPlugin"/>
   <service name="ZZZ" discovery="SamplePluginDiscoveryComponent" class="SamplePluginServerComponent" />

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 15:44:00 EDT
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 15:05:00 EDT
git commit to master: b335646

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