[Anthill] RE: Should "Versioned Build" try to increment the version?
"Robert Dobbins" <[email protected]> Tue, 29 Jul 2003 10:28:13 -0400
| Newsgroups | gmane.comp.java.anthill.devel,gmane.comp.java.anthill |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C355BC.1DC75080
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Chad,=20
The "versioned builds" do not need to update the versioned file and =
versioned builds does not do any tagging at this time. =20
The reason it was left in tact was to provide the least amount of =
change to the existing codebase as possible to accomplish the goal =
(versioned builds). Since the real problem is the update (checkin) of =
the versioned file it would seem to be a better approach to simply =
bypass that one portion of the process. I haven't tried your patch as =
yet but it appears from what you sent that the =
projectProperties.PROJECT_VERSION nor the project registry would be =
updated. If this is the case, there is the potential that the wrong =
version could be reported on the main page if you were building anything =
other than the last version. There may be a cleaner approach to this by =
simply bypassing the Version Adapter's setCurrentVersion method call.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Hi,
I just made a patch which will prevent a "Versioned Build" from =
performing any version incrementing or tagging. It works for me, all =
existing build logs and artifacts are overwritten without problem. It is =
a simple change to BuildManager - if there is a preferred way to submit =
this patch, please let me know.=20
P.S. This section of the code is getting kind of "smelly" with nested =
conditionals 4 levels deep, but I figured I'd leave the refactoring risk =
to someone else :)
=3D=3D=3D=3D=3D=3D=3D BuildManager.java, based off revision 1.27 =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dstarting at line =
109:log.info("step 2) is project up to date?");if =
(def.versionedBuildFlag) {// if we are making a versioned build, don't =
increment theversion file// or perform any taggingif =
(def.getForceBuildFlag() || requiresBuild(def, radapter)){log.info("Step =
3) Build Project - Versioned Build: ");runBuild(def);if =
(properties.isPublishRunPolicyAlways() ||!def.getErrorFlag()) =
{log.info("Step 4) Publish Project: ");publish(def);}}} else {....... 83 =
lines .......}}catch (Throwable e) =
{....=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Thanks,
Chad
-----Original Message-----
From: Chad Woolley [mailto:chad_woolley-E0T7EY2UX4gpIyhaTEd/[email protected]]
Sent: Monday, July 28, 2003 2:42 PM
To: Anthill Mailing List
Subject: Should "Versioned Build" try to increment the version?
Hi,
I am running the latest from the HEAD, and I am having some problems =
with
the new "Versioned Build" functionality with CVS.
Here's my scenario:
1. I have made a release branch for a build (build # 39) that is going =
to QA
2. There were some fixes made on this branch
3. I manually edited the "version.txt" file to contain =
"masterbuild.39-1"
4. I then tagged all the files on the branch as "qa_39-1"
5. I went to anthill, selected "Versioned Build", and entered "qa_39-1" =
as
the "Label to Build"
Anthill then gave the following error in the log:
12:26:28:360 [Thread - AnthillBuildDaemon] INFO
com.urbancode.anthill.adapter.ProfileRepositoryAdapter - Post file edi
t on file: masterbuild\version.txt
12:26:28:370 [Thread - AnthillBuildDaemon] INFO
com.urbancode.anthill.util.Execute - [unlock] cmd /x/c cd /d d:\anthil
l\choicehotels\work\MASTERBUILD && cvs -d
:pserver:anthill-uFBpMZxKNWRcY/[email protected]:/usr/local/cvsroot commit -m
Committed_by_Anthi
ll masterbuild\version.txt
12:26:28:741 [Thread - AnthillBuildDaemon] ERROR
com.urbancode.anthill.BuildManager - ProfileAdapter unlock failed: cvs
server: sticky tag `qa_39-1' for file `masterbuild/version.txt' is not a
branch
cvs [server aborted]: correct above errors first!
My question is: Should a "Versioned Build" be attempting to increment =
the
version? I seems to me like it should not. If I am specifying a certain
tag to build, then I would think anthill should just build that tag for =
me,
and not attempt to increment any the version.file in
UrbanCodeVersionAdapter. At least in my scenario, it does not make =
sense.
I want to have complete control over the changes on the branch, and =
don't
want the version.file being modified. I realize this would involve
overwriting existing build logs and files if the build is run multiple =
tags,
but that would seem like the logical thing to do if you perform multiple
builds of the same tag.
In other words, if you are building based on a given tag, you are
"recreating" the app based on the point in time specified by the tag. I
would think this should be done regardless of which branch or revisions =
the
tag is on. It doesn't make sense to make a modification (of =
version.file)
to the tip of some branch or HEAD when you were just trying to recreate =
a
past version.
I'd propose that we disable the incrementing of version.file if a =
"Versioned
Build" is being performed. Does this present any difficult technical
issues, such as overwriting existing build logs/artifacts if the same =
tag is
built multiple times?
Thanks,
Chad
------=_NextPart_000_0007_01C355BC.1DC75080
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4919.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Chad, </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The "versioned builds" do not =
<U>need</U> to=20
update the versioned file and versioned builds does not do any tagging =
at this=20
time. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The reason it was left in tact was to =
provide=20
the least amount of change to the existing codebase as possible to =
accomplish the goal (versioned builds). Since the real problem is =
the=20
update (checkin) of the versioned file it would seem to be a better =
approach to=20
simply bypass that one portion of the process. I haven't tried =
your patch=20
as yet but it appears from what you sent that=20
the projectProperties.PROJECT_VERSION nor the project registry =
would be=20
updated. If this is the case, there is the potential that the =
wrong=20
version could be reported on the main page if you were building anything =
other=20
than the last version. </FONT><FONT face=3DArial size=3D2>There =
may be a=20
cleaner approach to this by simply bypassing the Version Adapter's=20
setCurrentVersion method call.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D</FONT></DIV>
<P><FONT face=3DArial size=3D2>Hi,</FONT></P>
<P><FONT face=3DArial size=3D2>I just made a patch which will prevent a =
"Versioned=20
Build" from performing </FONT><FONT face=3DArial size=3D2>any version =
incrementing=20
or tagging. It works for me, all existing build </FONT><FONT =
face=3DArial=20
size=3D2>logs and artifacts are overwritten without problem. It is a =
simple change=20
</FONT><FONT face=3DArial size=3D2>to BuildManager - if there is a =
preferred way to=20
submit this patch, please </FONT><FONT face=3DArial size=3D2>let me =
know.=20
</FONT></P>
<P><FONT face=3DArial size=3D2>P.S. This section of the code is getting =
kind of=20
"smelly" with nested </FONT><FONT face=3DArial size=3D2>conditionals 4 =
levels deep,=20
but I figured I'd leave the refactoring risk to </FONT><FONT =
face=3DArial=20
size=3D2>someone else :)</FONT></P><PRE><FONT =
size=3D2>=3D=3D=3D=3D=3D=3D=3D BuildManager.java, based off revision =
1.27 =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></PRE><PRE><FONT =
size=3D2>starting at line 109:</FONT></PRE><PRE><FONT =
size=3D2>log.info("step 2) is project up to =
date?");</FONT></PRE><PRE><FONT size=3D2>if (def.versionedBuildFlag) =
{</FONT></PRE><PRE><FONT size=3D2>// if we are making a versioned build, =
don't increment the</FONT></PRE><PRE><FONT size=3D2>version =
file</FONT></PRE><PRE><FONT size=3D2>// or perform any =
tagging</FONT></PRE><PRE><FONT size=3D2>if (def.getForceBuildFlag() || =
requiresBuild(def, radapter))</FONT></PRE><PRE><FONT =
size=3D2>{</FONT></PRE><PRE><FONT size=3D2>log.info("Step 3) Build =
Project - Versioned Build: ");</FONT></PRE><PRE><FONT =
size=3D2>runBuild(def);</FONT></PRE><PRE><FONT size=3D2>if =
(properties.isPublishRunPolicyAlways() ||</FONT></PRE><PRE><FONT =
size=3D2>!def.getErrorFlag()) {</FONT></PRE><PRE><FONT =
size=3D2>log.info("Step 4) Publish Project: ");</FONT></PRE><PRE><FONT =
size=3D2>publish(def);</FONT></PRE><PRE><FONT =
size=3D2>}</FONT></PRE><PRE><FONT size=3D2>}</FONT></PRE><PRE><FONT =
size=3D2>} else {</FONT></PRE><PRE><FONT =
size=3D2>....</FONT></PRE><PRE><FONT size=3D2>... 83 lines =
...</FONT></PRE><PRE><FONT size=3D2>....</FONT></PRE><PRE><FONT =
size=3D2>}</FONT></PRE><PRE><FONT size=3D2>}</FONT></PRE><PRE><FONT =
size=3D2>catch (Throwable e) {</FONT></PRE><PRE><FONT =
size=3D2>....</FONT></PRE>
<P><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></P>
<P><FONT face=3DArial size=3D2>Thanks,</FONT></P>
<P><FONT face=3DArial size=3D2>Chad</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>-----Original Message-----</FONT></P>
<P><FONT face=3DArial size=3D2>From: Chad Woolley=20
[mailto:chad_woolley-E0T7EY2UX4gpIyhaTEd/[email protected]]</FONT></P>
<P><FONT face=3DArial size=3D2>Sent: Monday, July 28, 2003 2:42 =
PM</FONT></P>
<P><FONT face=3DArial size=3D2>To: Anthill Mailing List</FONT></P>
<P><FONT face=3DArial size=3D2>Subject: Should "Versioned Build" try to =
increment=20
the version?</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>Hi,</FONT></P>
<P><FONT face=3DArial size=3D2>I am running the latest from the HEAD, =
and I am=20
having some problems with</FONT></P>
<P><FONT face=3DArial size=3D2>the new "Versioned Build" functionality =
with=20
CVS.</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>Here's my scenario:</FONT></P>
<P><FONT face=3DArial size=3D2>1. I have made a release branch for a =
build (build #=20
39) that is going to QA</FONT></P>
<P><FONT face=3DArial size=3D2>2. There were some fixes made on this=20
branch</FONT></P>
<P><FONT face=3DArial size=3D2>3. I manually edited the "version.txt" =
file to=20
contain "masterbuild.39-1"</FONT></P>
<P><FONT face=3DArial size=3D2>4. I then tagged all the files on the =
branch as=20
"qa_39-1"</FONT></P>
<P><FONT face=3DArial size=3D2>5. I went to anthill, selected "Versioned =
Build", and=20
entered "qa_39-1" as</FONT></P>
<P><FONT face=3DArial size=3D2>the "Label to Build"</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>Anthill then gave the following error in =
the=20
log:</FONT></P>
<P><FONT face=3DArial size=3D2>12:26:28:360 [Thread - =
AnthillBuildDaemon]=20
INFO</FONT></P>
<P><FONT face=3DArial=20
size=3D2>com.urbancode.anthill.adapter.ProfileRepositoryAdapter - Post =
file=20
edi</FONT></P>
<P><FONT face=3DArial size=3D2>t on file: =
masterbuild\version.txt</FONT></P>
<P><FONT face=3DArial size=3D2>12:26:28:370 [Thread - =
AnthillBuildDaemon]=20
INFO</FONT></P>
<P><FONT face=3DArial size=3D2>com.urbancode.anthill.util.Execute - =
[unlock] cmd=20
/x/c cd /d d:\anthil</FONT></P>
<P><FONT face=3DArial size=3D2>l\choicehotels\work\MASTERBUILD =
&& cvs=20
-d</FONT></P>
<P><FONT face=3DArial =
size=3D2>:pserver:anthill-uFBpMZxKNWRcY/[email protected]:/usr/local/cvsroot=20
commit -m</FONT></P>
<P><FONT face=3DArial size=3D2>Committed_by_Anthi</FONT></P>
<P><FONT face=3DArial size=3D2>ll masterbuild\version.txt</FONT></P>
<P><FONT face=3DArial size=3D2>12:26:28:741 [Thread - =
AnthillBuildDaemon]=20
ERROR</FONT></P>
<P><FONT face=3DArial size=3D2>com.urbancode.anthill.BuildManager - =
ProfileAdapter=20
unlock failed: cvs</FONT></P>
<P><FONT face=3DArial size=3D2>server: sticky tag `qa_39-1' for file=20
`masterbuild/version.txt' is not a</FONT></P>
<P><FONT face=3DArial size=3D2>branch</FONT></P>
<P><FONT face=3DArial size=3D2>cvs [server aborted]: correct above =
errors=20
first!</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>My question is: Should a "Versioned =
Build" be=20
attempting to increment the</FONT></P>
<P><FONT face=3DArial size=3D2>version? I seems to me like it should =
not. If I am=20
specifying a certain</FONT></P>
<P><FONT face=3DArial size=3D2>tag to build, then I would think anthill =
should just=20
build that tag for me,</FONT></P>
<P><FONT face=3DArial size=3D2>and not attempt to increment any the =
version.file=20
in</FONT></P>
<P><FONT face=3DArial size=3D2>UrbanCodeVersionAdapter. At least in my =
scenario, it=20
does not make sense.</FONT></P>
<P><FONT face=3DArial size=3D2>I want to have complete control over the =
changes on=20
the branch, and don't</FONT></P>
<P><FONT face=3DArial size=3D2>want the version.file being modified. I =
realize this=20
would involve</FONT></P>
<P><FONT face=3DArial size=3D2>overwriting existing build logs and files =
if the=20
build is run multiple tags,</FONT></P>
<P><FONT face=3DArial size=3D2>but that would seem like the logical =
thing to do if=20
you perform multiple</FONT></P>
<P><FONT face=3DArial size=3D2>builds of the same tag.</FONT></P>
<P><FONT face=3DArial size=3D2>In other words, if you are building based =
on a given=20
tag, you are</FONT></P>
<P><FONT face=3DArial size=3D2>"recreating" the app based on the point =
in time=20
specified by the tag. I</FONT></P>
<P><FONT face=3DArial size=3D2>would think this should be done =
regardless of which=20
branch or revisions the</FONT></P>
<P><FONT face=3DArial size=3D2>tag is on. It doesn't make sense to make =
a=20
modification (of version.file)</FONT></P>
<P><FONT face=3DArial size=3D2>to the tip of some branch or HEAD when =
you were just=20
trying to recreate a</FONT></P>
<P><FONT face=3DArial size=3D2>past version.</FONT></P>
<P><FONT face=3DArial size=3D2>I'd propose that we disable the =
incrementing of=20
version.file if a "Versioned</FONT></P>
<P><FONT face=3DArial size=3D2>Build" is being performed. Does this =
present any=20
difficult technical</FONT></P>
<P><FONT face=3DArial size=3D2>issues, such as overwriting existing =
build=20
logs/artifacts if the same tag is</FONT></P>
<P><FONT face=3DArial size=3D2>built multiple times?</FONT></P>
<P><FONT face=3DArial size=3D2>Thanks,</FONT></P>
<P><FONT face=3DArial size=3D2>Chad</FONT></P></BODY></HTML>
------=_NextPart_000_0007_01C355BC.1DC75080--