Hello,
Let's say we have the following project :
<project name="sequential confusion">
<parameters>
<textParameter>
<name>DeployServers</name>
<display>Severs to deploy onto</display>
<required>true</required>
</textParameter>
<booleanParameter>
<name>Active</name>
<display>Immediately active</display>
<true>O</true>
<false>N</false>
<default>O</default>
<required>true</required>
</booleanParameter>
<textParameter>
<name>EnvironmentCode</name>
<display>Environment code to use</display>
<default></default>
<required>False</required>
</textParameter>
</parameters>
<tasks>
<sequential>
<tasks>
<forcebuild>
<project>AcceptanceTestProject</project>
<serverUri>tcp://buildserver2:21234/CruiseManager.rem</
serverUri>
<integrationStatus>Success</integrationStatus>
<parameters>
<namedValue name="DeployServers" value="$
[DeployServers]" />
<namedValue name="Active" value="$[Active]" />
<namedValue name="EnvironmentCode" value="$
[EnvironmentCode]" />
</parameters>
</forcebuild>
</tasks>
</sequential>
</tasks>
</project>
One would expect that the forced build receive values from the ones
asked to our own build. But in effect, it does not receive anything.
If one removes the "sequential" task, it all comes back to normal. The
reason is because the preprocessor gets confused by the sequential
task as can be seen in the "processed" tab of the ccvalidator tool.
With the original configuration above, the processed content is like
this for the forcebuild part:
<tasks>
<sequential>
<continueOnFailure>False</continueOnFailure>
<dynamicValues>
<directValue>
<parameter>DeployServers</parameter>
<property>tasks[0].parameters.namedValue.value</property>
</directValue>
<directValue>
<parameter>Active</parameter>
<property>tasks[0].parameters.namedValue.value</property>
</directValue>
<directValue>
<parameter>EnvironmentCode</parameter>
<property>tasks[0].parameters.namedValue.value</property>
</directValue>
</dynamicValues>
<tasks>
<forcebuild>
<dynamicValues />
<enforcerName>BuildForcer</enforcerName>
<integrationStatus>Success</integrationStatus>
<parameters>
<namedValue>
<name>DeployServers</name>
<value />
</namedValue>
<namedValue>
<name>Active</name>
<value />
</namedValue>
<namedValue>
<name>EnvironmentCode</name>
<value />
</namedValue>
As one can see, the dynamic values generated are invalid because they
do not specify an index for the "namedValue" part of
tasks[0].parameters.namedValue
If one removes the sequential task, the processed content gets back to
this:
<forcebuild>
<dynamicValues>
<directValue>
<parameter>DeployServers</parameter>
<property>parameters[0].value</property>
</directValue>
<directValue>
<parameter>Active</parameter>
<property>parameters[1].value</property>
</directValue>
<directValue>
<parameter>EnvironmentCode</parameter>
<property>parameters[2].value</property>
</directValue>
</dynamicValues>
where the dynamic values are directly onto the forcebuild
configuration which makes it work again.
I believe that not relying on the $[] construct and specifying the
dynamic values myself would solve this.
Does anyone have an explanation for this?
Should I create a JIRA issue for it?
Regards
Olivier