" /> Status for Andrew DeFaria: October 2007 Archives

« September 2007 | Main | November 2007 »

October 17, 2007

Blocking/Modal cqtool/Perl statndards

  • With the help of some GD folks who know Qt, got a modal/blocking cqtool working. Had to subclass the QProcess class and interject an eventloop, returning on the cqtool process terminating only.
  • Attempting to get cqtool running in the background and feeding it commands. This will require changing the CQProcess eventloop to look for the end of a cqtool command and it's prompt. It will also need to handle returning output.
  • Attended meeting regarding Perl standards

October 12, 2007

UCMWB enhancements/Helpdesk Tickets

  • Added CreateWOR button and hooked it so that we can now create WORs in UCMWB (from File: Create New WOR or the Create WOR toolbar button)
  • Added multiselection to View browser
  • Enhanced Delete View to be Delete View(s) and to iterate over the selected views deleting them. Need to clean up the display of change sets and view private files when more than one view is selected.
  • Worked with Judy regarding RANCQ00017440: Update RanSimcello Switcher config spec for P4.0.24
  • Closed tickets:
    • RANCQ00016665: UEH Tools Based on 4.0.6 versus 4.0.24 Config Spec
    • RANCQ00016964: RoseRT does not open

October 10, 2007

cqtool

  • 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):

Module
Description
Location
Display
Module for providing consistent output standard lib
CQTool
Handles communications with Clearquest ~p6258c/adm/lib
CreateWORUI UI for CreateWOR ~p6258c/adm/lib
CreateHelpDeskUI UI for CreateHelpDesk ~p6258c/adm/lib
Tk::MyText Subclasses 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/*).

October 09, 2007

cqtalk

  • Fixed issue with clone. Was core dumping cqperl. Should not be calling cloneWor unless the WOR is in a closed state. Changed code to check that the WOR is closed before attempting call to FireRecordScript for cloneWor.
  • Resolved issues with cqtalk's createwor and createhd Perl/Tk apps. They used to blow up when run a second time. Turns out you need to make sure you destroy and undef all global objects first.
  • Fixed issue with link option. Turns out that if we hit an error say getting an entity, because it was provided to use incorrectly (say typo), then even though we are using eval to trap this error, internal state of the session variable gets screwed up. The workaround is to re-establish the session by closing and re-opening the database. Time consuming but it works.

October 03, 2007

CreateWOR: Subclassing TextUndo

  • Added onChange like callbacks to CreateWOR's text field and text widget. This required subclassing the TextUndo class and properly handling the call back.

Subclassing TextUndo

This is not working exactly as it should. I can't seem to store things like the onChange callback and a scalar representing the contents of the TextUndo widget in the new MyText object. I rely on overriding the methods InsertKeypress, insert, delete and replace in order to trap when modifications are made to the text, changing the $text member and to call the appropriate callback, but the object that's passed in is different than the object as it was in new and member variables for $text and $modified_CB are missing! So instead I use a package global but this means that only one, the same one, $modification_CB is used for all instantiations of MyText and the $text variable doesn't work at all. Instead one must call get_text in the &$modified_CB:

# Subclass TextUndo widget to trap and call subroutine when text changes
package Tk::MyText;
  use Tk::TextUndo;

  use base qw/Tk::TextUndo/;

  Construct Tk::Widget "MyText";

  my $modified_CB;

  sub new {
    my $class	= shift;
    my $self	= shift;
    my %parms	= @_;

    $modified_CB	= delete $parms{-modified}	if $parms{-modified};
    $self->{text}	= delete $parms{-text}		if $parms{-text};

    $class->SUPER::new ($self, %parms);
  } # new

  sub get_text {
    my $self = shift;

    return $self->{text};
  } # get_text

  sub InsertKeypress {
    my $self = shift;

    $self->SUPER::InsertKeypress (@_);
    $self->{text} = $self->get ("1.0", "end");
    &$modified_CB ($self) if $modified_CB;
  } # InsertKeypress

  sub insert {
    my $self = shift;

    $self->SUPER::insert (@_);
    $self->{text} = $self->get ("1.0", "end");
  } # insert

  sub delete {
    my $self = shift;

    $self->SUPER::delete (@_);
    $self->{text} = $self->get ("1.0", "end");
    &$modified_CB ($self) if $modified_CB;
  } # delete

  sub replace {
    my $self = shift;

    $self->SUPER::replace (@_);
    $self->{text} = $self->get ("1.0", "end");
    &$modified_CB ($self) if $modified_CB;
  } # replace

October 02, 2007

CreateWOR

  • Created CreateWOR Perl/Tk application. This will be used by UCMWB
  • Checked in and symlinked the switch config area in /prj/muosran.
  • Investigating other symlinks such that our /prj/muosran area is using what's checked into Clearcase.