Conditional Tasks don't work anymore after upgrading from 1.8.4 to 1.9.48 (Bug #322)


Added by Frank Thole about 3 years ago. Updated almost 3 years ago.


Status:Closed Start date:12/31/2013
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:- Spent time: -
Target version:1.8.5
Affected version:1.9

Description

These parameters are defined:

<parameters>
<booleanParameter>
<name>CommitBuild</name>
<true>Yes</true>
<false>No</false>
</booleanParameter>
<booleanParameter>
<name>TagBuild</name>
<true>Yes</true>
<false>No</false>
</booleanParameter>
<textParameter name="TagVersion">
<display>The version under which to tag (e.g. 'V3')</display>
</textParameter>
</parameters>

And this is the conditional part:

<conditional>
<conditions>
<buildCondition>
<value>ForceBuild</value>
</buildCondition>
<compareCondition>
<value1>$[CommitBuild]</value1>
<value2>Yes</value2>
<evaluation>Equal</evaluation>
</compareCondition>
</conditions>
<tasks>
<exec executable="svn.exe">
<baseDirectory>C:\CCNet_Repository\RDS_Cpp_Client\lib</baseDirectory>
<buildArgs>commit . --no-auth-cache --non-interactive --message "CruiseControl.net RDS_Client build $[$CCNetLabel]" --username * --password </buildArgs>
<description>Committing</description>
<cb:CommitTagParameters/>
</exec>
<conditional>
<conditions>
<compareCondition>
<value1>$[TagBuild]</value1>
<value2>Yes</value2>
<evaluation>Equal</evaluation>
</compareCondition>
</conditions>
<tasks>
<exec executable="svn.exe">
<baseDirectory>C:\CCNet_Repository\RDS_Cpp_Client</baseDirectory>
<buildArgs>copy https://
**/svn/SE-RDS/trunk/Cpp_Client/RDS_Client https://***/svn/SE-RDS/tags/Cpp_Client/RDS_Client/$[TagVersion] --no-auth-cache --non-interactive --message "CruiseControl.net RDS_Client build $[$CCNetLabel]" --username * --password *</buildArgs>
<description>Tagging</description>
<cb:CommitTagParameters/>
</exec>
</tasks>
</conditional>
</tasks>
</conditional>

This is what is displayed in the server log:

2013-12-31 20:15:12,992 [RDS_Cpp_Client:DEBUG] Checking conditions
2013-12-31 20:15:12,992 [RDS_Cpp_Client:DEBUG] Checking build condition - matching to ForceBuild
2013-12-31 20:15:12,992 [RDS_Cpp_Client:DEBUG] Checking value comparison condition - with Yes
2013-12-31 20:15:12,992 [RDS_Cpp_Client:INFO] Conditions did not pass - running else tasks
2013-12-31 20:15:12,992 [RDS_Cpp_Client:INFO] Tasks completed: 0 successful, 0 failed

Exactly the same configuration was working in 1.8.4.


History

Updated by Frank Thole about 3 years ago

Did some debugging.
Actually it is the first ConditionalTask that doesn't work.
In the ConditionalTask-class, in the ApplyParameters-function, the parametersToApply-variable has the right values.
However, in the CompareValuesTaskConditions-class, in the Evaluate-function Value1 is empty, causing the Equal check to return false.

If I force the Equal check to true, I am able to continue till the DynamicValueUtility.FindProperty-fuction in the DynamicValueUtility-class. Somewhere in that code it does this call "Array values = GetValue(currentProperty, currentValue) as Array;". However currentProperty is null, and an Exception is thrown.

After this Exception, the second ConditialTask works without problems, so it seems to be an initialization error.
For now, I have fixed my problem by prepending a Conditional Task which checks on statusCondition. This takes care of the initialization, and the first "real" ConditionalTask works without problems now.

Updated by Ruben Willems almost 3 years ago

the problem is that the dynamic values are not filled in in the conditional task
this has to do with https://github.com/ccnet/CruiseControl.NET/pull/176

Updated by Ruben Willems almost 3 years ago

  • Target version set to 1.8.5

Updated by Ruben Willems almost 3 years ago

  • Status changed from New to Closed

Also available in: Atom PDF