About this plugin

This plugin adds a new ClearCase UCM baseline SCM mode to the projects: It's then possible for a build to start based on a ClearCase UCM baseline (composite or not) without playing with config specs or having to modify the job configuration. When using the ClearCase UCM baseline SCM mode, the user will be presented with the following screen when starting a new build:

After having clicked on the Build button of this screen, a new view will be created to retrieve the whole content of the selected baseline and the job will be able to work on this data, as usually.

A use case behind this plugin

Let's say your development team is using Hudson as their continuous integration system while developing a new J2EE application. They have defined a new job in Hudson, which runs twice a day (at noon and at night) to frequently ensure everything works fine. This job may do the following:

It deploys the application on a production-like application server (for example using the WAS Builder Plugin), ensuring everything is deployed properly (e.g. JDBC resources are available, etc.).

It triggers the execution of non-regression testing.

At one moment or another in this build-flow (depending on your point on view), it creates a new ClearCase baseline.

After some time, once the application has been extensively tested and when most of its functionalities are considered as ready-for-production, one of the baseline is promoted to the RELEASED level. It means your infrastructure team will gather this baseline and deploy on the production environment what has to be deployed.
Hey, minute, we're talking about deployment, right? Something has already been defined in the previously described job to do that! It has run many many times, so it can also surely be used to perform the deployment on the production environment, no? This is when the ClearCase UCM Baseline Plugin comes in: It allows you to reuse what has already been defined in Hudson but to work on promoted baselines rather than working on the HEAD revision.

User guide

There's not much to say here, refer to the inline help (the little question marks at the right of the jobs' configuration screen) to get detailed information:

Set the SCM to be ClearCase UCM baseline. You'll notice that it has no parameters (screenshot below).

If not already done, activate the This build is parameterized option.

Add one (and only one) ClearCase UCM baseline parameter and fill the various fields.

You're done!

Now, when starting a new build, the user will be offered with a drop-down list allowing him to chose one of the baselines based on the job's settings:

Some questions and their answers regarding the configuration of this plugin:

What if I define the SCM to be ClearCase UCM baseline but without adding the required parameter?The build will fail, explaining why.

What if I define the SCM to be ClearCase UCM baseline but adding more than one ClearCase UCM baseline parameter?The build will fail explaining why.

What if I don't set the SCM to be ClearCase UCM baseline but adding some ClearCase UCM baseline parameter?Here also, the build will fail explaining why.

What if I create a string parameter named ClearCase UCM baseline (using the ClearCase UCM baseline mode)?The build will fail, explaining why.

Roadmap

Known limitations

The plugin will not work when using it for a job which is not tied to a specific node: It won't be able to get the baselines list before the build is actually assigned to a node.

Version history

Version 1.7.4 (09/19/2011)

Implemented JENKINS-9074: A warning message is now displayed if both the Exclude element CHECKEDOUT and Use snaphost view options are checked

Version 1.5.1 (04/02/2010)

No config spec elements/load rules were generated for the selected baseline.

The config spec was not used.

Version 1.5 (03/29/2010)

Added a new Stream option to filter the displayed baselines (cf. HUDSON-6088).

Added a new Use update option to avoid recreating the view each time a new build is triggered (cf. HUDSON-6088 too).

Fixed HUDSON-6057: The plugin will try to start the node it is tied to if it is offline.

Fixed HUDSON-6029: The plugin will behave properly in a mixed Linux/Windows environment (e.g. the master being Linux and slaves being either Linux or Windows).

Fixed HUDSON-5877: Added a new error message to clearly show that the publishers (make baseline and make composite baseline) from the ClearCase plugin can't be used with the ClearCase UCM baseline SCM mode.

Version 1.4 (03/02/2010)

Added a new Use snapshot view option (activated per default).

The plugin now better handles '/' characters in front of PVOB names: If '/' is/was not specified, it will be automatically added.

The VOB parameter has been removed. If you get the following exception, you can safely ignore it:

ATTENTION: Skipping a non-existent field vob
com.thoughtworks.xstream.converters.reflection.NonExistentFieldException: No such field com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterValue.vob

The component root dir is now retrieved from the specified component; In earlier releases, the plugin assumed that the component root dir was identical to the name of component.

Version 1.3 (02/24/2010)

Upward compatibility with the 1.1.x versions of the ClearCase plugin (still supporting the 1.0.x versions).

Added a new Force rmview option: If the baseline selected for build #n is the same as for build #n-1 (and if the corresponding view still exists), by default the view won't be created/loaded again; Set this option to true so that the view gets recreated anyway.

Fixed an issue which was displaying an incorrect view name in builds' history.

Version 1.2 (02/08/2010)

Added a new CLEARCASE_BASELINE environment variable.

Version 1.1 (01/22/2010)

Added a new Restrict folders to field which allows defining which folders have to be actually downloaded from the ClearCase UCM baseline.

Version 1.0.1 (01/11/2010)

Fixed an issue which was preventing to display the list of the baselines when the job was running on a tied slave node

Version 1.0 (01/10/2010)

48 Comments

Started by user lmcpare
Building remotely on camox224
FATAL: hudson.plugins.clearcase.util.BuildVariableResolver.(Lhudson/model/AbstractBuild;Lhudson/Launcher;)V
java.lang.NoSuchMethodError: hudson.plugins.clearcase.util.BuildVariableResolver.(Lhudson/model/AbstractBuild;Lhudson/Launcher;)V
at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterValue$2.setUp(ClearCaseUcmBaselineParameterValue.java:154)
at hudson.model.Build$RunnerImpl.doRun(Build.java:126)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
at hudson.model.Run.run(Run.java:1198)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:122)

Unknown User (vrspraveen.atluri@gmail.com)

I downgraded the ClearCase Plugin to 1.0.x but still getting the same error. It is unable to read parameters in the build. below is the exception I am seeing when starting the build.Started by user anonymous
ln failed: -1
Parsing POMs
ERROR: No such file /home/svcwps/.hudson/jobs/util-services/workspace/$

OK, so apparently this is not due to the plugin: Seems that the job you are building doesn't replace ${CLEARCASE_VIEWPATH} and ${CLEARCASE_VIEWNAME} with their actual values. I can't help on that since I don't use Maven, but try replacing the variables with their actual values.

NB: I've released a new version of the plugin which should work fine with CC plugin 1.1

The plugin does use snapshot views (which are recreated all the time unless you don't use the new Force rmview option), that's why it's doing cleartool rmview and then cleartool mkview.
The plugin currently (as of 1.3) doesn't support dynamic views.

Your issue is related to the content of the generated config spec:

element //vob/MP2/UTILS/... cUTILS_INITIAL
...
load //vob/MP2/UTILS

==> There are two slashes before vob ==> The job is not properly set up.

Unknown User (vrspraveen.atluri@gmail.com)

1) Force rmview option is making no difference. Anyways It is trying to remove and recreate the view all the time

2) when It is recreating the view It is trying to create the dynamic view as -snapshot option is missing in the below command.workspace $ cleartool rmview -force praveen_test_view_hudsonworkspace $ cleartool mkview -tag praveen_test_view_hudsoon praveen_test_view_hudson

Unknown User (vrspraveen.atluri@gmail.com)

Unknown User (jl.pinardon)

I am currently evaluating Hudson in my company, and more specifically its integration features with ClearCase and UCM.
Our configuration is :

Hudson : 1.347

ClearCase Plugin : 1.1.1

UCM Plugin : 1.3

I am currently trying to configure the UCM Baseline plugins, and particularly on the fields to fill in the Add Parameter Section. Unless I have missed something, I think there are some issues :

It seems the the pVOB must be entered with its heading /, but not the component vob tag.
For example, if the vob tag is /myvob and I enter it as is, the generated config spec shows 2 /, i.e. //myvob.IMHA, the component vob tag and the pVOB vob tag should be treated equally.

The component field waits for the component name.
But it appears that this name is used in the config spec to build a rule. For example :

element /mts_tst_src/COMP_Hudson_UCM_Test/... US1.3_With_Baselining-8

Just as if the plugin assumes that a component has mandatorily the same name as its root directory. Which is not a clearcase rule.

When setting the config spec, the command is :

/usr/atria/bin/cleartool setcs ../configspec44660.txt

But the tool is not in a view context.
So perhaps it would be better to systematically call setcs with -tag <view name>.

Nevertheless I could also have misunderstood some points. If it is the case, don't hesitate to give me the hints so that I can correctly configure the plugin.
Thanks for the job, and your help.
Best Regards.
J.L.P.

Unknown User (jl.pinardon)

And I insist on the idea that you cannot assume that the component name is equal to the root dir. It is often something different.

Point #1 : Yes, I have unserstood that.
But most of clearcase users will naturally fill the component vob name with the heading /. Moreover, the pVOB name must be filled with the heading /. So I think it would be really more consistent and easy to understand that both pVOB and component VOB be filled with the complete vob tag. It the usual way to do with clearcase vob tag.

We are using v1.5.1 of your plugin and 1.1.1 of the ClearCase plugin. It works nicely except for one little glitch that unfortunately makes it unusable here... It is caused by the way the plugin handles rootless components. The config specs generated by the plugin adds an invalid rule in the config specs for rootless components. This breaks the config specs and stops the process right there. The plugin should ignore rootless components when composing the config specs rules. In the sample below, the VSP4 component is rootless. Here is what I get:

Hmmm, that can be easily fixed (although I don't see why the load rule gets duplicated – do you use the Restrict folders to field?).
May you open a JIRA issue and assign it to me please? I'll try to fix that very soon (maybe tom), but as the update center is currently broken, it might take some time for the new release to get actually published.

I have having the original posted problem. Is there a solution that does not require using an older clearcase plugin?
Thanks
ClearCase plugin 1.2.1
ClearCaseUCMplugin 1.5.1
Started by user koesterb
No emails were triggered.
FATAL: com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineSCM cannot be cast to hudson.plugins.clearcase.ClearCaseUcmSCM
java.lang.ClassCastException: com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineSCM cannot be cast to hudson.plugins.clearcase.ClearCaseUcmSCM
at hudson.plugins.clearcase.ucm.UcmMakeBaseline.prebuild(UcmMakeBaseline.java:208)
at hudson.model.AbstractBuild$AbstractRunner.preBuild(AbstractBuild.java:614)
at hudson.model.AbstractBuild$AbstractRunner.preBuild(AbstractBuild.java:609)
at hudson.model.AbstractBuild$AbstractRunner.preBuild(AbstractBuild.java:605)
at hudson.model.Build$RunnerImpl.doRun(Build.java:120)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
at hudson.model.Run.run(Run.java:1241)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:124)

Hi, this is because the version of the ClearCase UCM Baseline plugin you use is not compatible with the ClearCase plugin 1.2. There's a table at the top of this page which emphasizes compatibility. You need version 1.6 which I've not released yet, I'm waiting for some tests to end.

Unknown User (vrspraveen.atluri@gmail.com)

Hi Romain, I have a Master node on AIX and Slave Node on Windows. When ClearCase UCM plugin is ran on Slave node. It is getting the Cleartool value from the global configuration. Is there a release for adding an option to override the 'cleartool' location for slaves.

Such a feature can't be part of this plug-in since the global configuration relies on the one of the ClearCase plug-in. I submitted a patch (JENKINS-5527) for the ClearCase plug-in some time ago but it's not been applied yet (I guess this is because it would make the new release of the ClearCase plug-in incompatible with current configurations). In the meantime, the best is to add cleartool to the PATH for all your nodes, master or slaves.

Unknown User (vrspraveen.atluri@gmail.com)

Hi Romain,

I downloaded the patch (Hudson-5527) and updated the cleartool path for my nodes but CLEARCASE UCM BASELINE plugin is still looking at the global configuration.Can I get a temporary fix for this plugin?

Well, maybe you can get the code by yourself and do the fix. Once the ClearCase plug-in integrates the feature, then I'll do a fix, but for the moment I won't (no time to do free consultancy services ).

Hello There, Is There a way to pass stream name using another string/CHoice Parameter to clearcase UCM parameters? I would liek to use same job for all env type builds where streams differ from each one.

Did any one had a luck to use this plug in for continuous integration . I have error when i tried to do so.It can not pick baseline automatically.I tried with clearcase UCM plug in but its not linux compatible.

This is documented in the inline help: Click on the various blue interrogation mark icons and you'll see which variables are available. Basically, your need is covered, but read the documentation for know the variable names.

i think there is a bug in class ClearCaseUcmBaselineParameterDefinition.

The variable private transient DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd.HHmmss") should not be transient, because when i set the job parameter Display baselines more recent than, and restart the hudson server, and i try to construct a job, the list of baselines will be empty until a enter in job configuration and save it.

The above exception was throwed in my tests

Caused by: java.lang.NullPointerException

at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterDefinition$2.evaluate(ClearCaseUcmBaselineParameterDefinition.java:358)

at org.apache.commons.collections.CollectionUtils.filter(CollectionUtils.java:405)

at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterDefinition.getBaselines(ClearCaseUcmBaselineParameterDefinition.java:355)

Caused by: java.lang.NullPointerException at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterDefinition$2.evaluate(ClearCaseUcmBaselineParameterDefinition.java:358) at org.apache.commons.collections.CollectionUtils.filter(CollectionUtils.java:405) at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterDefinition.getBaselines(ClearCaseUcmBaselineParameterDefinition.java:355)

i think there is a bug in class ClearCaseUcmBaselineParameterDefinition.

The variable private transient DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd.HHmmss") should not be transient, because when i set the job parameter Display baselines more recent than, and restart the hudson server, and i try to construct a job, the list of baselines will be empty until a enter in job configuration and save it.

The above exception was throwed in my tests

Caused by: java.lang.NullPointerException

at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterDefinition$2.evaluate(ClearCaseUcmBaselineParameterDefinition.java:358)

at org.apache.commons.collections.CollectionUtils.filter(CollectionUtils.java:405)

at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterDefinition.getBaselines(ClearCaseUcmBaselineParameterDefinition.java:355)

Caused by: java.lang.NullPointerException at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterDefinition$2.evaluate(ClearCaseUcmBaselineParameterDefinition.java:358) at org.apache.commons.collections.CollectionUtils.filter(CollectionUtils.java:405) at com.michelin.cio.hudson.plugins.clearcaseucmbaseline.ClearCaseUcmBaselineParameterDefinition.getBaselines(ClearCaseUcmBaselineParameterDefinition.java:355)