Bug 784953 - JON 3.01 RC#1 CLI samples ... usability issue with drift.js
Summary: JON 3.01 RC#1 CLI samples ... usability issue with drift.js
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: CLI
Version: JON 3.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER01
: JON 3.2.0
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 852145
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-26 18:57 UTC by Mike Foley
Modified: 2014-01-02 20:39 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Task
Embargoed:


Attachments (Terms of Use)

Description Mike Foley 2012-01-26 18:57:57 UTC
Description of problem:  CLI samples ... usability issue with drift.js


Version-Release number of selected component (if applicable): JON 3.01 RC#1


How reproducible:
100%


Drift.js (and the other samples) are really not usable out of the box.  A gap exists before the .js files can be used.   The scripts contain utility functions, but they are not runnable.  There should be some kind of wrapper that allows these to be utility functions to run.  Eliminating or reducing these barriers will help the customer experience, increase adoption, etc ..

Comment 1 Mike Foley 2012-01-30 16:25:55 UTC
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos

Comment 2 Lukas Krejci 2012-02-14 10:51:37 UTC
The proper solution is to implement the import mechanism that the scripts could use. I.e. something akin to http://requirejs.org (note that this is not that simple, because ideally, the mechanism should work both in the CLI proper and in the serverside CLI alert scripts - but requirejs has a pluggable script loader mechanism, so maybe we would be able to hook it up on the serverside with the scripts stored in RHQ repos).

A workaround might be to add ability to load multiple script files using the -f commandline option. This however would not be so user friendly anyway, because the user would need to know the requirements of the scripts upfront and specify them in the -f option in a specific order.

Comment 3 Charles Crouch 2012-02-15 00:14:39 UTC
Given Lukas' comment this is not going to be resolvable in 3.0.1. Resetting for *consideration* as part JON3.1.0.

Comment 4 Lukas Krejci 2012-03-22 15:05:34 UTC
Discussion of our options for implementing the script modularity: http://rhq-project.org/display/RHQ/Script+Modularity

Comment 6 Larry O'Leary 2012-11-27 20:12:57 UTC
This is an action/enhancement requested by QE to make testing easier. The support for modular/includes in the CLI appears to have been implemented in upstream bug 852145.

Resetting for triage in 3.2.0. Hopefully something useful will happen once we realize that this is already available upstream and just needs to be brought into the product.

Comment 7 Lukas Krejci 2013-01-30 16:25:39 UTC
In RHQ 4.6 codebase (or maybe already in RHQ 4.5.1 actually), the following has been done:

1) The scripts in the "samples" directory in the CLI distribution were left intact.
2) A new subdirectory called "modules" was added under "samples", which contains the "modularized" versions of the scripts in samples.
3) The modularized version of drift.js can be loaded in the CLI by issuing the following command:
var drift = require("modules:/drift")
4) The functions from the drift.js file are then available through the "drift" variable in the example above.

Note that the the location from where the "modules:/..." scripts are loaded is configurable and defaults to $CLI_HOME/samples/modules. It can be changed by passing a different path using "rhq.scripting.modules.root-dir" system property.

I.e. starting the CLI like:
RHQ_CLI_ADDITIONAL_JAVA_OPTS="-Drhq.scripting.modules.root-dir=<ABS_PATH>" $CLI_HOME/bin/rhq-cli.sh

will set the base path from where the modules are loaded (using the "modules:/" path prefix) to the <ABS_PATH>

(no code change here, so setting the status to ON_QA straight away)

Comment 8 Larry O'Leary 2013-09-06 14:32:31 UTC
As this is MODIFIED or ON_QA, setting milestone to ER1.

Comment 9 Mike Foley 2013-09-13 19:43:14 UTC
verified 


unconnected$ var drift = require("modules:/drift")

unconnected$ drift.

createSnapshot   diff             fetchHistory
unconnected$ drift.


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