Command line builder - Important messages

Good day,

I have recently rolled out the Professional version of TeamCity to one of our on-site development teams, to evaluate how we can benefit from this type of software (we had previously tried CruiseControl.NET but had a number of issues that were not scheduled to be fixed any time soon, so opted to go down a more commercial route, with the general idea of upgrading to the enterprise version of TeamCity if it turns out to be suited to our needs). Our main interest with TeamCity (at this moment in time at least) is to make sure a number of our projects stay in a buildable state across all platforms (currently we support six platforms ). We have three main projects that are being monitored, and we have them setup to be built in both Debug and Release. Two of the projects are mainly based around Visual Studio (using integration to compile for the various platforms) and one of the projects is purely a makefile based project across all platforms. This works in as far as TeamCity will build the relevant projects when changes are committed in to our SVN repositories, and under the right circumstance it'll email users when they break the build, however we appear to have a couple of problems (which from what I can make out are caused by the same issue)....

In our build logs we do not get any messages being reported as 'Important Messages' other than "Unable to cleanup build temporary directory" which is just a warning (as far as I can tell). Ideally we'd like a way to be able to put all our errors on to this page (to make it easier for users to see what the problems are with a given build). All of our builds are done via the 'Command Line' build runner, which basically just calls a batch file that performs all necessary steps to make the build for the various platforms - even the Visual Studio based builds are done in this manner for we have a number of environment variables that are setup (per project) which act as global defines across the solution being built. I have done my best with the documentation and have tried various different combinations, but I am unable to make any of out output appear in this 'Important Messages' window - is there something I have missed? I'd be completely happy with having my own parser which gets all the stdout/stderr from the build process and spits it out in a manner that TeamCity can understand.

Secondly, (hopefully related to the above point), all users are setup to receive an emails, when the build fails, but only for builds in which they have committed to. However, from the documentation is sounds like it'll only email the first user that breaks the build if it detects that the same error has caused the build to break subsequently. So we get in to the state where someone breaks the build, then someone else commits something which also breaks the build, but only the first person gets the email, so they fix what they have broken, the build remains in a broken state, but no one is any the wiser. So my question/hope is that the logic to know 'if the same error has occurred' is based on if the same 'Important messages' are generated for successive builds? If that is the case then my assumption would be if there is some way we can generate meaningful 'Important messages', we should also solve this issue, as the second person to break the build would have generated different error messages.

Any information you can give regarding the above would be appreciated (e.g. is it already possible to fix the above problems, if not is there any likely hood that the above will be added in any future releases, if so what sort of time frame would we be looking at).

Many thanks,

Steven Craft

7 comments

BUMP

Just making an attempt to keep this thread alive - could anyone provide any information at all? Dev's?

Steve

0

Have you tried watching for errors (maybe monitor process exit code) and using service messages to report when you find failure? See here: http://www.jetbrains.net/confluence/display/TCD3/BuildScriptInteractionwithTeamCity

Also, you would probably have a little better luck to define your environment variables within the 'Properties' tab of the configuration so that you can use some of the more advanced build runners. This will definitely help your reporting, but of course it will be a little more overhead. Maybe its worth it though?

Good luck.
Ray

0

Thanks for your input,

All of the batch files which are executed do give correct error codes, which is what tells TeamCity if the build has failed or not, and this part of it works correctly. I have looked at the service message page you suggest, and have tried outputting various combinations of messages from there, but none of them seem to trigger the 'Imporant messages' to appear. Is it the case I have simply missed something, or do these 'Important messages' get created by some other mystical process? If I could do something like the following I'd be happy:

##teamcity\[importantMessage type='warning' out='Unable to deploy executable']
##teamcity\[importantMessage type='error' out='main.cpp(3) : undefined variable a']

The reason we use batch files to setup the environment variables is because we have various build processes (one for end users building in Visual Studio, one for an automated build process which generates ISO's for all projects on all platforms, and now one for TeamCity) so it would a big maintenance issue we have to maintain three independant sets of variables (also it'd mean all users would need to be able to administer TC projects...). As it stands, at the moment each of our projects has a 'SetEVars.bat' file which sets up all the environment variables, and this batch file gets run in conjunction with all our various build processes, this makes it easy for anyone to add environment variables with confidence it'll be applied in all scenarios.

Any additional information you give would be appreciated - it feels like there should be some system message type that I just haven't found yet. I guess one 'hack' I could do would be to tell TC to use a Visual Studio builder type, then make it call my OWN devenv.exe which I could then call the batch file, do the build, make sure the stderr/stdout gets redirected. I was just trying to avoid hacky solutions if there was any chance of a neat one though.

Steve

Edited by: Steven Craft on Jul 28, 2008 4:56 PM

0

TeamCity NAnt runner will search for errors in code iff csc,vbc,jsc,vjc or solution task is used or if ]]> task is used. Thus, please try using NAnt script to start your command line process.


Thanks!

0

Hello!

I'm adding to this thread as I'm trying to do what the OP is mentioning; however I'm not quite sure if Eugene's suggestion solved his issue or not (as I'm not quite sure what Eugene is implying).

I'm running a NAnt process, that runs a custom Python script under the hood. It properly returns an error code such that TeamCity reports a failed build. That said, under 'Important Messages' in the 'Build Log' (and naturally, the e-mail that gets sent out), I get very little messages of importance.

Since I've written the python script itself, I was wondering if there's any service messages I can issue to 'write' to the Important Messages tab. Has anyone had any luck wtih this?

I've used the teamcity[buildStatus] stuff and it shows up on the master overview page fine, but the Important Messages field doesn't get anything.

I'm using TeamCity 3.1. Any help would be appreciated!

0

Just noticed this reply (while browsing the forums in hope of finding answers to other questions I have). In the end I deicded to get the enterise license for TeamCity, while it doesn't currently fit my requirements perfectly, it certainly helps in some areas. The solution to the above program I am currently using is...

Using Nant, nearly all projects have 4 rules, that just call different batch files in the projects directory. The batch files have ended up being rather large, mainly due to tracking error/warnings, but essentially the pseudo code is:

SetUpEnvironmentVarialbesAndPath( )
SetAllPlatformsExitStatusTo( 0 )

echo Building project BLA on platform BLA in configuration BLA 1>&2
Call build routine > temp.txt 2>&1
if ErrorLevel IS NOT 0:
SetExitStatusForThisBuildType( ErrorLevel )
echo FAILED 1>&2
else:
echo SUCCESS 1>&2

REM Takes output from Visual Studio/Make/supported compiliers and puts the errors/warnings in to errors.txt/warnings.txt
OutputParser.exe temp.txt errors.txt warnings.txt



if AnyPlatformsHaveFailed:
echo ERRORS 1>&2
echo =======

for each platform that has failed:
echo $PLATFORM_NAME 1>&2
type errors.txt

if AnyPlatformsHaveWarnings:
echo WARNINGS 1>&2
echo =========

for each platform that has warnings:
echo $PLATFORM_NAME 1>&2
type warnings.txt

exit EXIT_STATUS_SET_FROM_BUILDS


You'll notice the echo's are often done using 1>&2 at the end, this forces the output to stderr so it appears in the important message window, you'll also notice the use of a custom parser to get all the warnings/error messages. The above is serving us reasonably well, every few weeks I'm finding another error/warning that slips through the parser that I have to add support for in the parser, but it has not become a big maintenance issue yet at least - (today I had to add a rule for when the compiler itself crashes with a segmentation fault!). The batch files are about 400 lines (for supporting 6 platforms), and the custom parser is a few hundred lines of c++ code.

Another part of our build process (that makes ISO's/builds for artists/generates datasets and so on) that I've written from the ground up has recently had email support added to it, in which I am able to produce much better output of warnings/errors and so on, and long term it is certainly a possibility we will end up using that in favour of TeamCity due to the customisation it'll allow us to have (I don't think TeamCity is completely aimed at our setup, being a video games developer, working mainly on consoles like PSP, PS2, PS3, WII, 360, but I am always hopeful the next version will make things a little easier for us!)

Steve

0

The ability to report any message with specified priority was added in the last EAP of TeamCity 4.0, take a look here:
http://www.jetbrains.net/confluence/display/TCD4/BuildScriptInteractionwithTeamCity#BuildScriptInteractionwithTeamCity-reportingMessagesForBuildLog

All messages with status above NORMAL should be shown on the important messages page.

--
Pavel Sher

0

Please sign in to leave a comment.