Bug 1119781

Summary: runtime name provided for deployment child creation overrides application name and path
Product: [JBoss] JBoss Operations Network Reporter: Armine Hovsepyan <ahovsepy>
Component: Plugin -- JBoss EAP 6Assignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: unspecified    
Version: JON 3.3.0CC: ahovsepy, jshaughn, mfoley, tsegismo
Target Milestone: DR01   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:02:48 UTC 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: 1070326    
Attachments:
Description Flags
testhello-conf
none
app_config
none
app-in-eap-console
none
testhello-in-eap-console
none
app-path
none
testhello-path
none
testhello-runtime-name
none
eap-runtime-name
none
runtime-name-gui none

Description Armine Hovsepyan 2014-07-15 13:41:09 UTC
Created attachment 918160 [details]
testhello-conf

Description of problem:
runtime name provided for deployment child creation overrides application name and path 

Version-Release number of selected component (if applicable):
RHQ 4-12 master (not a regression)

How reproducible:
always
reproduced for EAP-6.0 and EAP-6.2.0

Precondition: JON is installed, EAP inventoried to JON

Steps to Reproduce:
1. Install an app  (helloworld-2.0.war) from EAP admin console and give a runtime name as helloworld-2.1.2.war
2. Run auto-discovery scan to get latest EAP app discovered 
3. Create child resource under EAP with Deployment type
4. Upload helloworld-2.1.war and give a runtime name - testhello.war (or anything)
5. Run auto-discovery to get helloworld-2.1.war discovered

Actual results:
After step2. helloworld.war is discovered, path in connection settings is helloworld-2.0.war, runtime name (in config) is helloworld-2.1.2.war as in admin console
After step5. testhello.war is discovered, path in connection settings is testhello.war, runtime name (in config) is testhello.war. Same in admin console


Expected results:
After step2. helloworld.war is discovered, path in connection settings is helloworld-2.0.war, runtime name (in config) is helloworld-2.1.2.war as in admin console

After step5. helloworld.war is discovered, path in connection settings is helloworld-2.1.war, runtime name (in config) is testhello.war and in admin console

Additional info:
In EAP admin console, runtime name *should* be ${war_name}-${additiona_data}.war
screen-shots attached

Comment 1 Armine Hovsepyan 2014-07-15 13:43:01 UTC
Created attachment 918161 [details]
app_config

Comment 2 Armine Hovsepyan 2014-07-15 13:43:37 UTC
Created attachment 918162 [details]
app-in-eap-console

Comment 3 Armine Hovsepyan 2014-07-15 13:44:31 UTC
Created attachment 918163 [details]
testhello-in-eap-console

Comment 4 Armine Hovsepyan 2014-07-15 13:44:57 UTC
Created attachment 918164 [details]
app-path

Comment 5 Armine Hovsepyan 2014-07-15 13:45:41 UTC
Created attachment 918165 [details]
testhello-path

Comment 6 Armine Hovsepyan 2014-07-15 13:50:02 UTC
Created attachment 918177 [details]
testhello-runtime-name

Comment 7 Jay Shaughnessy 2014-07-22 14:47:40 UTC
The runtime name specified in RHQ basically affects the deployment as if that were the name of the archive being deployed.  Given that fact, the results are as expected, the runtime name "testhello.war" is not a versioned name, and therefore is not treated as a versioned deployment.

The only question I have is whether we are treating the runtime name correctly when it is provided by the user. I'm not 100% clear how runtime name is supposed to be work with respect to the archive name.  We need more info from an EAP/AS7 plugin expert.  Asking for more info from Thomas...

Comment 8 Thomas Segismont 2014-07-23 09:33:51 UTC
Just checked, the problem is in org.rhq.modules.plugins.jbossas7.BaseComponent#runDeploymentMagicOnServer

Whether the user gave a runtime name or not, we create the deployment node with the runtime name:

Operation step1 = new Operation("add", "deployment", runtimeName);

Comment 9 Jay Shaughnessy 2014-07-24 13:26:20 UTC
Comment 8 is spot on by Thomas.  I made the change and testing looks good. The deployment is now versioned as expected and the resource configuration reflects the proper runtime name.

master commit 5ab4508f13815c5a88e53d49513786b1d981abad
Author: Jay Shaughnessy <jshaughn>
Date:   Thu Jul 24 09:17:45 2014 -0400

    Use the deploymentName as appropriate, the runtimeName should be an attribute
    on the deployment and can be the same on multiple deployments, the
    deploymentName must be unique among deployments.

    -- incidental: several logging auto-formatting changes.


release/jon3.3.x commit 0a4c817f23e9f47c8dcd5ee58f5386c0865e8eed
Author: Jay Shaughnessy <jshaughn>
Date:   Thu Jul 24 09:25:10 2014 -0400

    Cherry-pick of master 5ab4508f13815c5a88e53d49513786b1d981abad

Comment 10 Simeon Pinder 2014-07-31 15:52:02 UTC
Moving to ON_QA as available to test with brew build of DR01: https://brewweb.devel.redhat.com//buildinfo?buildID=373993

Comment 11 Armine Hovsepyan 2014-08-04 16:05:38 UTC
Created attachment 923947 [details]
eap-runtime-name

Comment 12 Armine Hovsepyan 2014-08-04 16:06:12 UTC
Created attachment 923948 [details]
runtime-name-gui

Comment 13 Armine Hovsepyan 2014-08-04 16:06:53 UTC
verified
thank you