Tag Archives: TFS

Quick Tips: TFS Demand Management via Pivot Table

Context

One of the meetings I commonly lead is a demand management meeting. In this meeting we look at the work currently in the pipeline for delivery and make decisions about what needs to happen with it. When working with TFS I run this meeting via an excel worksheet which I load a backlog query into. 

The default view for this backlog is a table, which is great for the basics of view/edit but suffers the problem of not easily being able to see the forest for the trees. What I really want is a summary view that enables me to roll up the work dynamically to answer questions raised in the meeting.

How To

To achieve this simply: 

  • Select a cell somewhere within your backlog query
  • Select the design tab of your ‘Table Tools’ ribbon category
  • Click ‘Summarize with PivotTable

The options should already have your work item table selected. Either have the table dropped into a new sheet, or your current and click OK. 

Once the table is up I generally roll up size as a sum, and Work Item Id as a count by a field such as Area to get the overview I need. Additionally allowing filtering by blocked items is handy. 

Next Steps

If you need to drill down to the work items, you can simply use the pivot table tools ‘Expand Field’ function to either have the individual work item id or title values listed as a sub field. 

 

 

Issues when importing a TFS Project Collection

Recently I moved a project collection between two servers that varied significantly in their configuration. The source server was configured with all the trimmings except for project server integration. The target server was configured as a basic instance with the addition of SQL Reporting and Analysis Services. During the import I encountered 2 issues that I needed to resolve.

Issues 

[TF261007] 

On importing the collection a failure is seen due to lab management configuration being present.

[System.MissingFieldException ‘ProjectServerRegistration’] 

On importing the collection a failure is seen due to the server being unable to locate a specific field required to support Project Server synchronisation.

Reason

As part of Team Foundation Server Service Pack 1 the above issues are patched, and therefore should be resolved. However due to the patching process not performing a restart of the TFS Job Agent the older assemblies may still be loaded. This causes the issues to still surface.

Resolution

There are 2 possible resolutions to these problems. The first is the recommended solution.

1. Restart the server.

2. Quiesce then un-quiesce the application tier using TFSServiceControl.

Both will effectively restart the TFS job service and allow the new assemblies to be loaded.

Publishing samples with Team Build and TFS 2010

It’s common when writing an API to publish a set of samples. This is a great way to give users an idea of the intended usages of your API. Now samples that are intended for publishing are essentially another production application you need to develop, and therefore should go through the same quality checks and processes that the rest of your code does, including version control.

This can raise a couple of challenges once you start to look at how you publish these samples. The issue is that a server based system will need some way to track the client side changes and with most popular version control systems this will involve the presence of extra files around the samples directories. As a consumer of the samples, the presence of these files in the published artefacts is far from ideal. I really don’t want to have the samples trying to connect to your remote server, or even a local instance of a version control provider I might not have installed.

So how do we break the dependency on the source control provider during the packaging of these samples for publishing? We could manually go through and delete all of the binding mechanisms, but that would expose us to the following types of waste:

  • Defects – manual processes are more prone to defects
  • Waiting – builds need to wait on the samples to be prepared for packaging
  • Extra Processing – extra steps to make our packaging pick up our manually cleansed samples

We can avoid most of this waste by automating the process. So if it’s able to be automated, how do we do it?

Prerequisites

Download the following script https://gist.github.com/967976. This script is written originally by Damian Maclennan, and essentially removes the TFS source binding files, solution and project elements that reference the TFS instance.  My fork includes the ability to decide on if you want the files backed up before removal of the version control sections. I usually choose not to, I don’t want the backup files in the output and have the actual versions in version control if I need them. In addition you may want to do the following:

  • Create a batch file wrapper for the script using the approach defined by Jason Stangroome at http://bit.ly/kmyfY2
  • Commit the script to a path in your repository that is part of your build workspace with the same name as the PowerShell script

First Step: Create a custom build template

  • Setup a build to create your packages, and when you get to choosing the process template clone the default template into a new template
  • Check the new template into source control

Second Step: Set up a folder to publish to

  • Open your cloned template and navigate to the point at which MSBuild is invoked with the ‘Build’ target
  • Drop in a new sequence activity and name it ‘Publish Samples’

  • Create an argument named ‘SampleDropFolder’.
    • This will be the configurable name for the folder placed in the output directory with our samples inside.
    • We’ll talk about how to surface this on the build configuration dialogue later.

  •  Create a variable to hold the full path to the output folder.
    • I’ve named mine ‘SamplesDropFolder’ but that may be a bit close to the argument name for you.
    • I also default this to a combination of the outputDirectory variable specified in the scope of the Compile and Test activity and the SampleDropFolder argument we’ve specified previously.

  • Open up your ‘Publish Samples’ sequence activity and drop in a ‘Create Directory’ activity.
    • Configure it with the ‘SamplesDropFolder’ variable we set up in the last step.
    • This will set up a root directory we can copy all our samples to, and makes it easy to run our binding removal script later on.

Third Step: Copy the samples

Now we’ve got our directory, we need to work out what we want to put in it. In most cases, we’ll have more than a single set of folders to move, so we need to put some smarts around how we identify our targets.

  • First create an Argument called ‘Samples’ and configure it to be of the type String[].

  • Drop a ForEach activity into the ‘Publish Samples’ sequence and configure it to iterate over our Samples argument we just created.
  • Add a variable to contain the local path of the sample directory we’re currently working with as a string with the name ‘sampleLocalPath’
  • Inside the ForEach activity drop a ‘ConvertWorkspaceItem’ activity. This will take our server paths and work out the local path for the directories for us. You’ll need to configure it as follows:

  • Drop in a ‘CopyDirectory’ activity to copy our sample directory from the source to the output directory.  Your ForEach should now look something like this:

Fourth Step: Remove the source control bindings

Now we’ve got our samples into the target directory, we need to strip out the source control bindings so our customers don’t try to connect to our server when they open the solutions.

  • Add an Argument to specify the server path to the batch file we checked in back at the start of the process.

  • Create a variable to house the local path of our binding removal script. I’ve named mine ‘SourceControlRemovalScriptLocalPath’
  • Drop in another ‘ConvertWorkspaceItem’ activity after your ForEach activity. This will be used to convert the argument we just created with the server path to our source binding stripping script to its local path.  It should be configured like this:

Note: While the variables look like they are the same item, they aren't I promise!

  • Drop in an ‘InvokeProcess’ activity after the ‘ConvertWorkspaceItem’ you just added.  A little care is required when configuring this activity to ensure we get a reliable execution, so I’ll list out how I’ve configured each property.

Arguments: Microsoft.VisualBasic.Chr(34) + SamplesDropPath + Microsoft.VisualBasic.Chr(34)

Display Name: Strip Source Control Bindings

File Name: Microsoft.VisualBasic.Chr(34) + SourceControlRemovalScriptLocalPath + Microsoft.VisualBasic.Chr(34)

Working Directory: BinariesDirectory

Any other properties remain unaltered from their default state

Your publish samples sequence activity should now look a little like this

Fifth Step: Surface the arguments

That’s nearly everything we need to do to support the publishing of samples into our output directory. However we’ve set up a few arguments in here to ensure our template is re-usable. We now need to surface them to users via the build configuration dialog. To do this:

  • On the ‘Metadata’ Argument for the build workflow click the ellipsis. You should get a pop up dialog
  • Configure the three arguments we’ve added as follows
    • The samples list
    • The samples drop folder name
    • The source control removal script path
    • These should be configured in the editor as follows:

The only thing that changes across the parameters are the Display Name - the name we surface to the editor, and the Parameter Name – the name we gave our argument that corresponds to this parameter

  • Check in the template

Final Steps: Configure the build!

Now we’ve got our template done, let’s go configure a build! The only real point of interest here are the custom parameters we set up on our way through, so we’ll focus on them – this is a long enough read already!

The points of interest are all on the process tab, so let’s skip there. If you expand your custom section you should see something like this:

All you need to do is fill in the values, so it looks more like this:

Once that’s done, kick off a build and you should be able to locate your samples, without the binding configuration in the drop directory of your build output!

Conclusion

In this article I’ve shown you how to create a reusable template for including useful samples in your build output. I’ve used this particular approach with a few customers and what I particularly like about it is we aren’t moving too far from the out of the box activity set that comes with Team Build. This saves us on overhead, and allows the template to be put together pretty quickly.

TFS Unboxed – A journey through 2010

Since 2005, Team Foundation Server (TFS) has been providing integrated version control, work management and build capabilities. The release of TFS 2010 builds on the foundations formed in the earlier 2005 and 2008 products and focuses on lowering the barrier of entry for teams wanting to get the maximum benefit from TFS with minimal implementation fuss.

If you’ve been thinking about adopting TFS, or are just interested to see what it could bring to your development effort this is a great opportunity to experience what TFS 2010 has to offer. In this session you’ll see both myself and our test partners at KJ Ross walk through everything to do with TFS from installation and getting the basics of version control, build and work item tracking running to what is possible with a fully integrated build, test and lab setup.

By the end of the half-day session you will:

  • be able to install and configure TFS to suit your need
  • understand the benefits that SharePoint and SQL Reporting can bring as optional extras
  • know the role TFS plays in each of the SDLC disciplines and how it can add value

This is definitely an opportunity not to be missed!

The details:

What: TFS Unboxed – A journey through 2010

When: Friday the 25th of June (morning and afternoon sessions available)

Who: Stephen Godbold (Readify), Dr Mark Pedersen and Dr Tafline Murnane (KJ Ross)

Where: Microsoft, 1 Epping Rd, North Ryde, Sydney Australia

Cost: $75 (includes light refreshments)

Register for the morning session here or the afternoon session here

Australian ALM Conference Dates and Early Bird Offer

Australian ALM LogoThe Australian ALM conference dates have been re-announced recently, and registrations have opened.  This means now is the best time to take advantage of the early bird offer – if you’re one of the first 50 attendees to register for the conference you will receive a free NFR copy of Microsoft Expression Studio 3.0!

The conference will be held on the 13th and 14th of April at the one and only Luna Park in Sydney, Australia. It will showcase some great Australian and international speakers in two content tracks and includes the option of attending post conference training. The event will also be the official Microsoft Australia launch for Visual Studio 2010, so if you’re interested in application lifecycle management or want to get a feel for what makes up the Visual Studion 2010 offering head over the registration site and grab your ticket now!

Australian ALM Early Bird Offer

Publishing Information to the Build Log in Team Build 2010

I’m currently working on a build activity for the Team Build 2010 contrib project. While debugging an issue I was having I thought it would be great to push some information into the build log. There’s already some great posts on customising build information on Patrick Carnahan’s blog (here and here), but I was looking for a simple way to write what was essentially a chunk of debug information into my log. I knew I had come across some extension methods for CodeActivityContext previously that made build information tracking much simpler, but couldn’t remember where they lived.

To access the CodeActivityContext extension methods, you need to first add a reference to the Microsoft.TeamFoundation.Build.Workflow assembly, then a using or import statement for the Microsoft.TeamFoundation.Build.Workflow.Activities namespace. By adding the reference and using/import statement you get access to TrackBuildMessage, TrackBuildError and TrackBuildWarning. These extensions give a quick entry point for basic build information logging and error reporting which I’ve found quite handy.

Visual Studio 2010 Quick Reference Guidance

Have you ever asked or been asked “Can you tell me about TFS or VS in 5 minutes?”. Did you struggle to fit all that content into an elevator pitch? Struggle no more!

Thanks to some great work by the Visual Studio ALM Rangers, there’s now a set of quick reference guides that provides a fast way to identify the answers to core questions about the VS and TFS ecosystem. This pack contains guidance on each of the roles supported by the VS ALM products, info on how the products transition from 2008 to 2010 and some great posters to hang around your workplace as reference points.

So if you’re looking to answer a “What is…”, “What is new in…” question or just need a quick reference sheet check out the codeplex project and download the guidance!