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

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of ThomasH
Sent: Friday, 18 December 2009 9:25 p.m.
To: ccnet-user
Subject: [ccnet-user] Re: Problem with dynamic parameters

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.Chan
geFieldValue
(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.Chan
geProperty
(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 <[email protected]> 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 <[email protected]>
> To: ccnet-user <[email protected]>
> 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,
> 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)


Reply via email to