Bamboo ClearCase plugin updates

I’ve updated the Bamboo ClearCase plugin to include two new features.

The first is to leverage the work that Magnus and Thobias did in including support for Base ClearCase into the plugin, such that the ClearCase UCM support can handle both baseline comparisons as well as date comparisons…this means that projects which don’t use baselines can use the plugin to compare changes since the last build date.

The second is to include support for building projects that use Dynamic views…this was actually pretty straightforward, I just needed to find the right syntax for the view creation.

Advertisements

11 Responses to “Bamboo ClearCase plugin updates”

  1. Hi,
    I have installed evaluation version of Bamboo(2.1.5 build 1009 -02 Dec 08) and ClearCase plugin 0.2.10.
    After initial installation there were some check-in’s in to source control. After that every time Bamboo polls the VOB it finds the changes even there were non since last build! I have configured ClearCase as base not UCM.

    Thanks
    Rajesh

    • Hi Rajesh, this sounds like a bug..is the ‘Configure Baselines’ option checked? I’ve noticed problems with build logic when the option is unchecked, so I’ll have a look at the code to see if I can see the problem.

      Thanks,

      Ross

  2. Hi Ross,

    we try to use Bamboo with the ClearCase Plugin but when we start a build the error
    “ERROR [BAM::Default Agent::Agent] [ExecTask] Execute failed: java.io.IOException: Cannot run program “cleartool” (in directory “/srv/bamboo/view/bamboo_snap”): java.io.IOException: error=2, No such file or directory”
    occurs.

    We use ClearCase base with a snapshot view.

    In the named directory I can use cleartool without problems, even checkin and checkout are no problems.

    Maybe you have an idea where the problem is?

    Regards,
    Ina

    • Ross Rowe Says:

      Hi Ina, is the Bamboo instance being run under a specific user account? It might be that the user that Bamboo is being run with doesn’t have permission to run cleartool, or that cleartool isn’t on the user’s path? Feel free to email me at piaross at gmail dot com if you’d like to discuss this problem further.

      Thanks,

      Ross

  3. Ross,

    I have had some problems getting the “compare baselines” option to work as expected and i believe that i have found out why.

    1 – in retrieveSourceCode it rebases to the baseline that was already built and never updates to a new baseline, as vcsRevisionKey is always a date time stamp when called.

    if (CC_TYPE_UCM.equals(getClearCaseType())) {
    String baselineToUse = vcsRevisionKey;
    createStreamAndView(planKey);
    if (shouldCompareBaselines()) {
    if (baselineToUse == null)
    baselineToUse = getLatestIntegrationBasline();
    checkLoadRules(baselineToUse, planKey);
    rebaseBuild(baselineToUse, planKey);

    I removed the “if (baselineToUse == null)” so that it always rebases to the latest.

    2 – in getLatestIntegrationBasline(), it uses Collections.Sort on the date sorted result of getStreamBaselines, which does a natural sort on the data, but makes the assumption(I think) that the names of the baselines are always date time stamps. We use release names as the name of the baselines, so the collections.sort does an alphabetic sort on the names of the baselines, returning the baseline that is alphabetically last not the most recent.

    Removal of the Collections.Sort solved this for us.

    I have mde these two changes locally and now the baseline compare works perfectly for us. I just thought you might want to take a look at the two and see if in the general case this seems right to you.

    Thanks for the plugin.

    Tim

  4. Ross Rowe Says:

    Thanks heaps for letting me know, Tim. I’ll look at incorporating your changes into my test environment and if there’s no problems, I’ll include them in a new version.

    Cheers,

    Ross

  5. Hi Ross,

    I was experimenting with the recommend baseline post action, and was not able to get it to work. So, after a little poking around I found this as the likely suspect –

    INFO | jvm 1 | 2009/07/30 10:19:56 | 2009-07-30 10:19:56,469 DEBUG [pool-19-thread-1] [CcRepository] collectChangesSinceLastBuild, planKey: BUILD-DAILY lastVcsRevisionKey: baseline:BUILDBOX_2009_07_30_10_00_01@\WRKB_PVOB
    INFO | jvm 1 | 2009/07/30 10:19:56 | 2009-07-30 10:19:56,469 DEBUG [pool-12-thread-1] [CcBaselineLabeller] Build [Daily] buildNumber[2] promotion Level[BUILT] baseline [null]

    As you can see, the baseline returned to ccBaselineLabeller is null. That is this code –

    private String getBuiltBaseline(BuildResults buildResults) {
    return buildResults.getCustomBuildData().get(VersionWriter.REVISION_KEY);

    I dont know where the REVISION_KEY is set or persisted, but it seems to be null. So, I changed to code to look at the stream itself for the built version and that seems to work.

    That code is now –

    private String getBuiltBaseline(BuildResults buildResults) {
    Build build = buildResults.getBuild();
    CcRepository repo = (CcRepository) build.getBuildDefinition().getRepository();
    return repo.getLastBuiltBaseline();

    You might see if it works in your environment, but it does in mine, and it looks like the approach should be correct.

    Regards,

    Tim

  6. Ross Rowe Says:

    Thanks for that Tim, I’ve checked your changes into Subversion, and will release a version of the plugin with your changes.

    Cheers,

    Ross

  7. Ross,

    Could this be somehow related to the NULL issues I am seeing when it comes to baselines?

    10-Aug-2009 13:36:27 Manual build triggered by E13058
    10-Aug-2009 13:36:28 Build CLEARCASE-TEST-23 started building on agent Default Agent
    10-Aug-2009 13:36:28 Updating source code to revision: baseline:ETS_CM_TRIGGERS_9_7_2005_add_cleartool_full_path@/cc/ETS_CCM_PROJECT
    10-Aug-2009 13:36:30 Error occurred while executing the build for CLEARCASE-TEST-23 : Execution of null + failed

    (this only happens when we click on compare baselines, and when we dont click on compare baselines nothing updates on the stream)

    Thanks,

    Roy

  8. Hi Ross,

    In Bamboo, with this plugin, is it possible to remove the -vws option and file (automatically added to the cleartool command line).
    It causes some trouble on windows in the clearcase server is not a windows one.
    Tested: The line without the options works fine.

    Alexandre

    • Hi Alexandre, this shouldn’t be too difficult to do, would you be able to raise a jira issue for this?

      Thanks,

      Ross

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: