April 2006 Archives

If you are going to be doing more than the basic check-in / check-out options then it pays to get to know the command line client – tf.  The command line client is actually the most flexible and powerful client to Team Foundation Version Control.

For more information, consult the MSDN help documentationTeamprise users will be glad to hear that a large percentage of the commands are implemented in V1.0 of our command line client meaning that you can do these actions from a Mac or Unix box as well (install instructions are posted in the Knowledge Base).  If you are running on Windows then you are probably better off sticking to Microsoft’s command line client that gets installed as part of the Team Foundation Server client installation (and accessible via a Visual Studio 2005 command shell).

For example, to show all the check-outs by everyone on a path in the repository:-

  tf status /server:http://yourservernamehere:8080 /user:* /recursive $/TeamProject/

For more examples, see an excellent post from James Manning or some of my previous posts:-

The command line client is also excellent for scripting purposes (our automated build system relies heavily on it).  I urge you to spend a few moments with a strong cup of coffee, the help documentation and just have a play around.  Once you realise what commands are available then you’ll know what’s possible if you come across a situation in the future where you reach limitations in the UI.

Bad Names

| 4 Comments

For those of you morning the loss of Monad as it henceforth becomes known as Windows PowerShell (it’s impossible to say that without putting some inflection into your voice to try and sound like a voice over for a cheesy advert) – we now have a new name to make fun of thanks to Nintendo renaming there next generation console the Nintendo Wii (and actually pronounced wee).  It’ll no doubt generate more titters than the name of the old Atari ST operating system.

Back to the Microsoft choice of Windows PowerShell.  Seriously – why wasn’t MSH good enough?  A fantastic new object-orientated command line shell does not need a consumer friendly name, in fact a TLA with an “in-the-know” way of pronouncing it is better for geeks – and let’s face it, the new shell ain’t aimed at my Grandma.

It’ll be interesting to see what happens to the popular linux terminal emulator (called PowerShell) – hope those guys don’t start feeling the weight of the Redmond lawyers trying to protect a name which a) Was allready being used and b) Isn’t that good anyway.  I know not everyone likes my companies name, but a least when you do a Google for it you get to our website…

INDA Cork Talk

Tonight I spoke at the Cork INDA group.  Despite the excellent weather outside loads of people turned up and sat in on a talk on Source Control, which shows true dedication (especially from the folks standing at the back).  I particularly enjoyed it that the audience asked loads of questions that got us off onto interesting tangents.  Thanks again to Joe for organising everything.

I arrived in Cork city early this morning and it is a very pleasant place to hang out.  If you are a geek in the city then I would recommend sitting in the Clarion Hotel as it is a very pleasant environment to work with free Wifi and they serve an excellent cup of hot tea.  Anyone who knows the Marketing manager for Teamprise will know that he has great taste in hotels and the Clarion is one he would like.  Sadly, when I’m booking hotels myself I tend to go a little more low-budget, but the one I am currently sitting in has plenty of old world charm.  Cork also has a municipal Wifi service – while you have to pay €10 a day to access that, the signal strength is pretty good from the hotel room from which I write this post.

As promised, here is the slide deck as a zipped Powerpoint file (2196 KB)  – also some useful links that were mentioned during questions.

Also, the book that we gave away (Eric Sink on The Business Of Software) is available from Amazon.

Irish National Developers Conference - for the community, by the community.If you are in or around Dublin next week (May 3rd & 4th 2006), then I would strongly encourage you to come along to the 2006 Irish National Developers Conference.  This conference is being organised by local .NET development community, and is aimed squarely at the development community.  Scott Guthrie will be speaking as will other excellent local speakers (I’ll also be tagging along to make the other speakers look good).

The event will also feature the opportunity to try out the technologies being talked about in Hands On Labs using equipment and resources being kindly supplied by the New Horizons training centre.

The sessions promise to be quite hard-core, much more in-depth than the usual presentation, but there is plenty available to interest most folks.  Also, there is plenty of opportunity to talk with other local developers and find out what exciting things are happening in your area.

The speakers will be hanging around the labs at different times in the day so it is your opportunity to get advice, help and tips from them.  The event is only €50 to attend, with money going towards the event expenses – all that information for less than the price of a night out!

I don’t know about you, but I love associating my check-ins with work items using the Pending Changes view, it makes it so easy to maintain requirements traceability and helps me feel less guilty as I’m doing one more thing that I should have been doing for years. 

The only problem with the default definitions for Bug and Task are that if you select the item then by default the “Resolve” check-in action is selected.  This is annoying for me as it the action I want to take in probably about 5% of check-ins.  95% of the time I just want to associate and 90% of the time I forgot that I have to change the default setting and end up going back to the work item and re-activating it.

A bug with the Resolve and Associate actions displayed.  Resolve is the default.

The “Resolve” option is displayed when a state transition in the work item’s workflow is defined as having an action defined for check-in.  Below is the transition section from the MSF Agile Bug:-

<TRANSITION from="Activeto="Resolved">
  <REASONS>
    <DEFAULTREASON value="Fixed" />
    <REASON value="Deferred" />
    <REASON value="Duplicate" />
    <REASON value="As Designed" />
    <REASON value="Unable to Reproduce" />
    <REASON value="Obsolete" />
  </REASONS>
  <FIELDS>
    <FIELD refname="System.AssignedTo">
      <COPY from="fieldfield="System.CreatedBy" />
    </FIELD>
    <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
      <READONLY />
    </FIELD>
    <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
      <READONLY />
    </FIELD>
    <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
      <COPY from="currentuser" />
      <VALIDUSER />
      <REQUIRED />
    </FIELD>
    <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
      <SERVERDEFAULT from="clock" />
    </FIELD>
  </FIELDS>
  <ACTIONS>
    <ACTION value="Microsoft.VSTS.Actions.Checkin" />
  </ACTIONS>

</TRANSITION>

If you remove the actions section from the transition from Active to Resolved transition then the only check-in action available will be “Associate”.  Admittedly, this means that I have to edit the work item after finishing checking in files to move it from Active to Resolved – but I find this works better for me.  I usually leave a little comment in the history as I change the state to say (at a high level) what I did and in the case of bugs any help I need to give to help the fix be verified by the test verification team.

 

Windows User Cache DialogWhen you connect to a Team Foundation Server, the Microsoft client API attempts to connect with your current credentials that the process is running with under Windows.  If you are on a different domain than your TFS server or the user that you are logged in with does not have access, then you will be prompted to enter your login credentials using the standard login dialog box that you will be familiar with from Internet Explorer.

However, what if you pass credentials and now you would like to pass in a different set.  In Teamprise it is easy enough because we have to ask you them every time you connect.  With the Microsoft API your credentials are cached in the standard windows store.

To access this store (and remove your cached credentials allowing you to re-authenticate as a different user) then go to Control Panel, User Accounts, Advanced Tab, Manage Passwords.  You should then locate your TFS Server instance and select Remove.

 

I thought I’d try and post some quick Top Tips for Team Foundation Server – in no particular order apart from as I think of them.  Today, this came up in the forums so I thought I’d elaborate.

WIQL (pronounced Wickle), stands for Work Item Query Language and is what is used when talking to the work item store in Team Foundation Server.  It has a SQL like construct and is used to pass queries to the server.  Visual Studio 2005 comes with a Query Editor that generate WIQL.  While the query editor is straightforward, it is pretty powerful and allows you to do most things.

However, the query editor is region sensitive which sometimes causes confusion.  Take the following example where I am using an “IN” statement to list a set of values for the work item status:-

An example of using the IN statement in Visual Studio 2005 Work Item Query Editor

Note that the values are separated by commas.  Those of you from a SQL background find this very sensible, but what the query editor is actually doing is taking the list of values and converting them into the following WIQL statement:-

SELECT   [System.Id], [System.WorkItemType], [Microsoft.VSTS.Common.Rank], [System.State], [System.AssignedTo], [System.Title] 
FROM     WorkItems 
WHERE    [System.TeamProject] = @project  
AND      [System.State] IN ('Active''Pending''Proposed''Requested'
ORDER BY [Microsoft.VSTS.Common.Rank], [System.WorkItemType], [System.Id]

(A top sub-tip is that it is possible to save WIQL files from Visual Studio by editing the query then selecting File, Save Query As.. and then select file.  To run a saved query from the file system double click the *.wiq file from explorer)

The comma separator used by the query editor is actually being picked up from the “List separator” of your regional settings (shown below) (Start, Control Panel, Regional Settings, Customize…)

Region_settings

If you are in one of the many regions of the world that use a different list separator then you have to use that in the Visual Studio 2005 Query Editor.  For example, if I change my list separator to be a semi-colon and then re-edit the query in the Visual Studio 2005 Query Editor I get the following:-

Same WIQL, different list seperator

This behaviour has some interesting side effects.  Remember when I said that the Visual Studio 2005 Query Editor “allows you to do most things”.  Well, one small problem is forcing the editor to take a character to say that you want the following to be treated as a string.  For example, if you have a comma in the text value you are trying to use in an “IN” statement then you are hosed because the query editor assumes that this is a new value in your list.  For example, if you try the following:

Query names

This actually gets translated by the query editor as the following:

SELECT   [System.Id], [System.WorkItemType], [Microsoft.VSTS.Common.Rank], [System.State], [System.AssignedTo], [System.Title] 
FROM     WorkItems 
WHERE    [System.TeamProject] = @project  
AND      [System.AssignedTo] IN ('''Woodward''Martin''''''Sell''Clark'''
ORDER BY [Microsoft.VSTS.Common.Rank], [System.WorkItemType], [System.Id]

As you can tell, it parses on the commas first, which is not want you wanted at all.  If you manually type in the WIQL correctly as IN (‘Woodward, Martin’, ‘Sell, Clark’) then the query editor will display this as Woodward, Martin, Sell, Clark – which in turn gets treated as IN (‘Woodward’,’Martin’,’Sell’,’Clark’) when the WIQL is generated by the editor. 

Hey ho – Clark Sell has a post about changing the regional settings to enable to to query assigned to names but be warned it may have nasty side effects in other programs on your machine.

Hmm.  When I thought about posting a TFS Tip a day for the next couple of weeks I didn’t intend them to be this long.  Expect the next one to be more concise…

Now playing: Carl Franklin - Avalon, AJAX, Vista, and more with Tim Huckaby

NIMTUG Talk

| 1 Comment

Thanks to everyone that came along to my talk in Belfast last night.  It was great to catch up with some old friends and good fun to stand up in front of my home crowd.

As promised, here is the copy of the slide deck as a zipped PowerPoint File (2.4 MB) and some links for further reading:-

If you have any more questions about Team Foundation Server then please do not hesitate to get in touch directly or via one of the forums that I frequently hang out in:-

Also, the book that we gave away (Eric Sink on The Business Of Software) is available from Amazon.

Now playing: BBC Radio 4 - Why Chile Works

Now V1.0 of Teamprise is out the door, we have started on the next release and are looking at the features that people want.  One of these is Check-in policy support.  Due to the way check-in policies are implemented in Team Foundation Server it presents us with several architectural challenges.

I’d be interested to hear what Check-in policies people either use currently or would like to have.  Feel free to join in the discussion even if you only currently use Team Foundation Server to manage your .NET projects.  To get the discussion started here are the ones that I’ve heard discussed previously:-

  • Work-Item has been associated
  • Comment has been entered
  • Code passes static code analysis rules (FxCop etc)
  • File names pass certain regular expression rules (i.e. forbid people from checking in *.tmp files or that pesky Thumbs.db file)
  • Code being checked in compiles
  • A defined set of unit tests associated with code have been ran and passed.

Anyone got any others?  Any of those listed above useful or totally useless?  If you don’t want to post a comment to this blog – I’d be very happy to hear from you in private.

A few minutes ago we flicked on the switch to release Teamprise v1.0 to public release.  If you have tried out any of the preview versions then I urge you to upgrade as this one has a some new features along with many bug fixes.  Now the excitement really begins :-)

I’ve seen a few forum posts on this topic and talk about it a lot whenever meeting new users to Team Foundation Server so I thought it worthwhile posting on the subject.

When you create a new team project on the Team Foundation server, the new team project wizard will ask you where you want to create a folder in source control for your project.  Every team project has to have a root level folder to store files under – in fact under the covers TFS uses annotations on that root level folder to store team project level source control settings (such as check-in notes, check-in policies and if you want to disable checking out of files with no lock).

The temptation I’ve seen with a number of first time users is to put the solution file under the root level folder.  The problem comes when they want another solution for that team project or perhaps that want to branch.  Instead, I usually follow the convention in the picture below when creating new Team Projects – in this case one called “Oryx”.

An example project folder structure - click to enlarge image

Team Foundation Server supports namespace branching – i.e. when you branch you tell the server to take a folder and branch it into another folder.  Obviously – that folder cannot be below where you are branching from otherwise you would get yourself into a recursive loop.  Now different branching models are the topic for a whole other discussion – however if you don’t know what you want to do just yet, then it is probably safe just to create a folder for your main development line called “trunk” – you might never branch, but if you do at least you can branch at the root level of your team project.

Another problem is where to draw the boundary between Team Projects?   A team project usually shares a common set of requirements and are working towards an end goal.  For example, if I was creating a medium sized e-commerce site for a company it would probably all be under one team project even though the site might be made up of multiple interfaces (internet, VoxML, customer service desktop), a core business logic engine built using .NET 1.1, .NET 2.0 and Java components with a mixture of legacy interop and a relational DB for the backend.  The reason I’d have all this as one team project is that they have one key deliverable that the business is interested in and also one requirement that may span multiple delivery teams.  When you are considering Team projects you should think how your requirements are defined by the business rather than how your teams are currently organised.  The internal organisation of teams can be mapped as sub folders in the project folder structure and also used to define your areas in the project classification for work items.

The security model inside Team Foundation Server is incredibly powerful and you can break down the permissions inside your team project to a more granular level than is used by default.  For example, each development group could have full rights to their project deliverable, but only read access to the others.  You could even configure it so that nobody had permissions to edit a file in the /releases/1.0.0 folder once it had been released etc etc. 

The thing that affects a lot of users migrating from VSS is the fact that shared folders are not supported in Team Foundation Server.  Shared folders where often used as a poor mans version of branching, in TFS you have the real thing – however some people also relied on them to set out their source in a particular way when sharing code between teams.  I’m afraid that this way of working is not well supported in TFS and you will have to use scripts to copy files around into the directory structure that you require.

Like most things, change can be uncomfortable – but once you get used to Team Foundation Server you will love it.

 

 

JNI on Intel Based Macs

The day that Intel Macs first started shipping I walked into an Apple store, downloaded Teamprise and tried to run it to see if it would work.  It didn’t.  I wasn’t that surprised, but I had kinda been hoping that the magic of Rosetta would just take over and automagically make it work.  But sadly Rosetta (while clever) isn’t that clever.

You see, although on most of the marketing material it says our client is 100% Java, that is not strictly true.  It should say 100% java rounded to the nearest percent – in terms of lines of code we are actually about 99.8% Java with a few small lines of JNI code to call a few (very isolated) native functions.  While we seriously did consider a marketing tagline of “nearly 100% java” or “99.8% Java”, however we felt that the message would just confuse things.

So – what are we doing in native code I hear you ask?  Well, one thing we are not doing is calling into the Microsoft client libraries for Team Foundation Server access – some days I wish we were as it would mean a lot less work getting the client to run on Windows.  However, when it comes to getting the client running everywhere else we would have been scuppered.  Nope, all our Team Foundation Client logic is java talking to the web services running on your Team Foundation Server, meaning that you only need to install our client and you are good to go.

We use native code in a couple of small places:-

  1. “Advanced” File handling.  We need to set a read-only file read-write when it gets checked out and we have to work under a 1.4 version of the JRE.  While Java 1.4 it has a nice file.setReadOnly() method, there is not file.setReadOnly(false) or file.setReadWrite() method so we had to write our own.  This is the only real bit of functionality that was must-have for our client that required native code.
  2. Terminal handling.  Calculating the number of columns and rows in a console terminal from within the command line client.  Had we not have already developed a JNI library for the read/write issue we probably wouldn’t have added one for this, but it makes the command line client environment a lot nicer.

So you see – including comments and blank lines in the source for our native c code we have less than 300 lines – less than 0.2 % or our code base at the time of writing.

Of course, our Teamprise Explorer Client uses SWT, which has a great deal of native code in it allowing Java applications to write nice looking and performant GUI’s cross-platform.  However, the only code we have written falls into one of the two categories above.

Anyway, there is an interesting article over at Apple Developer Connection discussing how to get your JNI to compile as a universal binary.  While our JNI code in our Mac version of the Eclipse Plugin and Command Line Client is compiled as a universal binary, we currently do not officially support the Mac on Intel platform as of version 1.0 – this is mainly due to the fact that the SWT code at the time we were developing was in the process of being ported to MacIntel. 

Ed, one of my fellow developers here at Teamprise, has a great article on the topic which explains our reasons for not supporting Intel based Macs as of V1.0.  It is something that we are working on and won’t be that way for long (in fact, as Ed mentions, if you contact us then we’ll send you an unsupported MacIntel build right now).  Personally, I’m looking forward to the day when I can take one machine into a demo and show our client running on Mac OS, Windows and Linux – but we’ll have to wait for better virtualization support for the new intel based Mac’s until that can happen.

 

Grabbed by the Monads

| 1 Comment

If (like me) you are slowly getting hooked on MSH (or Monad), the James Manning’s latest post will interest you – an early implementation of a MSH Provider for Team Foundation Server Version Control allowing you to access the repository as if it were any other mapped drive. Sweet!

TFS MSSCCI Provider Updated

| 5 Comments

A lot of people were asking about this when I was in DublinBrian Harry has announced the version 1.0 of the TFS MSSCCI provider allowing you to access the power of Team Foundation Server from the following platforms (among others):-

  • Visual Studio .NET 2003
  • Visual Visual Basic 6 SP6
  • Visual C++ 6 SP6
  • SQL Server Management Studio

Don’t forget, that you can will need at least Team Explorer installed on your machine and you need to make sure your developers have a Team Foundation Server CAL, but for most folks this will allow them to adopt Team Foundation Server right away, and then can use more and more of the power of Visual Studio Team System as they do more projects in VS 2005.  You’ll still need Team Explorer and the Command Line Client (tf.exe) to do more powerful administrative tasks.  With this MSSCCI provider and with Teamprise you are now in a much better position for day-to-day development integrated in your IDE with Team Foundation Server than you are with most source control systems (even VSS).

The provider is not officially supported by Microsoft, however they will actively be working on it over the next few months.  See Rob’s or Brian’s posts for more information.

What is Teamprise?

If you want to know more about what I’ve been up to lately, then take a look at Ben’s latest post.

Ed is Blogging

Fellow Teamprise developer Ed Thomson has started blogging.  As you can tell from the header image in his blog, Ed is our resident Mac lover and his office is festooned with shiney Apple goodies (including one of those fancy new MacIntel machines).  He uses Teamprise on Mac full time for development which has helped us catch numerous places where we didn’t look nice when presented on a Mac OS.

Apple Boot Camp

| 1 Comment

BootmanagerMy company (Teamprise) develop a plugin for Eclipse to talk to Microsoft Team Foundation Server (TFS).  We also have a stand-alone client and a command line client – all of which run on Windows, Mac and Unix.  As well as helping to develop and test the product I often go out and demo it to people as it is one of those things that has got to be seen to be believed.  It would be really nice to demo all three operating systems from the one machine.  While I am still holding out for some virtualization support Apple have just announced a public beta of Boot Camp, their boot manager making it very easy to dual boot XP on a MacIntel machine.

While this is great tactic to encourage switchers from MS platforms into the Mac world, it will also be a boon for multi-platform development shops like my own.

I also find it very interesting that the page announcing this also talks about OS X 10.5 (Leopard) which is rumoured to have virtualization support built in to the operating system meaning you could dual run Mac OS X and Windows XP app without re-booting.  Now that I would love to see – either through the operating system direct or via VMWare.

INDA Dublin Talk Slide Deck

| 1 Comment

If you came along to my talk last night in Dublin, then thanks for your time.  I really enjoyed the chat as folks got stuck in and asked questions rather than just listening to me drone on.  It’s also the first time I’ve spoke at an event and then wandered through into the bar to have pints lined up in front of me.  Admitidly, they were pints courtesy of the Microsoft tab (thanks Clare) but then conversation after my talk was fantastic – my turn to learn a lot from the assembled crowd.

Anyway, as promised here is my slide deck (as zipped ppt and a zipped pdf).  There are a set of links in the slides but the following are things that came up in questions:-

Also – the new version of the MSSCCI provider is due any day now.  Keep your eye on Brian Harry’s blog for more information.

Hope folks had as much fun as I did and that there was something in the talk for everyone.  I understand a video of the event will shortly be available on the INDA web site.

If you missed the talk then I’ll be giving it again at the following dates / locations:-

I’ll be modifying the talk as I go along so no two will be the same.   However you might want to skip watching the video if you are going to come along to my talk as it will spoil some of the jokes :-)

File Attachment: SourceControl101WithTFS_DUBLIN_PPT.zip (2146 KB)

File Attachment: SourceControl101WithTFS_DUBLIN_PDF.zip (7812 KB)

Now playing: Scott Hanselman and Carl Franklin - Microsoft Command Shell (MONAD)

Polishing My Shoes

| 4 Comments

I am giving a talk tonight. As usual, I'm busy avoiding preparing for it. It is a rare day now-a-days that I put on a shirt and smart trousers but as I'm meeting folks I've never met before in a city I've never been to, I thought I'd better make an effort.

While polishing my shoes this morning it occurred to me that this was probably one of the few things that I do that my father and grandfather would have done in a similar way. Sure, you can get those cream things that paint your shoes black but you cannot beat a good old fashioned bit of spit, brush and polish to make them look nice.

My job is based over the internet (which was largely developed in my lifetime). The food I eat is very different to what my own parents eat and has far too many herbs and bits of "foreign muck" for my grandparents to have considered eating. Most of the clothes I wear are made out of materials recently invented and non of them are made in the country I live. I just drove over a hundred miles in a morning without thinking about it and I am now writing this blog post over wireless internet access from my laptop in my hotel room (that I booked and found directions to using the internet)

Polishing my shoes makes me smile as it is about the only thing I do that my father and grandfather would recognise about my life and it feels good to be doing something the proper old fashioned way.

A typical TFS DeploymentIn some recent forums posts, it has struck me that it is sometimes not clear to people what an install of Microsoft Team Foundation Server looks like.  I’m posting a copy of a (very simple) slide I normally use when explaining this to people in the hope that others will find it useful.  If you want this as a powerpoint slide or PDF then feel free to get in touch.

Archives

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