Build Controller vs Build Agent

This is a great walkthrough that explains how to deploy a Database from a TFS 2010 Build WorkFlow.

It uses a command line tool called VSDBCMD.EXE, that is explained here.

I recently used this technique and it works great.

I actually created a pretty sophisticated build and deploy process using the build process templates from TFS 2010 to build a Database project and allow the user to decide via variables if they want to deploy to a Database or just create the script.

Something to watch out for though.

Take a look at the section titled “To define the Then Deploy block”

Then look at Step 3.d

Set the FileName property to the path of VSDBCMD.EXE on your build server. For example, you might specify C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Deploy\VSDBCMD.EXE if you installed Visual Studio on your build computer or C:\Deploy\VSDBCMD.EXE if you just copied the Deploy folder to your build computer.

Notice the reference to “your build server”. This seems innocent enough of a statement. However if your Build controller is a different machine than your build agent it makes a difference as to where you can put your Invoke process to call VSDBCMD.

If you installed VSDBCMD on the build agent make sure the Invoke VSDBCMD is within the Run on Agent block in your Build process or it won’t work. If you follow the walkthrough and put your Invoke Process after the Check In Gated Changes block the process will not be able to find VSDBCMD.EXE because it’s installed on the Build Agent and at this point you are on the controller. If they are the same machine it won’t make a difference.

referring to the diagram below: If your controller and agent are different machines, everything in the Run On Agent block runs on the Agent and everything else runs on the Controller.

Build Agent Working Directory Tokens

Team Foundation Build variables: You can use the following variables in a build agent working directory:

  • $(BuildAgentId): An automatically generated integer that uniquely identifies a build agent within a team project collection.
  • $(BuildAgentName): The Display Name of the build agent.
  • $(BuildDefinitionId): An automatically generated integer that uniquely identifies a build definition within a team project collection.
  • $(BuildDefinitionPath): The team project name and the build definition name, separated by a backslash.

Baseless Merge with TFS

This Blog post contains material that is not suitable for the branching novice. Viewer discretion is advised.

First I would like to say this should be avoided if at all possible. Having a relationship between branches makes it much easier to deal with branching. So unless you absolutely have to  merge between unrelated related branches try not to.

Now that disclaimers are out of the way, what is a baseless merge?

Take the following branch hierarchy. Dev can be merged with QA, and QA can be merged with hotfix or Prod. If you tried to merge a change from hotfix directly to Dev the UI will not let you. There is no relationship between them therefore it would be a baseless merge.

If I were to make a change in the Hotfix branch and attempt to merge it with Dev that option would not be available. As you can see in the merge dialog below the only option available for merging is the QA branch.

If I was to merge changeset 108 from Hotfix to QA the visualizer would show something like this.

If I wanted to merge the latest version of HotFix into Dev skipping QA I would have to do a Baseless merge from the command line. Using the baseless switch on the tf merge command.

tf merge /recursive /baseless Hotfix Dev

If we then take a look at the visualizer we can see that we did a baseless merge denoted by the dotted line.

 

Shelve Sets

I think Shelve Sets are one of the nicest features of TFS source control.

They are great for:

  • Storing code safely on the server each night before you go home
  • Storing code you are working on to fix a bug in another branch or older code base
  • Sharing a code example
  • Code Reviews
  • Prototyping
  • Passing something incomplete off before a vacation or long weekend

That reminds me of the one thing I don’t like about Shelve Sets. When you want to unshelve something that belongs to another developer you have to know their user id. There is no  drop down with a distinct list of users that have something shelved. To get my code you would have to know dlloyd or lloyddave or lloydd or whatever my network id happenes to be.

All is not lost, if you install the TFS Power Tools  one of the tools it comes with is called Team Members which is an add-in to Team Explorer, that allows you to organize users into sub-teams and access a number of collaborative tools, such as IM and email, sharing of queries and links, and downloading and installation of custom Team Foundation components.

Check out the context menu when you right click on a team member in this tool you can show their check in history, pending changes, and of course shelvesets.

Sweet!

Microsoft 24 hour code-a-thon

24-Hours of pure, unadulterated coding madness!

The new Windows Phone 7 has recently launched in Canada and Microsoft is looking to YOU to develop apps! Join your friends and fellow student developers for a 24-hour Code-A-Thon hosted by Microsoft. There will be tons of amazing prizes for the best apps, and a brand new Windows Phone 7 for the student that can submit the most apps!

The Windows Phone 7 Code-A-Thon:

Start Date:

Friday, January 21st @ 6pm

End Date:

Saturday, January 22nd @ 6pm

Location:

University of Waterloo, VeloCity Residence 200 University Avenue West

Students to RSVP at: http://codeathon.wufoo.com/forms/microsoft-24-hour-codeathon/.

The Maritimes loves TFS

If you have been reading my Blog this week you will know I am in Halifax at Techdays. I did two sessions this week one on Branching and Merging and one on Build Automation both TFS topics. 

Being in the east coast for me feels less like travelling then talking in Ottawa does. You see I have maritime blood in me. My father was born in New Brunswick and I spent most of my childhood summers here. I love the Maritimes they are the nicest people I have ever met. The two ladies who worked the door of the room I talked in were so friendly and helpful I would like to say thank you, I don’t know your names and you will never read this, but to the ladies outside room 200C2 Thanks. :)

Both sessions had a great question and answer segment at the end. The poor next presenter has been setting up both times while I am trying to get out.

After my session today I hung around in the Ask the Experts area of the conference. Even though there are about 15% the attendance of Toronto. I had 4 times the number of people asking questions about TFS. Everyone was very excited at the possibility of using TFS for source control and Build automation. Wait until they learn all the other stuff it can do.

Halifax, thanks for another lovely trip. I’ll be back.

The Maxwell’s Plum in Halifax

I am in Halifax at the moment, speaking at TechDays. I am doing two sessions here Branching and Merging yesterday and Build Automation today.

Yesterday one of my partners Bruce Johnson surprised me by showing up to do a talk. Nice for me now I had someone to have dinner and a beer with.

So Bruce and I headed out looking for a pub. We got lucky first time finding The Maxwell’s Plum. I can’t recommend it enough the food was good and the beer even better. They have a huge selection of drafts on tap. Our server Amy was funny and friendly and knew her beer.

First we both tried a BlackBerry which was a variation on Black and Tan using Pumphouse Blueberry as the Tan. It was very nice.

So I thought I would see how well Amy knows her beer. I asked her to suggest some beers. She asked me what kinds of beers I like. I ended up having a Garrison Tall Ship Ale which is a local micro brewery and it was excellent. I also had a Propeller Pale another local brewery. Both were great beers, it’s nice when the server actually knows and understands the product they are selling.

Now if the Prince George Hotel where I stayed understood their rooms are not worth the price they are charging. :(

Windows Phone 7 Apps “Double Out”

The MVPs were challenged to write a Windows Phone 7 app and upload it to the marketplace. There are of course prizes involved. :)

So I wrote one. I’m no Silverlight expert, and I have never completed a mobile app I started before.

However, I must say this was easy, and the emulator worked flawlessly. In a couple of hours I wrote a simple application that gives you a dart finish if you enter what you have left to throw.

I play on a dart team you see. This application will help you with dart finishes. In Dart games like 301, 501 and 701 you must end on a double. There are three and two dart finishes starting at 170. Many pubs have posters up that show you the best finish given what you have left to shoot. This simple application brings that information to your Windows Phone 7. Just enter what you have left to throw and Double Out will tell you the best finish.

The interface is pretty simple but getting going was a snap. I downloaded the developer kit installed and built an app all within a couple of hours. There is plenty of help out there including articles and examples. I managed to build this without reading any of it.

Now that I have this starting point I want to play with the gestures. I have done some gesture programming before for windows 7 so I am interested in seeing how it works for the phone.

image

Microsoft Quality Assurance Breakfast

imageQuality Assurance
An effective software quality approach can dramatically improve effectiveness, automation and traceability throughout the development lifecycle. It may surprise you to learn that Microsoft employs as many software testers as developers. Less surprising is the emphasis the company places on the testing discipline—and its role in managing quality across a diverse product portfolio.

For insights into how Microsoft drives software development and tool efficiencies that can benefit your organization, we are extending this special invitation to join Microsoft’s own Alan Page for an executive breakfast on software quality assurance. This is a unique opportunity to share your challenges and learn more about real world solutions. Please register before limited spaces are filled. (Invite Code: 2B1C6C)

Alan Page began his career as a tester in 1993, and joined Microsoft in 1995. He is a Principal SDET on the Office Communicator team, where he coaches and mentors testers and test managers across the organization on testing approaches and techniques. Alan also leads Microsoft’s Test Architect Group and other Microsoft quality and testing focused communities. In his career at Microsoft, Alan has worked on various versions of Windows®, Internet Explorer®, and Windows CE, and has functioned as Microsoft’s

Director of Test Excellence.
Alan is also a frequent speaker at industry testing conferences, a board member of the Seattle Area Software Quality Assurance Group (SASQAG), and has published several articles on testing and quality in testing and software engineering magazines. Alan writes about testing on his blog (http://angryweasel.com/blog), was the lead author on How We Test Software at Microsoft (Microsoft Press, 2008, and contributed a chapter on large-scale test automation to Beautiful Testing (O’Reilly Press, 2009).

 

Topic: Software Quality Assurance

Date: Thursday October 21, 2010

Location: St. Andrew’s Club & Conference Center

Address: 150 King Street West at University, 27th floor

Breakfast: 8:00 AM

Session Start:  8:30 AM

Session Finish: 11:30 AM

Who Should Attend?

Senior leaders responsible for software Quality Assurance

Register Now

Invite Code: 2B1C6C

TesTrek Talk Next Week.

Deb Forsyth and I are speaking at TesTrek next week.

Our workshop is on Thursday Oct. 21st at 11:00 am

Effectively Managing the testing Process Through Collaboration
Debra Forysth and Dave Lloyd, ObjectSharp Consulting

Communications is the key to the success or failure of any team, whether it’s a sports team or a software development team creating the next app. Without communication, the team members have no idea how best to direct their efforts. With communication, the team can overcome almost any challenge.  Unfortunately, ensuring that the level of collaboration required in generating success can be a difficult goal to achieve. Solid development managers have a bag of tricks that they utilize to foster communications among the different roles. In this session, you will learn some of the tricks that can be used in your own environment to create better communications across all of the team roles.

  • How can the other team roles more effectively communicate with the testing team?
  • What does the test team need to know to complete the testing effort?

 

 

Hope to see you there.