Skip to main content

Simplify UCM delivery for IBM Rational ClearCase in a UNIX environment

Step-by-step instructions for application developers

Joydipto Banerjee (joydipto.b@in.ibm.com), Advisory System Analyst, IBM
Joydipto Banerjee
Joydipto Banerjee graduated from National Institute of Technology in Silchar, India, with a Bachelor of Engineering in Computer Science degree. He has extensive experience with analysis, design, and development of UNIX-based applications in a ClearCase environment, both base and UCM. Joydipto is an IBM Accredited Senior IT Specialist and is working as part of IBM’s project BigGreen at Research Triangle Park, North Carolina, in the United States.

Summary:  This article describes a practical approach to simplify the process of making a delivery in an IBM Rational ClearCase environment for the UNIX system by following some of the best practices in the field. The techniques described and the hints and tips are helpful for application developers, for whom this is a common yet critical part of the software development process.

Date:  06 Aug 2009
Level:  Introductory
Activity:  2896 views

Introduction

This step-by-step guide describes how to deliver your work in an IBM® Rational® ClearCase® Unified Change Management (UCM) development environment that is running on the UNIX® platform. Delivering changes or additions to an integration stream is a critical operation in any project, but it assumes more significance when developers are accessing the same code base from different locations. This guide for application developers can serve as a reference in any project and will be helpful at both the beginner and the intermediate levels.

Note:
If your project uses IBM® Rational® ClearCase MultiSite®, you must use a different method for your activities. Please consult your ClearCase project administrator in that case. See About deliveries in a Rational ClearCase MultiSite project for a brief overview. More details are available from ClearCase documentation and the Help section that is available within the software.

Prerequisites

This article is based on the assumption that readers know basic ClearCase UCM concepts and operations from a developer's point of view. If you are not familiar with ClearCase UCM, you can review documentation and the tutorial in your version of Rational ClearCase. You might also consider taking the Web course, "SCM215: Essentials of IBM Rational ClearCase UCM for Developers" (see Resources for a link to the catalog of all courses).

Overview of tasks

In a Rational ClearCase multistream development environment, if you want to make your work visible to others working on the project and to make the work part of the final deliverable, you need to deliver your activities to the project's shared integration area. To do that, you will complete these tasks:

  1. Rebase to the latest recommended baseline
  2. Rebuild the entire system
  3. Make sure that no one else is delivering simultaneously
  4. Deliver your work to the integration stream
  5. Compile everything and complete the delivery
  6. Inform the team of the delivery

Rebase to the latest recommended baseline

As a first step, a rebase operation needs to be performed before making a delivery. A rebase operation to the project's latest recommended baseline brings the developer's stream up-to-date with the last successful code in the integration stream (or what has been delivered until that point). Because a rebase operation cannot start from a view that has checked out files, make sure that everything is checked in to your development view. Or, if you prefer disregarding your changes, cancel the checkouts.

To see the list of files and directories that are checked out to your development view, type this command:

cleartool lscheckout -cview -me

To start the rebase operation, use one of the following methods after accessing your development view:

  • At the system prompt type:

    cleartool rebase -graphical

  • In the ClearCase window, select the menu item "Rebase ..." and the following window opens.

Figure 1. Rebasing to the project's recommended baseline
Rebase Stream Preview screen

The recommended baseline is shown by default. If this is not what you expected or if you believe that a different baseline exists, then make a selection by clicking the "Advanced" button. Next, make sure a view is selected. Select your own development view in the list and click OK. To start the rebase operation, click OK.

During a rebase operation, merging of files from the integration stream to your development stream can occur if there is a difference between the code base on the project's integration stream and your development stream since the last rebase. Rational ClearCase performs all nonconflicting merges of files and directories that are ClearCase elements.

If for a particular file the same lines have been updated on both streams, then during the rebase operation, a merge conflict is encountered and the merge editor opens for you to resolve the conflict by selecting the required lines.

After the conflict is resolved, the rebase operation continues to completion, although there can be more merge conflicts that will need to be resolved.

Important:
Do not press Complete yet.


Rebuild the entire system

  1. Keep the rebase window, without clicking the Complete button.
  2. In a separate terminal window, enter into your development view, and run the following two commands:

    clearmake clean

    which erases all cache directories and temporary files (such as object files).

    clearmake all

    which rebuilds the project

If the compilation fails, you need to find the error and where your code changes are not compatible with those in the baseline version. The most probable causes are accidental inclusion of unwanted characters in the source files during the merge, a missing symbolic link, not making new files or directories as versioned object base (VOB) elements, or even incorrect selection of a piece of code during manual resolution of merge conflicts. Generally, these errors are quite easy for a developer to spot.

If the compilation succeeds, finish the rebase operation by clicking Complete. If you had closed the Rebase window, reopen it by selecting Rebase again and choosing Resume.

If you need to back out of the rebase operation -- that is, to undo or abort it -- access your development view and, at the system prompt, type this command to cancel the checkouts performed during the rebase operation and remove all merge arrows:

cleartool rebase –cancel

Note:
Unless you click the Complete button, the ClearCase files that were altered during the rebase operation remain in a checked-out state.

Tips:

  • Frequent rebasing causes your development work to be introduced in smaller chunks, rather than in one big chunk. This reduces the number of merges and also helps to identify integration problems early.
  • Do not deliver anything to the integration stream unless you are absolutely certain that everything compiles on your developer substream.

Make sure that no one else is delivering simultaneously

After the rebase operation is finished, you can proceed with the delivery operation. Make sure that you have exclusive access to the integration stream before you start the delivery. It is important that no one else is delivering their work to the integration stream while your delivery is in progress. One way to ensure this is to write a trigger on the integration stream that will lock the stream until the delivery finishes. Another option is to set a flag that reserves the delivery operation on the project's internal wiki or intranet and send e-mail to all of the developers, notifying them to delay their deliveries until yours is complete.

Tip:
If more than one person is working on the same feature, task, or problem, it is a good idea to share a stream and work on individual views in the stream. This way, developers can share their changes instantly just by checking in their files.


Deliver your work to the integration stream

During this process you are updating the project's integration stream with the work that you did on your development stream. In projects where multiple deliveries are performed before a baseline is created, you are actually appending your work to the integration stream after what others delivered since the latest recommended baseline. This introduces the possibility that new merges might be required that were not encountered during the rebase operation. However, the chance of this happening can be minimized if several builds are done during the day.

  1. To deliver your work to the integration stream, use either of these methods:
  • At the system prompt, access your development view and type:

    cleartool deliver -graphical

  • In the ClearCase window, select the menu item Deliver from stream > To Default.

The default target is the parent of your development stream. This is the normal practice for most project policies.

In the delivery process, you have the option of choosing to deliver your work by specifying one or more activities or baselines to be delivered. Accordingly, the delivery operation identifies the activities or the baselines that are candidates and shows them in the Deliver Preview window (see Figure 2).


Figure 2. Delivering your work to the integration stream
Deliver Preview view

  1. In a single-project environment, you will usually be working on activities and delivering them after completion. You can select or clear these activities as necessary, but make sure to take care of any dependencies among the activities when you make a selection.
  2. Check that the "Delivering to Target" information, namely the project, the stream, and the view where the activities will be delivered, is correct.
  3. Click OK to start the deliver operation. The progress information is displayed. As with the rebase operation, solve merge conflicts as they are found.

At the end of all merges, the following message is displayed: "The changes will not be made permanent until you click on the 'Complete' button below."

Important:
Do not click Complete yet.


Compile everything and complete the delivery

Now it is time to compile the entire project again. Doing so ensures that the new merges that took place during the delivery operation did not introduce any accidental errors and does not cause the build to fail on the integration stream. You cannot deliver something that cannot compile and build properly.

  1. In a separate terminal window, select an integration stream view (not your development view) and run a command:

    clearmake all

  2. If there are any compilation or integration problems, then these issues need to be resolved before completing the delivery. Fixes involving any trivial changes may be done in the integration stream itself. Incase of any major changes, the same should be done in the developer's stream and the deliver operation should be cancelled. Any source code or files required to fix these compilation problems should be communicated to the entire team, especially to the respective file owners.
  3. After the entire project compiles successfully, click on Complete.

How to stop a Deliver operation

As with the rebase operation, any time before completing the delivery, you can choose to undo the changes already made during the operation. However, you must not have checked in any files in the target stream if you want to cancel the delivery. To undo the delivery:

  1. If the Deliver Progress window is open, click Cancel.
  2. From your development view, type this command:
    cleartool deliver -cancel

This enables you to safely back out of the delivery by cancelling all of the checked-out files in the integration view and removing all of the merge arrows.

You will then see this message: "The Deliver operation was done successfully."

Note:
As in the rebase operation, unless Complete is selected, the ClearCase files that changed during the delivery operation remain in the checked-out state.

Tips:

  • Activities should not be reused after a delivery operation. Instead, create a new activity with the same name as the previous one, but add _1_ near the end.

    For example:
    [UserID]_[FeatureName]_[TaskName] _1_actv

  • Delete the temporary snapshot view when you are finished with it. Your machine resources are heavily burdened if you have a large number of views.

Inform the team of the delivery

Alternative: Deliver to a developer's stream

If you are not ready to deliver to the integration stream but a colleague requires your changes to proceed with his or her own work, you can deliver the files directly to your coworker's stream:

  1. Check in your files, or at least what belongs to the activity that you want to deliver.
  2. Make sure that your colleague has also checked in everything in his or her view.
  3. Select Deliver to alternate target.
  4. Select the stream.
  5. Click OK.
  1. After the successful delivery, send an e-mail message with exact information to the entire development team and the Release Manager. This e-mail should contain information about:
    • The feature that you have implemented.
    • Major merge conflicts and the files that were changed, if any
  2. If you had set a flag for reserving the delivery operation on the project's internal wiki or intranet, release the flag to give others the opportunity to deliver their work.

Depending on the complexity of the feature or the volume of code changes introduced during this delivery, the Release Manager might want to either make a new recommended baseline for the project before the next delivery or allow the next delivery to take place on the same baseline.

In some project scenarios, a script might also run in the background that automatically advances the project's recommended baseline after a delivery.


Resources

Learn

Get products and technologies

Discuss

About the author

Joydipto Banerjee

Joydipto Banerjee graduated from National Institute of Technology in Silchar, India, with a Bachelor of Engineering in Computer Science degree. He has extensive experience with analysis, design, and development of UNIX-based applications in a ClearCase environment, both base and UCM. Joydipto is an IBM Accredited Senior IT Specialist and is working as part of IBM’s project BigGreen at Research Triangle Park, North Carolina, in the United States.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=418031
ArticleTitle=Simplify UCM delivery for IBM Rational ClearCase in a UNIX environment
publish-date=08062009
author1-email=joydipto.b@in.ibm.com
author1-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers