CruiseControl.NET MultipleTrigger failure when using with AND operator

During my work with Cruise Control .NET I was required to created dependency between projects in a way that I have the following hierarchy

ProjectDependency

The steps and explanations are:

  1. Compile the setup of the project
  2. Install the setup (that contain few types of roles) on 3 servers in parallel
  3. After above 3 projects finished run test program (integration test) on system.

I thought it would be very simple because I know that the current implementation of Cruise Control .NET has MultipleTrigger class already implemented that allows creating trigger on several project with OR / AND operator.

After doing the ccnet.config configuration I tested it and found that project "Entire system" didn't start after all three project were completed successfully (actually its was random with more occasions that it didn't work).

After investigation I realized that there is a basic implementation problem because even when using AND operator the triggers were iterated one by one BUT if one of the triggers didn't create Integration Request than the multiple Trigger would return NULL and stop the iteration which in our case it would mean the the internal project triggers would even run one time so actually they don't have initial status (limitation).

I fixed this issue and thought it would fix everything but than I continued and found that although I fire the triggers one by one because I use Project Trigger if it is fire and returns Integration Request the next call would return NULL if the threshold (internal interval Trigger) wasn't  met (to make things simpler this means that unless I have a situation that all triggers return Integration Request at once the response would be NULL --> nothing would be built)

My fix now had to be in a way that all the trigger would be fired at the same bulk and actually cause the get project status action so I decided to set the internal triggers to be 1 second each and added new internal interval trigger that will be used as threshold and set it to 10 seconds.

So now I have MultipleTrigger2 class that actually fire the internal triggers at once every 10 seconds (should be configurable)

At the end I also added a new flag that will enable me to trigger the internal trigger on first run rather than wait 10 seconds.

* important to say that because I am using Project Trigger as the internal triggers and it has a limitation that it doesn't have the initial state until first run (I think I am going to add state persistent to Cruise Control .NET implementation)

Because I will patch the original Cruise Control .NET I decided to add it to my CCE project.

Needless to say that everything seems to work :) (This post should save you more than 5 hours of HARD work)

CruiseControl.NET MultipleTrigger failure when using with AND operator CruiseControl.NET MultipleTrigger failure when using with AND operator Reviewed by Ran Davidovitz on 1:18 PM Rating: 5

2 comments:

Anonymous said...

The tag in cc.net is . Could you give an actual code example of a trigger bracket from your configuration? I don't know what the actual tag is supposed to be.

JLC said...

I appreciate the work you put into outlining the bug in the cc.net code. Could you please post an xml snippet of how to use multipleTrigger2?

I downloaded the source, changed the project to include MultiTriggerEx.cs, and built the dll file. However, cc.net errors when I use multipleTrigger2 instead of multiTrigger in my configuration.

Powered by Blogger.