Friday, December 1, 2017

cqtool

Posted on 
  • Sent cqtool out for code review

Introducing cqtool

I have implemented a new script called cqtool. This is to replace the unsupported /opt/rational/clearquest/bin/cqtool which is going away as of Clearquest 7.0. UCMWB utilized IBM/Rational's cqtool to perform certain actions. Additionally, as per Erik's RANCQ00014935 request to enhance UCMWB to be able to create child WORs a tool needed to be developed to do that. So the new cqtool solves the following issues:
  • Provides a supported replacement for the following bits of UCMWB functionality:
    • Cloning of WORs (Right click: Continue work in Clone on a closed non-orphan WOR)
    • Creation of Helpdesk tickets (Tools: Submit Helpdesk Request)
  • Adds the following functionality:
    • Allows for creation of new WORs
    • Allows for linking of parent WOR to child WOR
Additionally, with the create WOR functionality, UCMWB can offer the ability to create a new, non parent/child WOR. Finally, as has been stated, with this new cqtool we don't have to worry about IBM/Rational's cqtool disappearing in CQ 7.0.

This is an involved process so I created this in a modularized fashion thus several Perl modules are involved. As per Ken's mandate, I am calling for a code review of what I have so far. Next I will hook this into UCMWB.

So far I have a cqperl script called cqtool. It relies on several Perl Modules, some of which I have added to Clearcase and our standard lib directory already (/cleartrig/ent/SNSD/muos/ccadm_tools/vobs/ranccadm/scripts/lib):

ModuleDescriptionLocation
DisplayModule for providing consistent outputstandard lib
CQToolHandles communications with Clearquest~p6258c/adm/lib
CreateWORUIUI for CreateWOR~p6258c/adm/lib
CreateHelpDeskUIUI for CreateHelpDesk~p6258c/adm/lib
Tk::MyTextSubclasses the Tk TextUndo
widget. This is used for the description fields in both CreateWOR
and CreateHelpDesk. The subclassing was necessary in order to
provide for a modified callback that allows us to tell when the
widget has text and thus can set the Submit button to active.
~p6258c/adm/lib

Additionally there is a cqtool script itself which is a command line interface/driver that was initially used to test the functionality provided in the above modules. It has been oriented to be the primary interface to this functionality. The thought is that UCMWB will fire up cqtool in the background at start up and then, if and when it's functionality is needed, UCMWB will feed commands to the already running cqtool.

When run interactively, cqtool prompts for a command. It will also read commands from $ARGV, execute them and exit. So, in a sense, cqtool works like cleartool.

If you type help at the prompt the following is displayed:

cqtool Version 0.9: Program to talk to Clearquest

Valid commands are:

createwor:   Create a new WOR
createhd:   Create a new Help Desk Ticket
clone <wor>   Clones a WOR
link <parent wor> <child wor> Link a parent WOR to a child
WOR
exit|quit:   Exits cqtool
help:    This display
usage:    Displays command line usage
version:   Displays version of cqtool

createwor and createhd both are Perl/Tk applications that interact with Clearquest and display a GUI that obtains the necessary and required fields to create a WOR or a Helpdesk ticket. Note, only the bare minimum fields are available. IOW I didn't implement the whole UI that Clearquest provides. Instead it's just enough to create the WOR or Helpdesk ticket.

cqtool pays attention to a few environment variables:
CQ_DBSET
Set to the dbset name of the Clearquest database to work with. For testing purposes set this to XTST3. Production would be RANCQ
CQ_USER
Name of the user to log in as. By default $USER is used. For testing purposes set this to "ccadm" (for the XTST3 database that is)
CQ_PASSWORD
Set to the password for CQ_USER. For testing purposes set this to "ccadm" (for the XTST3 database that is). If this is not set then cqtool prompts for a password.
So then, with the proper environment variables set one can:

$ cqtool help
cqtool Version 0.9: Program to talk to Clearquest

Valid commands are:

createwor:   Create a new WOR
createhd:   Create a new Help Desk Ticket
clone <wor>   Clones a WOR
link <parent wor> <child wor> Link a parent WOR to a child
WOR
exit|quit:   Exits cqtool
help:    This display
usage:    Displays command line usage
version:   Displays version of cqtool
or
$ cqtool createwor

Oh, where is cqtool? Well for now it's in ~p6258c/adm/cq/cqtool (libs in ~p6258c/adm/lib/*).

No comments:

Post a Comment

Posted on  November 23, 2005 Continued to help several users with connecting to the new Controller Clearquest Database for Vinh...