Tuesday, March 17, 2009

Base ClearCase and ClearQuest Integration

Base ClearCase and ClearQuest Integration

 

There are 2 ways to use ClearCase, UCM and Base ClearCase. Both usage patterns can integrate with ClearQuest. In this post, the mainly integration steps between Base ClearCase and ClearQuest will be covered. Below are the steps to enable the CQ and CC integration from scratch,

 

a. In ClearCase side, Create a ClearCase VOB and mount it.

 

b. Create views , edit the config spec  if need to view and upload source codes.

 

c. In ClearQuest, setup schema repository and create one production user database.

 

d. In the CQ designer, apply ClearCase 1.0 package and enable the package to the CQ record type. The package can be applied to any state entity and all those entities can be used to associate with ClearCase versions.

 

e. Check in the schema and upgrade the user database.

 

f. Start configuring the integration. In the Base CC and CQ integration, ClearQuest Integration Configuration tool is used to configure the integration settings instead of ClearCase Project Explorer which is used for the UCM CC and CQ integration. Here are the main steps to setup the settings.

  1. Open ClearQuest Integration Configuration tool  
  2. Specify the VOB which need to enable the integration
  3. Specify Checkout Policy. (Table 1)
  4. Specify Checkin Policy. (Table 2)
  5. Specify Type Restrictions. (Table 3)
  6. Specify Element Type Restrictions. (Table 4)
  7. Specify Trigger Selection for different platform. (Table 5)
  8. Specify ClearQuest Record Type. Only one record type can be specified here.If the trigger type is V2-Perl, multiple record types which have applied CQ package “ClearCase 1.0” can be used for the integration but need to specify those record types in configure.pl.

 

g. Edit config.pl to specify the CQ connection and User DB. (Table 6)

 

The configuration file contains parameters that define local policy choices and how to access Rational ClearQuest user database. The configuration file is located under

ccase-home-dir\lib\CQCC\config.pl.

 

Define the Rational ClearQuest user database and database set

CQCC_DATABASE_SET- to define the db set value

CQCC_DATABASE_ENTITY_LIST- to define the record types to associate with the CC changes.

For example,

&SetConfigParm("CQCC_DATABASE_SET", "CQCONNECTION");

&SetConfigParm("CQCC_DATABASE_ENTITY_LIST ", "DBNAME: entity1,entity2");

 

Customize CQSchema object

It accomplishes the following tasks:

Defines a new CQSchema and provides a set of similar record types and properties.(DefineCQSchema)

 

    $s = &DefineCQSchema(NAME=>"MainSchema",

                         ENTITY_LIST => "entity1,entity2",

                         RESTRICTIONS => "STANDARD");

 

Relates the field names of the defect record type to those used by the record types that you specify. (ChangeFieldMap). If multiple record types are used, the field names in the mapping must be present in all record types.

 

    $s->ChangeFieldMap(OWNER => "Owner",

                       STATE => "State",

                       ID => "id",  #Note: ID shouldn't need to change

                       HEADLINE => "Headline",

                       RATL_MASTERSHIP => "ratl_mastership",

 

                       # Other mappable names

                       QUERY_STATES => "Submitted,Assigned,Opened",

                       MODIFY => "modify"

                       );

Defines one or more queries(SetQuery) that are used by the trigger to provide the Query option that the developers see and specifies the final RESTRICTIONS check that is made before associations are made.

 

    $s->SetQuery("STANDARD",

                 "<OWNER> eq <*USER*>",

                 "<STATE> in <QUERY_STATES>");             

 

Defines the query output format

    $s->SetResultSet("STANDARD",

                     "<ID>,<STATE>,<HEADLINE>",

                     "%s %-9.9s %1.1s %1.1s %-45.45s");

 

Below changes in the config.pl can minim meet the requisite to run the Base CC and CQ integration. For the detailed specification of config.pl, you should read  

http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m1/index.jsp?rcss=isacc&topic=/com.ibm.rational.clearcase.int.doc/topics/cc_cq_int/default_topic.htm

 

h. use cqcc_launch -test to check the configuration

 

 

 

Table 1. Checkout Policy

Policy Settings

Comments

Never prompt the user for change requests

No need to associate CQ record when do check out action.

Prompt the user for optional change requests

Prompt the user to specify the CQ record to associate with the changes optional. Optional here means when system prompts the user to specify the CQ record, user can assign a CQ record to associate or not.

 

Table 2.  Checkin Policy

Policy Settings

Comments

Never prompt the user for change requests

No need to prompt user to specify the CQ record when user does check in action. If there is a CQ record has associate with the checked-out file, the change set will log into the CQ record after check in

Prompt user for optional change requests

Prompt user to specify the CQ record to associate with the changes optional.

If no CQ record specified, the function works as the setting “Never prompt the user for change requests”

If CQ record specified, log the changeset in this CQ record no matter the CQ record is same as the check-out one or not.

Prompt user and require

 one or more change request

Prompt the user to specify the CQ record to associate with the changes. Once the option is set, one or more CQ record must be associate with the changes.

If multiple CQ records selected,  log the changeset in each of the CQ record

 

Table 3. Branch Type Restrictions

Policy Settings

Comments

Policies apply to branches of all types

Apply the check out/in policies to all branch types.

Policies apply to branches of selected types

Apply the check out/in policies only to the selected branch types.

 

List 4. Element Type Restrictions

Policy Settings

Comments

Policies apply to branches of all types

Apply the check out/in policies to all element types.

Policies apply to branches of selected types

Apply the check out/in policies only to the selected element types.

 

 

Table 5. Trigger Selection

Policy Settings

Comments

V1-VisualBasic

Can be used only in Windows platform

V1-Perl

Can be used both in Windows and Unit/Linux platform

V2-Perl

The new version of V1-Perl. If V2-Perl is set, you have the following options.

  1. Use a local configuration file and local trigger scripts
  2. Use a shared, centrally located configuration file and local copies of trigger scripts
  3. Use a shared, centrally located configuration file and shared trigger scripts. (set the option “Use the trigger scripts in Path directory” and place the cqcc_launch.bat/pl in the same directory of config.pl

 

 

Table 6. Variables in confige.pl

Configuration parameter

Description

CQCC_ASSOC_BATCH_CONFIRM

Displays a window that confirms that the batch completed successfully.

CQCC_ASSOC_BATCH_ENABLE

Allows delay in processing multiple Rational ClearQuest association transactions until end of single Rational ClearCase operation or user-defined batch

CQCC_ASSOC_BATCH_SERIES

Specifies that a user-defined series is active and normal Rational ClearCase series-end processing should be suppressed

CQCC_AUTO_ASSOCIATE

Sets one or more change requests for automatic association on checkout and checkin without user interaction

CQCC_AUTO_ASSOCIATE_ENABLE

Specifies whether developers can use CQCC_AUTO_ASSOCIATE

CQCC_COMMENT_PATTERN

Sets pattern by which developers can make associations in a checkout or checkin comment

CQCC_CQWEB_ONLY

Forces use of Rational ClearQuest Web interface

CQCC_CQWEB_VERSION

Specify either 2.0 (Java™) or "1.0" (ASP with IIS) as Rational ClearQuest Web server protocol

CQCC_DATABASE_ENTITY_LIST

Defines logical name of database and related record types (entities) that support associations.

CQCC_DATABASE_SET

Database set name (connection) for one of multiple schema repositories; used with CQCC_DATABASE_ENTITY_LIST

CQCC_DEBUG

Controls level of output generated for problem diagnosis; 0 (none), 1 (basic), 2 (verbose)

CQCC_GUI_ENABLE

Allows use of Perl/TK graphic user interface

CQCC_LOG_OUTPUT

Records to a log file messages for problem diagnosis

CQCC_MULTIPLE_ASSOCS

Allows or prevents multiple defects to be associated with change

CQCC_MULTISITE

Enables Rational ClearCase MultiSite support

CQCC_POSTCHECKIN_COMMIT

Allows commitment of associations in Rational ClearQuest user database to be delayed until checkin completes in Rational ClearCase VOB

CQCC_QUERY_ENABLE

Allows developer-selected queries for making associations

CQCC_QUERY_FILTER

Controls which queries are presented to developers for associations

CQCC_RESTRICTIONS_TIMEOUT

Specifies number of seconds that a restrictions check can be reused during batch processing

CQCC_SERVER

Name of Rational ClearQuest Web server

CQCC_SERVERROOT

Name of folder in which Rational ClearQuest Web server is located

CQCC_SERVER_SSL

Enables secure communications for the Rational ClearQuest Web connection.

CQCC_TIMER

Allows recording of internal timing data

CQCC_WEB_DATABASE_SET

CQCC_DATABASE_SET for Web server

CQCC_REPLICA_NAME

For Rational ClearQuest Web client to specify user database replica name

 

 

 

The Main Difference between UCM/Base ClearCase and ClearQuest Integration

The Main Difference between UCM/Base ClearCase and ClearQuest Integration

 

  1. In Base CC and CQ integration, it is in VOB lever. In UCM CC and CQ integration, it is UCM Project Lever.

 

  1. In Base CC and CQ integration, the configuration is more flexible. Once the VOB has enabled CQ  and CC integration, it also can configure the check-out/in policies and can specify which branch type or element type use the policies settings. In UCM CC and CQ integration, all changes in that UCM project must associate with CQ items. In other words, Base CC and CQ integration, it is a loose integration while it is more close in UCM CC and CQ integration.

 

  1. In Base CC and CQ integration, one change/version can associate multiple CQ records but it does not in UCM CC and CQ integration.

 

  1. In Base CC and CQ integration, same CQ record can use in different branches while in UCM CC and CQ integration, same CQ record can only work on one stream.

 

  1. In Base CC and CQ integration, it can use the web interface to do integration without any CQ client installed while in UCM CC and CQ integration, it is a must to install the CQ client.

 

 

To use which type of integration mainly depends on the model you use the CC. In most cases, UCM is more easy/standard process to use compared with Base ClearCase. In UCM model, user do not need to know more details about the CC working mechanism itself like, config spec, branch, element type and others but only need to know the relationship between view,stream,integration stream and know when to deliver, merge, rebase.

 

Monday, March 9, 2009

Usage of Config Spec

Usage of Config Spec
Config Spec is used to select file versions based on the rules defined in that configuration. It is a must to know if base ClearCase pattern is used. Below is the detailed usage of Config Spec.