Re: problem with <propertyfilelabelincrementer> and Ants <buildnumber> task causing perfect storm of label hell
David Corley <[email protected]>
| Newsgroups | gmane.comp.java.cruise-control.user |
|---|---|
| Message-ID | <[email protected]> |
Hey Jeffrey, Documentation patch for configxml.html attached. I've also created an issue in JIRA and attached the same documentation patch. http://jira.public.thoughtworks.org/browse/CC-900 Regards, Dave P.S. I posted another question on the mailing lists regarding the interval at which Cruisecontrol checks for updates to the config.xml it is using. Is it technically possible with the current codebase to write a bootstrapper that allows users to force a re-check of config.xml? On Fri, Mar 20, 2009 at 5:40 PM, David Corley <[email protected]> wrote: > Hey Jeffrey, > Will setting "preBuildIncrementer=true" for <propertyfileincrementer>: > 1. Take the value of the previous build and bump it by one (without looking > at the propertyfile) > or > 2. Will it just force CC to go and get the value for the label from the > propertyfile as I would like it to? > > If 2, then fantastic, and I'd be more than happy to submit a documentation > patch. > If 1, then grrrr, and perhaps I'll submit a documentation patch when I've > calmed down. :-) > > /Dave > > > > > > On Fri, Mar 20, 2009 at 5:14 PM, Jeffrey Fredrick < > [email protected]> wrote: > >> >> <labelincrementer> "prebuildincrementer" attribute seems to allow >>> something similar. >>> >> If someone can tell me what I can do to force Cruisecontrol to NOT use the >>> failed builds label with <propertyfileincrementer>, that would be awesome. >>> >> >> The propertyfileincrementer also supports the prebuildincrementer >> attribute, so that should take care of it, yes? >> >> Would you be willing to submit a documentation patch that makes that >> clear? For that matter describing using the propertyfilelabelincrementer >> with Ant's buildnumber would be good for the description as well... >> >> Jtf >> >> >> On Fri, Mar 20, 2009 at 9:35 AM, David Corley <[email protected]>wrote: >> >>> Hey all, >>> At the moment, if a project uses propertyfilelabelincrementer and the >>> build fails, Cruisecontrol will use the label from the failed build when >>> attempting to build again. >>> This is a problem with ant projects that use the <buildnumber> task. >>> <buildnumber> works by reading a number in from a file, setting a >>> property with that value, and incrementing the number in the file. >>> So the following situation can occur: >>> 1. Cruisecontrol reads its label (x) from the build number property file >>> 2. It attempts to build an ant project >>> 3. The ant project <buildnumber> task gets the build number (x) from the >>> same property file in step 1, and increments (x+1) the number in the file >>> after the value has been retrieved and set in Ant >>> 4. The build fails sometime after step 3. >>> 5. The number has been incremented in the file (x+1), and Cruisecontrol >>> SHOULD read the updated value, but it appears if a build fails, >>> Cruisecontrol re-uses the label (x) from the failed build in the fix >>> attempt. This results in Cruisecontrol labels and Ant build numbers being >>> out of sync. >>> >>> If we could set an additional attribute on <propertyfilelabelincrementer> >>> that forces Cruisecontrol to re-read the label after a failed build, that >>> would fix the problem. >>> The attribute could be called something like <alwaysUse> with type >>> boolean. >>> >>> <labelincrementer> "prebuildincrementer" attribute seems to allow >>> something similar. >>> If someone can tell me what I can do to force Cruisecontrol to NOT use >>> the failed builds label with <propertyfileincrementer>, that would be >>> awesome. >>> I don't mind contributing code, but I don't know how to tell CC not to >>> use the label from the failed build. Help please? >>> >>> >>> Regards, >>> Dave >>> >> >> >> -- >> Build engineering training: http://ci-guys.com/training.php >> >> >> >> >> ------------------------------------------------------------------------------ >> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are >> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and >> easily build your RIAs with Flex Builder, the Eclipse(TM)based development >> software that enables intelligent coding and step-through debugging. >> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com >> _______________________________________________ >> Cruisecontrol-user mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user >> >> > > > -- > "To be or not to be. That's not really a question." - Jean-Luc Godard > -- "To be or not to be. That's not really a question." - Jean-Luc Godard ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Cruisecontrol-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
configxml.html.diff
(application/octet-stream, 1.9 KB)
--- C:\DOCUME~1\dc2\LOCALS~1\Temp\configxml.html-revBASE.svn000.tmp.html Mon Mar 23 15:49:45 2009
+++ C:\open-source-svn\cruisecontrol\documentation\main\configxml.html Mon Mar 23 15:47:04 2009
@@ -10418,6 +10418,16 @@
</div>
<p>Returns a value for the label from a property file.</p>
+ <h3>Note on usage with Ant <code><buildnumber></code> task:</h3>
+ <p>If you use the Ant <code><buildnumber></code> task to increment your build number,
+ and also use Cruisecontrol <code><propertyfilelabelincrementer></code>, you may find the build number
+ reported by Ant and the label seen in Cruisecontrol are different after certain builds fail. This
+ can happen if the Ant build fails after the <code><buildnumber></code> task has run. The build number is incremented
+ in the property file by Ant, but Cruisecontrol retains the build number of the last failed build and re-uses it until the
+ build succeeds. The label/buildnumber will be out-of-sync by 1 for every concurrent Ant build failure, i.e., after 3 concurrent failures
+ Cruisecontrol will have label X, but the propertyfile will actually have the value X+3. The recommendation is therefore
+ to force Cruisecontrol to re-read the property file for all builds by setting the value
+ of the <code>preBuildIncrementer</code> attribute to <code>true</code>.</p>
<h3>Attributes</h3>
@@ -10436,6 +10446,11 @@
<td>value to return if property file doesn't exist. if not specified and file doesn't exist
an exception is thrown.</td>
</tr>
+ <tr>
+ <td>preBuildIncrementer</td>
+ <td>No</td>
+ <td>If <code>true</code> the property will be re-read from the property file prior to the build attempt and thus each build attempt will have the latest value of the property</td>
+ </tr>
<tr>
<td>propertyfile</td>
<td>Yes</td>