August 2007 - Posts

Considerations on using TFS 2008 with Visual Studio 2005
27 August 07 03:55 PM | dmckinstry | 13 comment(s)

Visual Studio Team System 2008 is an incremental release and not a revolutionary new product.  It is a more profound upgrade than the upgrade from Visual Studio .NET to 2003 but is still not as big or intensive as the upgrade to 2005.  Although there are some nice new features, compatibility is very important and seems to be very well done.  For example, you're probably aware that Visual Studio 2008 can target .NET 2.0, 3.0 or 3.5.  However I'm I'm here to describe how to use Team Foundation Server 2008 with the Visual Studio 2005 components.

Out of the box, Team Explorer 2005 works very well with most of the TFS 2008 capabilities.  Work Item Tracking and Version Control function the same as they always had for TFS 2005.  End users wouldn't even notice the difference, except in some rare cases the increased performance.

I haven't spent much time testing the project portal in TFS 2008 but it seems to by fully compatible.  Although if you choose to use WSS 3.0 or MOSS 2007 as the base for your project portal instead of the WSS 2.0 (used by TFS 2005), users of the portal will probably notice a facelift and a few new features.

The reporting system seems mostly unchanged and compatible.  I've only done a little testing with custom reports taken from 2005 to 2008 but what I've done works perfectly.  I did notice the addition of a "Policy Override Comment" to the ChangeSet table in the data warehouse...  We'll finally have some sanctioned method of reporting policy overrides!

One of the key reasons that many users will choose to move from TFS 2005 to TFS 2008 is the new build capabilities.  If you plan to maintain a user base of Visual Studio/Team Explorer 2005 users for some amount of time even though you're upgrading to TFS 2008, you'll need to plan ahead:

  • You will need to have at least one installation of Team Explorer 2008 to create and manage build definitions and build agents.  Team Explorer 2008 will also be required to lock down builds and keep them from getting deleted by your retention policies.
  • You must structure your build folders in TFS 2008 as you would have in 2005.  That is, you need to have a TeamBuildTypes folder under the root of your team project and that folder must contain a subfolder for each build definition.  The build directories in version control must match the build definition name.  For example, if you create a build definition named "DevCI", you would need a folder structure similar to "$/MyTeamProject/TeamBuildTypes/DevCI".
  • Your build directory must contain the standard Team Build 2005 files: TFSBuild.proj, TFSBuild.rsp and WorkspaceMappings.xml.  Note that these do not have to be the actual files you use for the build; they can be almost completely empty or the TFSBuild files can be the actual ones you use in your build process.  I think you might need to have at least a mock version of TFSBuild.proj but it certainly doesn't have to be the one that is used.  Remember that the workspace mapping is now handed by the 2008 Build Definition so the workspace mapping file itself is only needed to trick Team Explorer 2005.
  • Install the appropriate Visual Studio 2005 components on your build server.  Since Visual Studio 2008 can target .NET 2.0, this might seem counterintuitive.  Unfortunately, to use the Visual Studio 2008 components you have to upgrade the solution and project files to be 2008 compliant.  This obviously won't work if members of your development team are still using Visual Studio 2005.  Remember to install which every build components you will use from the Visual Studio 2005 products (e.g., Unit Testing, Code Coverage, Static Analysis, Web Testing, ...).

With these considerations, you should be able to make use of Team Explorer 2005 and TFS 2008.  You'll get all the benefits of the new build engine including continuous integration and retention policies but your end users may not otherwise notice the difference.  Users on Team Explorer 2005 will still get the build history and build initiation screens exactly as they had before.  Of course, Team Explorer 2008 users will be able to access the same data but will have a few more capabilities.

Enjoy!

Introduction to Team Build 2008 for Team Build 2005 Users
27 August 07 01:31 PM | dmckinstry | 9 comment(s)

If you haven't already gotten a chance to play with TFS 2008 (Beta 2), I recommend it.  My experience is that it is solid and seems to work better than the RCs worked for the 2005 release.  My primary interest is in the Team Build enhancements, although there are a few other interesting TFS 2008 features such as Destroy and the integration of key TFS Power Tool elements.

From a Team Build perspective, the basic build concepts with 2008 are similar to 2005.  It is still an integrated lifecycle build process layered on top of MSBuild.  It does have some significant architectural changes and features that make it a far more compelling tool.

From an architectural standpoint, infrastructure supporting build has evolved.  The team build service is still installed on your build server(s) and listens on a TCP port using .NET remoting.  The service does very much the same thing that it did in 2005; that is, listen for build requests from the associated TFS and then work with the TFS to perform the build process.  It still uses a TFSBuild.proj file with MSBuild to drive the build process and a TFSBuild.rsp file to provide the command-line MSBuild overrides.

The contents of the TFSBuild file are somewhat changed although they seem to be compatible with the existing project but some of the properties seem obsolete. and other items and properties have been enhanced.  Here are some differences I've noted:

  • BuildMachine is not used anymore.  If you create a new build in Team Build 2008, this property is set to "UNKNOWN".
  • BuildDirectory is also not used and defaults to UNKNOWN.
  • DropLocation is also not used.
  • SolutionToBuild now has additional item metadata to allow specification of explicit Targets and Properties.

There is a moderate selection of other new properties exposing additional capabilities as well as the usual suspects.  Amongst the new configuration properties that I like are IncrementalGet and IncrementalBuild.  Setting these two properties to true may significantly increase the speed of your team builds by maintaining a workspace and only getting deltas of changes files between builds, and by only compiling projects which have changes.  This is certainly useful for Continuous Integration or similar build models that have a high build frequency.  You may well still omit these properties or leave them false if you are concerned about workspace integrity or tampering on the build machine.

If you've been paying attention, you'll notice that previously critical properties such as BuildMachine are now gone and that I have omitted mention of the WorkspaceMapping.XML file!!!  The reason for this is that Team Build has been restructured such that this data is stored elsewhere.  We used to have "Build Types" which were indicated by folder name under the TeamBuildTypes folder at the root of version control in each team project.  Team Build 2008 uses "Build Definitions" which contain this meta data and point to the TFSBuild.proj file.  This has a side effect of allowing you to carry your TFSBuild.proj file with your solution(s) which allows them to easily follow your branching strategy.

The primary elements in a build definition include:

  • The name and description of the build definition.  These are located on the General tab of the build definition dialog.
  • The Workspace mapping for the build.  Since this is separate from the TFSBuild.proj file, it is possible to have multiple build agents  with different workspace mappings using the same TFSBuild.proj.  Or in other words, I can have two related branches with branched versions of the same build file (e.g., $/.../Test/TFSBuild.proj and $/.../Dev/TFSBuild.proj) which effectively specify the same build process but are managed by two different build definitions with their own workspace mappings. It is nice to have a UI to manage workspaces instead of just an XML file:
    WorkspaceMapping User Interface
  • Of course, you still need a reference to the Project File, which points to your TFSBuild.proj file in version control.  If you don't already have one, you can create one using a wizard similar to the build type wizard for Team Build 2005.
  • These is a new Retention Policy capability in Team Build 2008 allowing you to specify how many recent builds to keep before they are automatically deleted.  For Team Build 2005 you had to manually clean up old builds using "TFSBuild DELETE", custom code or other hacks.  Now you can simply specify how many recent copies of the build to keep based on the build outcome (i.e., Failed, Stopped, Partially Succeeded, or Succeeded).  Regardless of the retention policy you can lock builds manually if they are of interest to protect them from being deleted.
    Retention Policy
  • The Build Defaults are specify the default Build Agent and Drop Location.  The Build Agent is another new construct which is used to define the build server, the communications settings, and the working directory for the build.  The first time you create a build definition in a team project you'll need to create a new build agent definition; after that you can reuse it for any other build definition in the team project:
    Build Agent dialog
  • The last portion of the build definition wizard specifies the Trigger settings.  This allows you to define if and when builds should automatically start.  By default, builds will be manually started just as they are in the out-of-the-box Team Build 2005.  However, by just setting a radio button and perhaps a few other setting you can schedule builds or do automated build based on check-in.  In fact, you can easily specify batched builds where a series of checkins can be batched into a build or one-to-one checkin to build.  The ability to actually do one-to-one builds against checkins is facilitated by build queuing.  Team build still only supports one build per team project per agent at a time, but it now supports the ability to request a build and if it can't be done because the agent is busy, it will be queued up and the build will take place when the agent becomes available.  This little feature was rare in some of the available Team Build extensions which provided Continuous Integration for TFS 2005.  With it in place, Team Build can now determine exactly who to assign a bug to when build breaks!
    Build Automation and Continuous Integeration

Another improvement over Team Build 2005 is that you can now maintain portions of the build process using a user interface instead of purely through XML files.  The TFSBuild.proj file is still maintained using an XML file editor, but the build definition and build agents can both be maintained using a user interface!

There are certainly other changes in Team Build 2008, but this should summarize all of the significant change.  I rarely recommend prerelease software for any of my clients.  However due to the vast enhancements in Continuous Integration support (i.e., triggers, queuing and retention policies), both my company and one of my customers are using TFS 2008 Beta 2 and it's go-live license.  Note that for my client, the users are still using Visual Studio 2005 and Team Explorer 2005...  but the Team System back end is all 2008!

Give it a look... And enjoy!

More Posts