tfs 2010 create work item on partially succeeded build - build

We just updated our TFS2008 to TFS2010. On the daily builds on TFS2008 I had made an extra functionality in the TFSBUILD.proj so that on Partially Succeeded builds, a work item was created.
So if a build was going right, but one ore more unit tests did fail, a work item was created.
This was done by putting some extra xml in the TFSBUILD.proj. But after upgrading to TFS2010, this functionality was gone. And because the whole build architecture is changed in TFS2010, i cannot find out how to do this in... tfs2010.
So the question is: How to get a work item if a dialy build is partially succeeded.

After some extensive searching I found the solution.
I opened the UpgradeTemplate.xaml in BuildProcessTemplates, this is the one VS had created during the upgrade from TFS2008 to TFS2010.
Almost at the end of the workflow there is an if-statement called: If TestStatus = Unknown
The Else is empty, I put there an OpenWorkItem activity. So now on an unit test failure, a work item is created.
See also: http://blogs.msdn.com/b/lab_management/archive/2010/02/25/creating-a-bug-on-test-failure.aspx

I've had a look through the defaulttemplate.xaml, and it looks like you're going to have to play around with that to replicate what you have currently, on the plus side it doesnt look too hard. It's just a xaml file so opens in a VS designer, should be ok for what you need.
Might want to make a copy and set the template in your build definition > process > build process template while you play :)

Related

Build Order in Output Window Missing with Lightweight Solution Load

I've toggled back and forth between normal solution load and lightweight solution load. In the latter, when I go to the output window, the Show output from dropdown does not have the Build Order view.
Is this a bug, by design (because something about the lightweight-ness prevents this option), or is there something else I need to do to enable it?
I'd like to enjoy the quick load time, but have the build order available when trying to know which error to fix first.
EDIT
On a different solution, Build Order shows up in the dropdown, but during and after a build, the output is empty. Switching back to Build shows that the solution built because the build outputs show up.

AssemblyInfo.cs needs to change in SourceControl after build completes

I'm using TFSBuildExtensions to auto version my libraries.
I've got the build template modified so that it does that nicely. Although it doesn't actually update the AssemblyInfo.cs file.
Now I would like that AssemblyFileVersion attribute in the AssemblyInfo to update in source control. How can that be done and why isn't that being done by any of the projects I've seen out there?
Is there a reason not to have this updated in source control? (essentially checkout the file and update it.)
The way I see it, if you want to update the Version number of your assemblies you have 2 choices:
Update the one(s)* in source control and then read them on build to get the version. You can update the existing version with Regex replaces, custom scripts, etc.
Get the build to set the version numbers as it goes.
If you are doing #1, you don't need #2.
If you are doing #2, it's normally because you don't want a check-in for each version - otherwise you would just do #1 :). What you are suggesting doing is automating #1 on check-in, albeit after you edit the version number in the build definition, so it isn't without user interaction.
If you really want this, you'll have to mess with the template a bit more, people who use the extension you linked normally just do #2.
* You can link many projects to a single file if you want.

How do we do releases involving multiple platforms using Jenkins?

We have a bit of a mess of a situation on our build machine...
I finally managed to get one matrix build working, a "first check that everything compiles" type of task which just compiles everything on the current platform it's running on. It runs on multiple platforms fine (about the only problem it might have is that it's compiling the java code multiple times when it could probably be optimised to do that once.)
I imagine that setting up a matrix build for "build installers" would be not too hard, either.
But there are two problems which will definitely hit.
There's one zip file we redistribute which ideally would contain all platform-dependent binaries in a single zip file to reduce duplication (essentially it's a library we hand out to others.)
The process we have for copying the actual releases up to the server relies on every single generated file for the same version number of the same product being ready before the build starts. No single-OS builds would have a complete enough view of the produced files to be able to do the release and it doesn't seem to be possible to add build steps which run in the parent job.
We're using Archive for Clone Workspace SCM as a post-build step for this initial matrix build, but it looks like that runs independently on each OS and no attempt is made to merge the results together.
How do other people get around all these issues?
I know I can just ditch matrix builds entirely and do everything via configuring multiple of each job, but we have three platforms now and the number of jobs would skyrocket.
Options which involve alternatives to Jenkins will be looked at seriously as well, as lately... the number of problems we have been having with it is enormous.
Here's what we eventually set up which is working:
Project "platform-releases" is still a "Matrix Build".
Slaves are each labeled with their relevant platform and we use the slave label as the parameters of the matrix.
The "Archive Artifacts" is used to archive the useful files. ("Clone Workspace SCM" seems to be a dead end when working with matrix builds.)
Project "unified-releases" is a normal build which copies in the artifacts from platform-releases. Since we copy the artifacts without specifying a specific platform, we get the artifacts for all platforms, which appear in directories named /os/windows, /os/macosx, etc.
The Ant build knows about the location of the artifacts (they are outside the working copy) and pulls all the files into a single directory structure before uploading.
"Parameterized Trigger" plugin is set up for platform-releases to trigger unified-releases so that the svn version it's working with matches the actual files produced. Unfortunately, we have to check out the entire repository despite only using a tiny portion of it, because there is a bug (suspected to be in the subversion plugin) which prevents subdirectories being checked out with the correct revision otherwise.

Visual Studio C++ does not update new code after building

Before anything, I will first say that I've been looking everywhere for a solution to this problem for an hour now. There are many identical problems out there but none of the solutions help me.
I'm trying to debug a small project. When I started working on the project, I could place break points wherever I wanted and I would hit them. But for some reason, now when I place breakpoints outside of the main program (in a class definition, for example), the breakpoints hollow out while the code is running and I get a message saying the source code is different from the original version.
This led me to believe it was running a previous build, so I made an obvious change by having the code output some random letters "dajfhdjhfds";
I hit F7 as usual. Got a message saying Build: 1 succeeded. Hit F5, the program runs but does not display the random letters.
I clean my solution, then build and the changes show. I 'rebuild' the solution, and the changes show. The breakpoints also work.
But then if I make further changes, the breakpoints stop working and the changes don't appear in the program. Visual Studio is always running old code. I don't want to have to clean my solution every time I want to debug new code.
I've reset my settings, I checked off "build" in the configuration manager, I even started a whole new project and copied my code into new files. Same issue.
The problem resided in the fact that I copied the code from the original project into a brand new project saved elsewhere. When I tried to build the project in the new location it would always build it in the old location (Strange since I copied code directly into brand new files).
When I tried to run the files it would look for the built code in the new location. Therefore it would always get out of date code.
Problem can be fixed by putting the new code back in the old location!
Thanks everyone
I had this problem occur also, using WinForms. I was adding message boxes to test code and nothing was happening, only the pre-existing message boxes worked. I'm not sure 'exactly' how I fixed it, but after clicking "Build Solution", "Rebuild Solution", "Clean Solution" and "Build (program name)" all under the 'Build' menu the problem went away. Unlike the previous problems I had not copied+pasted any code between solutions.
I've started running into an identical problem and I think it all started when I re-created the project under a new name.
That is, I had to copy everything.
Problem is I don't know what DIDN'T get fully copied and is now responsible for requiring a rebuild to get my code changes. Checked the solution and project files in a text editor and no signs of the old folder structure.

Team Build - Get Workspace - get latest from specific paths, NOT everything

I have a simple build definition which I want to use to build just one project, and every time I choose to run this build, I want to get latest from the branch/directories that pertain only to the project in question. How do I do that? The call to "Get Workspace" gets everything from source control, and I do not want to (or need to, for that matter) get latest from everything for various reasons.
I hope I am not asking for much.
Thanks in advance.
Check the workspace mapping in the build definition. The build only gets the items that you have specified over there. If you want to exclude some folders within the path that you are mapping, you can choose to cloak some folders.
You can adjust your ItemsToBuild in Process Tab in Required section