December 2008 Archives

Radio TFS Over the holidays we sat down for the last time of 2008 and had a relaxed chat with Jeff Beehler, Team System Chief of Staff.  We talked about the history of Team System, how the teams in Microsoft go about shipping the Team System product and Jeff throws in some teasers about what will be coming along in the near future.

Play Now: A Chat with Jeff Beehler, Team System Chief of Staff

For links from the show, head on over to the Radio TFS site.  As usual please send any feedback to radiotfs@gmail.com and if you got a shiny new MP3 player for Christmas then don’t forget to subscribe to Radio TFS so it magically appears on your iPod or Zune.

10-4 Brian Keller (of This Week on Channel 9 fame) has just announced a new weekly show on Channel 9 called 10-4 where you can learn about what's coming in Visual Studio 2010 and the .NET Framework 4.0.

http://channel9.msdn.com/shows/10-4/

Each week, Brian promises to drag in various technical evangelists from the teams including Drew Robbins, Jonathan Carter and Jason Olson to help you learn more about what's coming in Visual Studio 2010 and the .NET Framework 4.0.

Be sure to subscribe to the RSS feed to catch new shows each week. I have the iPod version subscribed in iTunes right now which will hopefully allow me to keep up with all the new information about the next release of Visual Studio and the .NET Framework in bite sized chunks.

Whenever I talk about TFS, one of the things I always mention is the fact that because all the data about the software project is now being tracked in a SQL Server database, Microsoft were able to stick a Data Warehouse over the top of all that raw data to give you a really good view on reporting.  This is where the real benefits of standardizing on a single ALM solution can really reap rewards and Microsoft in their wisdom give us these reporting features in all versions of TFS including the 5-user limited TFS Workgroup edition that is included with most peoples MSDN subscription.

The only problem with the reporting side is that many people think that this means they have to go learn SQL Server Reporting Services to write reports.  While you might want to figure out Reporting Services to provide custom reports automatically to your team and customers, I personally get the most value out of using my trusty old bedfellow, the tool that got me my first paid “programming” gig and is probably the most abused software package on the planet – Excel.

Excel is a great tool for doing ad-hoc data analysis and digging into some numbers to try and figure something out.  It also makes a great prototyping tool to help you figure out exactly what the regular report is that you want to see and then you can go figure out  in SQL Reporting Services.  Another great feature about Excel is that many managers are very happy to fiddle around in Excel so rather than having them bother you with questions about how the project is going you can simply point them at Excel and it will keep them quiet for days as they slice and dice the data :-)

Let’s get started with doing TFS Data Analysis in Excel by trying to dig into which projects are active in our TFS instance – let’s see which Team Projects are having files checked in over time.

Connecting Excel 2007 to the TFS Data Warehouse

The first thing that we need to do is set up a connection to the TFS Data Warehouse from Excel.  Go to Data, From Other Sources, From Analysis Services.

Showing the import options in Excel 2007

Then enter the details for your TFS Warehouse.  This is usually the server running SQL for your TFS instance (i.e. your TFS Data Tier).  I am connecting to a TFS Server instance that has the database and the TFS application tier installed on the same machine.  My SQL Administrator has given me permissions to access the TFS Data Warehouse so I log in using my Windows credentials.

Connecting to TFS

We then want to connect to the TFS Warehouse, so just press next.

Chosing the Team System cube

And then we save out this connection so that we can use it again, or share with others by pressing Finish.

Save Connection Details wizard page

Next we get to choose how we want to import the data.  In this example, I’m going to choose a simple pivot table, but you might want a pivot chart if you really want to please your managers by giving them pretty pictures to look at :-)

Import Data dialog

Play with all that Lovely Data

Now we get an empty pivot table, and we get to see all the things that we can report on.  This is where the magic begins and if you have never seen this before you will not believe how easy it is to get data out.

Excel showing a pivot table

In the PivotTable Field List on the right hand side you get presented with a list of the facts that you would like to report on.  Commonly we need the date going across the top of our report, so lets scroll down in the field list until we find the Date section and we’ll drag the Date.Year Week Date down to the column labels.

The Pivot Field List

The other dimension that we typically want to have is by Team Project.  So let’s scroll down to the Team Project area and drag the Team Project field onto our Row Labels.  Now we have our dimensions configured, you should have a spreadsheet that looks something like this.

Our dimenions ready for some data

Note that the dates at the top are actually expandable so that you can drill down onto the weeks of the year that you are after.  Also – if there is an area that you want to exclude from the report for some reason you can right click on the value, select Filter, Hide.  So far so good – but this doesn’t tell us much yet.  We want the stuff that we actually want to report on.  We said that we wanted to see where code was being checked in, so lets scroll up to the Code Churn fields and drag the Code Churn Count into our Values area.  The Code Chrun Count tells us how many files are being checked in for each area.

File modifed by Team project

As you can see, we already have the beginning of a useful report.  By Team Project is a bit of a broad area though.  For version control stuff like this, we may well want to drill down further and look at folder inside of version control.  Not a problem at all – simply scroll down and add the Filename.Parent_ID field to the Row Labels and remove the Team Project label now as it is not that necessary.  You can now drill down as much as you like – getting a summary of the files changes in each area as you go.

Our finished report

I hope that gives you a quick taste as to the power and ease of use of the TFS Data Warehouse.  Once you know how to connect Excel to TFS, the rest is all very easy and quite intuitive.  It will take you some time to poke about in the fields available for you to know what they all are and how they can be used.  It takes a little while to get your head around the fact that all this data is available and accessible but the power, depth and yet the simplicity of it all is game changing and is one of the reasons why I became a TFS Fan.

TFS 2010 sees some huge improvements in the reporting areas, with very nice looking and easy to customize sample reports, but also more advanced examples of Excel report speadsheets.  However, you don’t have to wait for TFS 2010 to come along to start drilling into your data.  Go fire up Excel and do it today!

Often when doing some build integration work with the TFS2008 Build API, you will want to get the latest build for a particular definition – for example to show the latest status of the build etc.  To do that use the following code snippet:

TeamFoundationServer tfs = new TeamFoundationServer("http://tfsserver:8080");
IBuildServer buildServer = (IBuildServer) tfs.GetService(typeof(IBuildServer));

IBuildDetailSpec buildDetailSpec = buildServer.CreateBuildDetailSpec("Team Project", "Build Definition Name");
buildDetailSpec.MaxBuildsPerDefinition = 1;
buildDetailSpec.QueryOrder = BuildQueryOrder.FinishTimeDescending;

IBuildQueryResult results = buildServer.QueryBuilds(buildDetailSpec);
if (results.Failures.Length == 0 && results.Builds.Length == 1)
{
    IBuildDetail buildDetail = results.Builds[0];
    Console.WriteLine("Build: " + buildDetail.BuildNumber);
    Console.WriteLine("Account requesting build “ +
      “(build service user for triggered builds): " + buildDetail.RequestedBy);
    Console.WriteLine("Build triggered by: " + buildDetail.RequestedFor);
}

 

Note that if you are wanting to display a continually updated list of builds, then you should take a look at the CreateQueuedBuildsView method on IBuildServer as a lot of the hard work is done for you.  See my Build Wallboard example on the MSDN Code Gallery for more information.

I recently moved my domain email over to Google Apps for Domains. So far I have been very happy with it and all my family have been set up with accounts, and all is working well for them to. I decided to move my old mail archive into GMail so that I have the messages available for searching from whatever machine I happen to be on.

To do this, I used the Google Email Uploader, and it worked well (but did take a long time to complete against my rather large Outlook archive dating back to 2001).

The only problem was that I now had an awful lot of messages in my inbox that I didn't really want to see - also because I use IMAP to connect my mail clients up to GMail I didn't want them to download all that mail again.

It took me a while to figure out how to archive all the old mails, so I am logging it here for future reference. I exclude stared mail as I will flag a message in my email clients that I might want to respond to later and unflag when I am finished with it. The exclusion means that I won't archive the flagged messages which isn't so important this time round but will be handy if I use the query again to prune my inbox Hope it may also be helpful to you.

To archive old mails in Gmail:

  1. In the search box type "in:inbox -is:starred before:2008/06/01" where the date is in yyyy/mm/dd format.
  2. Press the Select All link. When you press this link, but you have more than a page of results a new link will appear that says "Select all conversations that match this search" - press that
  3. In the Action drop down, select Archive.

The old mails will now be available when you search, and when you look in the "All Mails" folder - but will not be included in your inbox.

No Hyper-V for Windows Vista

When I saw the news about the upcoming Windows Vista SP2, there was a little note right down at the bottom that got me quite excited.

"Windows Vista SP2 includes Hyper-V™ technology, enabling full virtualization of server workloads"

I know a lot of people that run Windows Server 2008 on their laptops, specifically so that they can run Hyper-V virtual machines rather than using the much inferior Virtual PC 2007 - so this looked like exciting news. This point was carried on through as news about the Service Pack Beta spread (see Mary-Jo Foley, Gizmodo) among others.

Microsoft have since clarified the position. SP2 does not add Hyper-V capabilities to Windows Vista SP2. The confusion all comes from the fact that the SP2 is actually a service pack to both Windows Vista and Windows Server 2008 - which goes to show how similar the two code bases are now. There is a good explanation over at Springboard.

I wanted to post this here because I'd seen the announcement from Microsoft and mis-understood exactly what SP2 was providing and I know of others that were equally confused. Luckily Microsoft virtualization guru Brian Randell corrected my understanding - but not everyone is lucky enough to have a Brian Randell in their pocket so I thought I would share the clarification :-)

It is also very interesting to see how excited people were when they thought that Hyper-V was coming to Vista - I hope once the fuss of the confusing press release has settled down, Microsoft take note.

Archives

Creative Commons License
This blog is licensed under a Creative Commons License.