Wednesday, October 01, 2008

Be careful with the TFS 2008 Retention Policy

Be careful with the TFS 2008 Retention Policy.  With TFS 2008, when you set the Retention Policy to remove old builds, it also removes the Label on the source code.  Bad!  In SP1 Microsoft allows for a configuration override to change the behavior of this (i.e. <add key="PreserveLabelsOnBuildDeletion" value="True"/>).  However, since we’re only on TFS 2008 right now, we just got burnt by this.

What happen was, we needed to branch off a build that was in our customer’s hands.  I informed my colleague to simply branch off that build and let the developers make the appropriate fix.  However, when he looked for the Label he couldn’t find it.  I told him that was simply not true.  Then I read the post Retention Policy and missing labels and started to get very, very nervous.

We ended up with a work around that helped us solve our problem.  We have a Build report that shows all builds and when they ran.  We were able to find the build number and then using the time that it started execution, find the Changeset which was before the build initiation.  That allowed us to track down where we needed to branch the code from.

No comments: