Problem with dynamic parameters

89 views
Skip to first unread message

ThomasH

unread,
Dec 11, 2009, 3:09:13 AM12/11/09
to ccnet-user
I'm having problem with dynamic parameter. When building the project,
ccnet is not able to send the parameters to the finalbuilder script.

I have the following config file for my test project

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:cb="urn:ccnet.config.builder" name="Test Project"
queue="Continuous Integration" queuePriority="10">
<cb:scope projectpath="e:\products\TestProject" svnurl="https://vd-
svn01/development/tools/TestProject">
<webURL>http://serverhost1/ccnet</webURL>
<workingDirectory>$(projectpath)</workingDirectory>
<labeller type="defaultlabeller">
<prefix>Foo-1-</prefix>
<incrementOnFailure>true</incrementOnFailure>
<labelFormat>00000</labelFormat>
</labeller>

<cb:include href="default_state.xml" />
<sourcecontrol type="multi">
<sourceControls>
<filtered>
<sourceControlProvider type="svn">
<trunkUrl>$(svnurl)</trunkUrl>
<workingDirectory>$(projectpath)</workingDirectory>
<autoGetSource>true</autoGetSource>
<timeout units="minutes">120</timeout>
<checkExternals>true</checkExternals>
<checkExternalsRecursive>true</checkExternalsRecursive>
<username>bob-tromso</username>
<password>dips1234</password>
</sourceControlProvider>
<exclusionFilters>
<pathFilter>
<pattern>**\*</pattern>
</pathFilter>
<pathFilter>
<pattern>**/*</pattern>
</pathFilter>
</exclusionFilters>
</filtered>
</sourceControls>
</sourcecontrol>
<cb:include href="default_trigger.xml" />
<tasks>
<FinalBuilder>
<ProjectFile>$(projectpath)\Project.fbp6</ProjectFile>
<Timeout>7200</Timeout>
<FBVariables>
<FBVariable name="BUILD_TARGET" value="$[buildType]" />
<FBVariable name="SIGNING_KEY_PASSWORD" value="$[certPasswd]" />
</FBVariables>
</FinalBuilder>
</tasks>
<publishers>

<xmllogger/>
<!-- send mail to developers when build fails -->
</publishers>
<parameters>
<selectParameter name="buildType">
<display>Release eller test bygg</display>
<allowedValues>
<value name="Test">TEST</value>
<value name="Release" >RELEASE</value>
</allowedValues>
</selectParameter>
<textParameter name="certPasswd">
<display>Sertifikatpassord for release bygg</display>
<required>false</required>
</textParameter>
</parameters>
</cb:scope>
</project>

The finalbuilder script that ccnet runs just outpus the two variables
to console, so the output from running the project is:

<cruisecontrol project="Test Project">
<request source="HOSTINGVM" buildCondition="ForceBuild">Build
(ForceBuild) triggered from HOSTINGVM</request>
<parameters>
<parameter name="buildType" value="Release" />
<parameter name="certPasswd" value="tewsxdfsdf" />
<parameter name="$CCNetArtifactDirectory" value="M:
\CruiseControl.Net\ccnet-bin\server\Test Project\Artifacts" />
<parameter name="$CCNetBuildCondition" value="ForceBuild" />
<parameter name="$CCNetBuildDate" value="2009-12-11" />
<parameter name="$CCNetBuildTime" value="08:53:52" />
<parameter name="$CCNetFailureUsers"
value="System.Collections.ArrayList" />
<parameter name="$CCNetIntegrationStatus" value="Unknown" />
<parameter name="$CCNetLabel" value="Foo-1-00006" />
<parameter name="$CCNetLastIntegrationStatus" value="Success" />
<parameter name="$CCNetListenerFile" value="M:\CruiseControl.Net
\ccnet-bin\server\Test Project\Artifacts\Test Project_ListenFile.xml" /
>
<parameter name="$CCNetModifyingUsers"
value="System.Collections.ArrayList" />
<parameter name="$CCNetNumericLabel" value="6" />
<parameter name="$CCNetProject" value="Test Project" />
<parameter name="$CCNetProjectUrl" value="http://serverhost1/
ccnet" />
<parameter name="$CCNetRequestSource" value="HOSTINGVM" />
<parameter name="$CCNetUser" value="" />
<parameter name="$CCNetWorkingDirectory" value="e:\products
\TestProject" />
</parameters>
<modifications />
<integrationProperties>
<CCNetArtifactDirectory>M:\CruiseControl.Net\ccnet-bin\server\Test
Project\Artifacts</CCNetArtifactDirectory>
<CCNetBuildCondition>ForceBuild</CCNetBuildCondition>
<CCNetBuildDate>2009-12-11</CCNetBuildDate>
<CCNetBuildTime>08:53:52</CCNetBuildTime>
<CCNetFailureUsers />
<CCNetIntegrationStatus>Success</CCNetIntegrationStatus>
<CCNetLabel>Foo-1-00007</CCNetLabel>
<CCNetLastIntegrationStatus>Success</CCNetLastIntegrationStatus>
<CCNetListenerFile>M:\CruiseControl.Net\ccnet-bin\server\Test
Project\Artifacts\Test Project_ListenFile.xml</CCNetListenerFile>
<CCNetModifyingUsers />
<CCNetNumericLabel>7</CCNetNumericLabel>
<CCNetProject>Test Project</CCNetProject>
<CCNetProjectUrl>http://serverhost1/ccnet</CCNetProjectUrl>
<CCNetRequestSource>HOSTINGVM</CCNetRequestSource>
<CCNetWorkingDirectory>e:\products\TestProject</
CCNetWorkingDirectory>
<CCNetUser />
<LastIntegrationStatus>Success</LastIntegrationStatus>
<LastSuccessfulIntegrationLabel>Foo-1-00007</
LastSuccessfulIntegrationLabel>
<LastModificationDate>10.12.2009 08:54:06</LastModificationDate>
</integrationProperties>
<build date="2009-12-11 08:53:52" buildtime="00:00:13"
buildcondition="ForceBuild">Variable [BUILD_TARGET] set to []
Variable [SIGNING_KEY_PASSWORD] set to []

Project File: e:\products\TestProject\Project.fbp6

Build Started: 11.12.2009 08:54:05


[Start ActionList: Main]

[Log Variable Values [Variables:
BUILD_TARGET,SIGNING_KEY_PASSWORD]]
Current variable values :
BUILD_TARGET =
SIGNING_KEY_PASSWORD =
Success

Build Completed OK
Elapsed time: 0hrs 0min 0sec 63msec

</build>
</cruisecontrol>

I'm using the latest and "greatest" ccnet (1.5.6472.1)

Craig Sutherland

unread,
Dec 13, 2009, 1:35:47 PM12/13/09
to ccnet...@googlegroups.com
Hi Thomas,

There is currently a bug in the dynamic parameters where it does not handle parameters that can have multiple values correctly :-(

I'll look into it this week and see if I can resolve it.


Craig


From: ThomasH <thomas.h...@gmail.com>
To: ccnet-user <ccnet...@googlegroups.com>
Sent: Fri, 11 December, 2009 9:09:13 PM
Subject: [ccnet-user] Problem with dynamic parameters

I'm having problem with dynamic parameter... When building the project,

Daniel Hommel

unread,
Dec 13, 2009, 2:47:32 PM12/13/09
to ccnet...@googlegroups.com
Hey Craig,

have a look into StringUtil.IntegrationPropertyToString(). The dynamic
parameters problem sounds quite similar to the problem i solved some
time ago using this method. Maybe you can even find a more generic
method that solves both problems? I wonder if there is something like
JAXB in Java for .NET. That would help a lot to resolve XML
serialisation issues...

regards,

Daniel

2009/12/13 Craig Sutherland <cj.sut...@xtra.co.nz>:

Craig Sutherland

unread,
Dec 13, 2009, 3:23:53 PM12/13/09
to ccnet...@googlegroups.com
Unfortunately I am going the other way :-(

I think in the next version of CC.NET this is something we need to seriously look into - I was thinking of investigating whether we could use XAML, but at the moment it is nothing more than a thought!


Craig


From: Daniel Hommel <dho...@gmail.com>
To: ccnet...@googlegroups.com
Sent: Mon, 14 December, 2009 8:47:32 AM
Subject: Re: [ccnet-user] Problem with dynamic parameters

Hey Craig,

have a look into StringUtil.IntegrationPropertyToString(). The dynamic
parameters problem sounds quite similar to the problem i solved some
time ago using this method. Maybe you can even find a more generic
method that solves both problems? I wonder if there is something like
JAXB in Java for .NET. That would help a lot to resolve XML
serialisation issues.....

Craig Sutherland

unread,
Dec 13, 2009, 4:11:28 PM12/13/09
to ccnet...@googlegroups.com
Hi Thomas,

I think I have fixed this issue now, but ccnetlive is down so I am unable to check the result :-(

Basically the problem is FBVariables is an array and the preprocessor was not handling arrays correctly. The fix involved changed the preprocessor to detect the array and correctly format the dynamic value internally.


Craig


From: ThomasH <thomas.heggelund@gmail...com>

To: ccnet-user <ccnet...@googlegroups.com>
Sent: Fri, 11 December, 2009 9:09:13 PM
Subject: [ccnet-user] Problem with dynamic parameters

ThomasH

unread,
Dec 18, 2009, 3:24:52 AM12/18/09
to ccnet-user
I took the latest version of CCNET again, 1.5.6499.1 and retried with
the same project configuration and the following exception occured:

System.InvalidCastException: Invalid cast from 'System.String' to
'ThoughtWorks.CruiseControl.Core.Tasks.FBVariable[]'.
at System.Convert.DefaultToType(IConvertible value, Type
targetType, IFormatProvider provider)
at System.String.System.IConvertible.ToType(Type type,
IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType,
IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType)
at
ThoughtWorks.CruiseControl.Core.Tasks.DynamicValueUtility.PropertyValue.ChangeFieldValue
(Object value) in C:\Documents and Settings\Developer\Desktop
\CruiseControl.NET-1.5.6524.2.source\project\core\tasks
\DynamicValueUtility.cs:line 613
at
ThoughtWorks.CruiseControl.Core.Tasks.DynamicValueUtility.PropertyValue.ChangeProperty
(Object value) in C:\Documents and Settings\Developer\Desktop
\CruiseControl.NET-1.5.6524.2.source\project\core\tasks
\DynamicValueUtility.cs:line 564
at ThoughtWorks.CruiseControl.Core.Tasks.DirectDynamicValue.ApplyTo
(Object value, Dictionary`2 parameters, IEnumerable`1
parameterDefinitions) in C:\Documents and Settings\Developer\Desktop
\CruiseControl.NET-1.5.6524.2.source\project\core\tasks
\DirectDynamicValue.cs:line 130
at ThoughtWorks.CruiseControl.Core.Tasks.TaskBase.ApplyParameters
(Dictionary`2 parameters, IEnumerable`1 parameterDefinitions) in C:
\Documents and Settings\Developer\Desktop
\CruiseControl.NET-1.5.6524.2.source\project\core\tasks
\TaskBase.cs:line 148
at ThoughtWorks.CruiseControl.Core.Project.RunTasks
(IIntegrationResult result, IList tasksToRun, Dictionary`2
parameterValues) in C:\Documents and Settings\Developer\Desktop
\CruiseControl.NET-1.5.6524.2.source\project\core\Project.cs:line 645
at ThoughtWorks.CruiseControl.Core.Project.Run(IIntegrationResult
result) in C:\Documents and Settings\Developer\Desktop
\CruiseControl.NET-1.5.6524.2.source\project\core\Project.cs:line 631
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Build
(IIntegrationResult result) in C:\Documents and Settings\Developer
\Desktop\CruiseControl.NET-1.5.6524.2.source\project\core
\IntegrationRunner.cs:line 187
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate
(IntegrationRequest request) in C:\Documents and Settings\Developer
\Desktop\CruiseControl.NET-1.5.6524.2.source\project\core
\IntegrationRunner.cs:line 93

On 13 Des, 22:11, Craig Sutherland <cj.sutherl...@xtra.co.nz> wrote:
> Hi Thomas,
>
> I think I have fixed this issue now, but ccnetlive is down so I am unable to check the result :-(
>
> Basically the problem is FBVariables is an array and the preprocessor was not handling arrays correctly. The fix involved changed the preprocessor to detect the array and correctly format the dynamic value internally.
>
> Craig
>
> ________________________________

> From: ThomasH <thomas.heggel...@gmail.com>

Craig Sutherland

unread,
Dec 18, 2009, 4:35:55 AM12/18/09
to ccnet...@googlegroups.com
Hi Thomas,

Yes, there was another bug in the code :-(

I've fixed that bug and used your config to test it, now it should be
working ok.

New build is available at
http://ccnetlive.thoughtworks.com/CCNet-builds/1.5.0/1.5.6524.3/.


Craig

Reply all
Reply to author
Forward
0 new messages