<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>ALM Adventures</title>
	
	<link>http://www.andygeldman.com</link>
	<description>Agile Development with Team Foundation Server 2010</description>
	<lastBuildDate>Sun, 05 Feb 2012 19:51:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AndyGeldman" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="andygeldman" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">AndyGeldman</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>TFS Source Control for Config Part III: Apps Without Source Integration</title>
		<link>http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-iii-apps-without-source-integration/</link>
		<comments>http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-iii-apps-without-source-integration/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 19:50:38 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=846</guid>
		<description><![CDATA[Part I: Why Branching Doesn’t Work Part II: Labelling, Branching&#8217;s Poor Cousin Part III: Apps Without Source Integration In part one of this series I gave a detailed definition of what (in my opinion) constitutes a config file. There are grey areas, so I tend to use heuristics instead of cut-and-dried principles. Here are my <a href='http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-iii-apps-without-source-integration/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andygeldman.com/index.php/2012/01/tfs-source-control-for-config-part-i-why-branching-doesnt-work/">Part I: Why Branching Doesn’t Work</a><br />
<a href="http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-ii-labelling-branchings-poor-cousin">Part II: Labelling, Branching&#8217;s Poor Cousin</a><br />
<strong> Part III: Apps Without Source Integration</strong></p>
<p>In part one of this series I gave a detailed definition of what (in my opinion) constitutes a config file. There are grey areas, so I tend to use heuristics instead of cut-and-dried principles. Here are my rules-of-thumb:</p>
<ul>
<li>Config doesn&#8217;t get compiled into an application</li>
<li>Config files are data rather than executable code</li>
<li>Config is uploaded or copied over (in some way) to be made available to an application</li>
<li>Config may be preferable to code so that business rules or settings can be amended without an application release</li>
<li>Config files may be worked on by non-programmers: analysts, professionals and subject-matter experts</li>
<li>Configuration files might be edited in Visual Studio but also plain text editors, custom-built apps, or a vast range of third-party applications</li>
</ul>
<p>The last point is the subject of this post &#8211; how to access TFS source control from applications with no TFS integration. There are a few options, some better than others &#8211; depending on the particular circumstances. I will set out all the ones I have used or considered.</p>
<h3>TFS 2010 MSSCCI Provider</h3>
<p>MSSCCI is Microsoft&#8217;s clunkily-named standard for source control integration. It originated in the dark days of Visual SourceSafe but grew and gained support from many third-party applications. TFS does not use MSSCCI as it&#8217;s native source control API, but there is a <a href="http://visualstudiogallery.msdn.microsoft.com/bce06506-be38-47a1-9f29-d3937d3d88d6">free provider available</a> which you install (in addition to Visual Studio or Team Explorer) on each client machine where you want to use it. Third-party apps with MSSCCI support can then be configured to talk to the TFS provider, which in turn talks to TFS.</p>
<p>MSSCCI is functional (it basically <em>works</em>) but is at the mercy of client applications. For example, Microsoft Access relies on MSSCCI and the integration logic can be frustrating: it might decide to check-out every object it has under source control, which it does one by one &#8211; a painfully slow experience compared to the simple operation of checking out whole folders using Visual Studio. Problems like that can be eased by following one of the check-out strategies below.</p>
<h3>SvnBridge</h3>
<p>I explored this option but didn&#8217;t use it, so can only suggest it as a possibility. <a href="http://svnbridge.codeplex.com/">SvnBridge</a> is an open-source tool which allows client applications to access TFS as if it were Subversion. Effectively, it gets TFS to emulate Subversion. TFS doesn&#8217;t know it is being accessed by a client application built to work against Subversion, and the client application doesn&#8217;t know it&#8217;s not accessing Subversion &#8211; SvnBridge handles all the translation. Subversion is a popular open-source source control server and there are third-party applications with support for it, but not for TFS (e.g. BusinessObjects LifeCycle Manager). If you use one of those apps, give SvnBridge a try and let me know if it works out for you.</p>
<p>Note that if you are using Eclipse, <a href="http://www.microsoft.com/visualstudio/en-gb/products/2010-editions/team-explorer-everywhere">Team Explorer Everywhere</a> is a better solution.</p>
<h3>No Source Integration</h3>
<p>If your editor doesn&#8217;t have a source control integration that will talk the language of TFS, MSSCCI or Subversion, you can still use TFS source control but it will require some experimentation to figure out the best way to do it, and potentially some application-switching during the work.</p>
<p>First, you will need a way to execute source control operations. You can use Visual Studio or Team Explorer, which is fine if you already use it for other work. If you don&#8217;t know Visual Studio/Team Explorer and have no other need for it, it might feel like a pretty heavyweight option when you just want to get to TFS source control. In that case, the Windows Shell Extension that comes with TFS Power Tools works well. An added bonus is that applications that use a standard Windows file dialog should allow files to be checked out using the dialog itself &#8211; removing the need to switch applications.</p>
<p>Second, you should consider defining a strategy for how you are going to check-out from source control. If you are used to Visual Studio you may well ask why a &#8220;strategy&#8221; is necessary. Well, Visual Studio has various options for checking out files when you start editing them, which generally means you can forget about checking-out and just get on with the work. Without that you are going to have to decide what to check out and when. Here are the main possibilities:</p>
<h4>Check Out On Demand</h4>
<p>This means you check out files just before you need to edit them. That should be fine if your editor has a simple file-editing design, but some applications modify files behind the scenes at times and for reasons you cannot easily predict. For check-out on demand to work, you need to be sure the editor will complain if files are read-only and give you an opportunity to check them out. If you can&#8217;t be sure of that, this strategy won&#8217;t work.</p>
<h4>Check Everything Out</h4>
<p>This means you check out all the files that could possibly be modified, do your work, then check them all back in. TFS should detect which files have changed and only include those in the resulting changeset, and undo the checkout for files which haven&#8217;t changed. The downside is that you have to checkout files you will not modify, which might confuse other users.</p>
<h4>Work Offline</h4>
<p>This is an interesting option to consider if you don&#8217;t want to check everything out. It makes using TFS somewhat similar to a <a href="http://en.wikipedia.org/wiki/Distributed_revision_control">distributed revision control</a> system such as Git or Mercurial. Visual Studio/Team Explorer will offer to take a solution offline automatically if it cannot connect to TFS, and give a manual option to go back online. The <a href="http://visualstudiogallery.msdn.microsoft.com/425f09d8-d070-4ab1-84c1-68fa326190f4?SRC=VSIDE">GoOffline</a> extension exposes an option to go offline manually.</p>
<p>That&#8217;s fine if you are using a Visual Studio solution, but that&#8217;s unlikely if VS isn&#8217;t your editor. In that case, the TFS Power Tools provide a useful command line tool <em>TFPT</em> which can be used to work offline and go back online cleanly. Here&#8217;s a suggested process:</p>
<ol>
<li>Use <em>TFPT scorch</em> to ensure there are no orphaned files in your workspace. This is necessary because when you go online later, <em>add</em> operations will be created for all files not under source control, replicating in source control any mess built under your local machine&#8217;s working folders.</li>
<li>Remove the read-only flag from all files which might be modified.</li>
<li>Modify the files as needed.</li>
<li>Use <em>TFPT online</em> to turn the edits into pending changes, then check-in as normal.</li>
<li>A final <em>TFPT scorch /preview</em> will check if there are any remaining differences between source control and the local file system.</li>
</ol>
<p>Note: the complete TFPT syntax is not shown above. For example, you will normally want to include a restrictive <em>filespec </em>parameter to only include specific folders in the operations.</p>
<p>A downside to working offline is that file renames will be interpreted as a delete of the old file and an add of a completely unrelated file, so are best avoided.</p>
<h3>Summary</h3>
<p>Versioning config files can be a challenge but there is much to gain in traceability and risk reduction if you get it working smoothly. I hope these articles help you do that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-iii-apps-without-source-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TFS Source Control for Config Part II: Labelling, Branching’s Poor Cousin</title>
		<link>http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-ii-labelling-branchings-poor-cousin/</link>
		<comments>http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-ii-labelling-branchings-poor-cousin/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 18:39:10 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=844</guid>
		<description><![CDATA[Part I: Why Branching Doesn’t Work Part II: Labelling, Branching&#8217;s Poor Cousin Part III: Apps Without Source Integration In the first part of this series I explained why branching might not be the best strategy for versioning &#8220;configuration&#8221; files. These are items that control or influence an application but aren&#8217;t an integral (compiled) part of <a href='http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-ii-labelling-branchings-poor-cousin/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andygeldman.com/index.php/2012/01/tfs-source-control-for-config-part-i-why-branching-doesnt-work/">Part I: Why Branching Doesn’t Work</a><br />
<strong>Part II: Labelling, Branching&#8217;s Poor Cousin</strong><br />
<a href="http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-iii-apps-without-source-integration/"> Part III: Apps Without Source Integration</a></p>
<p>In the first part of this series I explained why branching might not be the best strategy for versioning &#8220;configuration&#8221; files. These are items that control or influence an application but aren&#8217;t an integral (compiled) part of it, and often have a different development and release cycle. In this part I offer a solution and then, ahem, gripe about the tooling for it.</p>
<p>The solution is <em>labelling</em> &#8211; a completely flexible way of identifying specific versions of specific files. The concept is very similar to tagging photos on a photo-sharing site or posts on a blog. The label itself is a simple text string and can be anything you like. You can apply one or more label to any version of any files. Unlike changesets, which cannot be modified after creation, labels can always be updated. Unlike branches, which are driven by changesets, labels don&#8217;t push you into a rigid work flow or strategy. About the only thing you can&#8217;t do is apply the same label to more than one version of the same file, but I can&#8217;t imagine a realistic scenario where you would want to do that.</p>
<p>So that&#8217;s sounding nice and simple, right? Just label up the config files you want to release together, modify the labelled files if something changes or needs fixing, and when it&#8217;s all ready get the labelled files out of source control and deploy. Easy. Well, it would be if the Visual Studio support for labelling wasn&#8217;t so cursory. It seems like all the effort went into branching, and labelling was dismissed as the poor man&#8217;s configuration management &#8211; a clumsy oaf stamping random files with ill-named tags, compared to the sophisticated beard-stroking intellectual that is branching. Don&#8217;t get me wrong, branching is great, but not everybody is versioning branch-friendly application source code (and dependant artifacts) alone.</p>
<p>Here&#8217;s what&#8217;s not up to scratch in the Visual Studio 2010 support for labels:</p>
<ul>
<li>The Source Control Explore context menu option <em>Apply Label </em>doesn&#8217;t apply an existing label, it creates a new one. The dialog that pops up is called <em>New Label </em>with a button named <em>Create</em> so it knows its own purpose, even though the menu item doesn&#8217;t. Understandably, people try to use this to apply an existing label to additional files. When they do (and don&#8217;t read the next dialog carefully) they wipe out the existing label completely and start from scratch with a new label. One mistake like that is enough to convince people labels are too risky to depend upon.</li>
<li><em>Apply Label</em> only allows one file or folder to be selected. As <em>Apply Label </em>can only be used once per label (see above) why not let users label multiple files at the same time?</li>
<li>You can&#8217;t select files in source control and apply an <em>existing</em> label.</li>
<li>You can&#8217;t select a version of a file from the history and create a label <em>or</em> apply an existing label.</li>
<li>You can&#8217;t easily apply a label to every file in a changeset.</li>
<li>The label editor (the only way to modify a label) is hidden all the way under <em>File &#8211;&gt; Source Control &#8211;&gt; Label &#8211;&gt; Find Label</em>. Yes, it&#8217;s also accessible from the label tab of a file&#8217;s history, but to get to a specific label that way you need to know a file that has it applied and navigate to it.</li>
<li>The label editor has a <em>Change Labelled Version </em>button but a more direct <em>Update to Latest </em>feature would be nice &#8211; much of the time when you change the labelled version that&#8217;s what you want to do.</li>
</ul>
<p>There&#8217;s a lot that could be better, but despite it all the TFS labelling implementation is sound at it&#8217;s core, and despite its awkwardness the tooling is usable. If someone could crank out a VS extension that fills the GUI gaps it would be perfect. Watch this space&#8230;</p>
<p>Once you have your label correctly applied you will want to get the right versions of the right files so they can be deployed. You can simply <em>Get</em> the label from the root of a workspace to clear out other files and get the labelled files alone. You probably won&#8217;t want to use your normal workspace for that, as the operation may well interfere with normal work (and vice versa). You could manually create a second workspace for getting labels, but I find a batch script is cleaner:</p>
<pre class="brush: bash; title: ; notranslate">

@ECHO OFF
SET ProjectCollection=http://MyServer:8080/tfs/MyProjectCollection
SET TeamProject=MyTeamProject

REM Prompt for label name
SET Label=
SET /P Label=Enter a label to get from TFS:
IF &quot;%Label%&quot;==&quot;&quot; GOTO Exit

REM Setup workspace (fails non-destructively if it already exists)
C:
CD \
MD TFS
CD TFS
MD DeploymentWorkspace
CD DeploymentWorkspace
&quot;%VS100COMNTOOLS%..\IDE\tf&quot; workspace /new /collection:%ProjectCollection% DeploymentWorkspace /noprompt
CLS

ECHO Getting labelled files to C:\TFS\DeploymentWorkspace...
ECHO.
&quot;%VS100COMNTOOLS%..\IDE\tf&quot; get . /version:L&quot;%Label%&quot;@$/%TeamProject% /force /recursive

REM Check if label exists (error TF14064)
&quot;%VS100COMNTOOLS%..\IDE\tf&quot; dir . /version:L&quot;%Label%&quot;@$/%TeamProject% /recursive &gt;LabelContents.txt 2&gt;&amp;1
SET /p LabelContents=&lt;LabelContents.txt
DEL LabelContents.txt
SET LabelContents=%LabelContents:~0,7%
IF [%LabelContents%]==[TF14064] GOTO Exit

ECHO.
ECHO Copying to Desktop folder %Label%...
CD &quot;%USERPROFILE%\Desktop&quot;
MD &quot;%Label%&quot;
CD \TFS\DeploymentWorkspace
xcopy %TeamProject%\* &quot;%USERPROFILE%\Desktop\%Label%\&quot; /s
ECHO.

:Exit

pause
</pre>
<p>That&#8217;s it! The next part looks at the challenges of versioning config files that are not edited within Visual Studio.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-ii-labelling-branchings-poor-cousin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TFS Source Control for Config Part I: Why Branching Doesn’t Work</title>
		<link>http://www.andygeldman.com/index.php/2012/01/tfs-source-control-for-config-part-i-why-branching-doesnt-work/</link>
		<comments>http://www.andygeldman.com/index.php/2012/01/tfs-source-control-for-config-part-i-why-branching-doesnt-work/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 18:15:40 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=832</guid>
		<description><![CDATA[Part I: Why Branching Doesn’t Work Part II: Labelling, Branching&#8217;s Poor Cousin Part III: Apps Without Source Integration Most of the information out there on TFS Source Control is in the realm of software development, concerning the intricacies of branching, merging, build automation and all that good stuff. But what if you want to use <a href='http://www.andygeldman.com/index.php/2012/01/tfs-source-control-for-config-part-i-why-branching-doesnt-work/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><strong>Part I: Why Branching Doesn’t Work</strong><br />
<a href="http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-ii-labelling-branchings-poor-cousin/">Part II: Labelling, Branching&#8217;s Poor Cousin</a><br />
<a href="http://www.andygeldman.com/index.php/2012/02/tfs-source-control-for-config-part-iii-apps-without-source-integration/"> Part III: Apps Without Source Integration</a></p>
<p>Most of the information out there on TFS Source Control is in the realm of software development, concerning the intricacies of branching, merging, build automation and all that good stuff.</p>
<p>But what if you want to use TFS to version <em>configuration files</em>? By that I mean the many artifacts that don&#8217;t get get compiled into an application but control how it behaves &#8211; I&#8217;m thinking of report definitions, data mappings, calculation logic and the like. As a broad definition, I call &#8220;configuration files&#8221; any sort of soft-coded business rules or settings. Configuration files might be edited in Visual Studio but also plain text editors, custom-built apps, or a vast range of third-party applications. XML is a typical format, but config files can be any plain text or binary structure (although the latter is thankfully less common). Often, the files are generated and modified by non-programmers: analysts, business people, subject-matter experts, and specialists in the particular technology being used.</p>
<p>Configuration files are no less critical than the application itself; in fact they can be much more valuable &#8211; representing many man-years of effort analysing complex business logic into a machine-friendly format. Such important assets need the rigour of version control, but how should that be set up? A good branching strategy is the right place to start for application code, but branching is not great for incremental releases &#8211; which are commonplace for config changes. Here&#8217;s why:</p>
<ul>
<li>Granularity: merging works at the changeset level and gets ugly if you attempt it at a finer level. Even though it&#8217;s possible, I also try to avoid merging specific changesets and instead merge only whole branches &#8211; otherwise it can get difficult to track what&#8217;s going on. Bill Heys has a great post on why you should avoid <a href="http://blogs.msdn.com/b/billheys/archive/2011/01/19/what-is-a-cherry-pick-merge-and-why-do-you-recommend-against-them.aspx">Cherry Pick Merges</a>.</li>
<li>Versioning: branching works for application code because it ensures integration and testing of a consistent whole. For config, you often need to identify individual files or small subsets which will be released independently. Branching doesn&#8217;t help there.</li>
<li>Conflicts: there&#8217;s no branching without merging and that means the possibility of conflicts. Traditional line-based code lends itself nicely to standard merge tools but XML, proprietary text formats and (especially) binary don&#8217;t fare so well.</li>
</ul>
<p>If branching is out for versioning config files, what approach should be taken instead? I&#8217;ve seen organisations manage the problem by recording changeset numbers or copying files to shares. Neither are particularly satisfactory, not least because of error-prone recording and the heinous crime of duplication. In the next part of this short series I&#8217;ll look at labelling as an approach.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2012/01/tfs-source-control-for-config-part-i-why-branching-doesnt-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perils of Multiple Project Collections and Team Projects</title>
		<link>http://www.andygeldman.com/index.php/2012/01/perils-of-multiple-project-collections-and-team-projects/</link>
		<comments>http://www.andygeldman.com/index.php/2012/01/perils-of-multiple-project-collections-and-team-projects/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 20:08:26 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=823</guid>
		<description><![CDATA[TFS 2010 has two &#8220;container&#8221; levels to separate instances of source control, work items and build: Project Collections and Team Projects. I think &#8220;Project Collection&#8221; and &#8220;Team Project&#8221; are both quite confusing terms, bordering on misleading. If you jump right into TFS without spending time on the books, blogs and ALM Rangers material you would <a href='http://www.andygeldman.com/index.php/2012/01/perils-of-multiple-project-collections-and-team-projects/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>TFS 2010 has two &#8220;container&#8221; levels to separate instances of source control, work items and build: Project Collections and Team Projects.</p>
<p>I think &#8220;Project Collection&#8221; and &#8220;Team Project&#8221; are both quite confusing terms, bordering on misleading. If you jump right into TFS without spending time on the books, blogs and ALM Rangers material you would naturally set up one Team Project for each of your, well, <em>projects</em>, and maybe use Project Collections to group together handfuls of related projects. My advice: that&#8217;s the last thing you should do.</p>
<p>Instead of taking the names at face value, look at them like this:</p>
<h4>Project Collection = <em>Organisation</em></h4>
<p>Project Collections cannot see each other <em>at all</em>. They are a way of having complete separation without needing multiple installations of TFS (as you did prior to the 2010 version). Each Project Collection has its own SQL Server database and there are very few reasons to have more than one, namely:</p>
<ul>
<li>Portability: You can quite easily detach a Project Collection and move it to a different TFS instance</li>
<li>Performance: If SQL Server starts creaking you can split Project Collections for performance reasons (but explore all other performance improvements first)</li>
<li>Law: If there is some regulatory reason why your data must be kept completely separate, multiple Project Collections will do that for you.</li>
</ul>
<p>If in doubt, remember: you can split a Project Collection with no loss of data but you can&#8217;t join them together again. (OK, you can use the TFS Integration Platform to migrate them together but you use fidelity, as it &#8220;replays&#8221; the source and work item history into the new database, and there are elements that can&#8217;t be migrated at all).</p>
<p>Summary: Unless you have a <em>very</em> good reason not to, have one Project Collection per organisation.</p>
<h4>Team Project = <em>Team</em></h4>
<p>Team Projects live together in a Project Collection, and can see each other transparently. However, each Team Project has entirely its own configuration in security, source control and work items. If you have a team that works on different projects, with team members moving regularly between projects or even working concurrently on multiple projects, the administrative burden of having a separate Team Project for every real project is likely to make your head spin.</p>
<p>Team Projects are good for separating teams or processes, which are hopefully the same thing &#8211; you don&#8217;t want one team following more than one process, do you? Sure, if you have a large project with a distinct team and it&#8217;s own way of working then a new Team Project is what you need &#8211; everything can be configured and customised just how that project needs. Otherwise, go with the &#8220;Project of Projects&#8221; approach outlined expertly by <a href="http://blog.hinshelwood.com/project-of-projects-with-team-foundation-server-2010/">Martin Hinshelwood</a>.</p>
<p>Summary: Have one Team Project per team, not per project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2012/01/perils-of-multiple-project-collections-and-team-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capturing “Done” in VS/TFS 2010</title>
		<link>http://www.andygeldman.com/index.php/2012/01/capturing-done-in-vstfs-2010/</link>
		<comments>http://www.andygeldman.com/index.php/2012/01/capturing-done-in-vstfs-2010/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 18:59:47 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=805</guid>
		<description><![CDATA[An agreed and fixed definition of &#8220;Done&#8221; (DoD) for an iteration is a powerful thing. It sets a quality bar that applies to all the team and all the work, avoiding wasteful discussions. At the retrospective the definition can be reviewed and the bar raised to push the quality up a notch, or if the <a href='http://www.andygeldman.com/index.php/2012/01/capturing-done-in-vstfs-2010/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>An agreed and fixed <em>definition of &#8220;Done&#8221;</em> (DoD) for an iteration is a powerful thing. It sets a quality bar that applies to all the team and all the work, avoiding wasteful discussions. At the retrospective the definition can be reviewed and the bar raised to push the quality up a notch, or if the team is failing to meet the definition actions can be agreed to remedy the situation.</p>
<p>To be effective, the team needs to find a way to verify each piece of work against the DoD. To keep the process lean, it helps to build verification into the process in as simple a way as possible. There are different ways of setting this up in TFS, for example work items could be customised to include fields for each part of the DoD, and those fields could become mandatory when setting the status to Closed. However, this approach requires the team member who closes a work item to vouch for all the work that went into it &#8211; work that may have been done by several people over days or weeks.</p>
<p>Instead of using work items directly, I believe the best way to track the DoD is at two &#8220;gates&#8221;: check-in and build. Check-ins should be small and frequent, and with continuous integration builds run on every check-in, so this gets the tracking of &#8220;done&#8221; as close as possible to the execution of individual pieces of work (i.e. tasks). This way, check-in policies and the build provide automatic checking, while check-in notes can be used to verify elements of the DoD which cannot be automated. Here&#8217;s an example DoD and how it can be tracked using those mechanisms:</p>
<h4>Example Definition of &#8220;Done&#8221;</h4>
<ol>
<li>Code builds</li>
<li>Code has been reviewed</li>
<li>Code is covered by unit tests</li>
<li>Code changes can be traced to requirements</li>
<li>Unit tests pass</li>
</ol>
<h4>Check-in Policies</h4>
<p>These are a great tool to maintain check-in standards. As previously posted, <a href="http://www.andygeldman.com/index.php/2012/01/tfs-alerts-for-team-leads/">check-in policies can be overridden</a> but it&#8217;s easy to set up an alert to detect that. The TFS Power Tools are a must-have here as they provide a number of check-in policies including the crucial <em>Custom Path Policy</em> &#8211; which scopes other policies to specific folders. I find the following policies very useful:</p>
<ul>
<li><em>Changeset Comments Policy</em>: requires a comment for every check-in. These should be used to provide a high-level summary of <em>what</em> has changed rather than why (<em>why</em> is captured better with a work item link).</li>
<li><em>Work Items</em>: requires a work item to be selected on check-in. This enables traceability to requirements. The policy can be scoped to a specific set of work items using the <em>Work Item Query Policy </em>but I have found this to be over-engineering.</li>
<li><em>Forbidden Patterns Policy</em>: prohibits certain files being checked-in. Best used with the <em>Custom Path Policy</em> and a consistent source structure so the prohibition can be scoped to certain folders. For example, you may prohibit compiled DLLs being checked into source code folders.</li>
</ul>
<p>Other policies such as <em>Builds</em>, <em>Code Analysis</em> and <em>Testing Policy</em> are in my opinion too restrictive or awkward to use, or are intended to meet requirements that are better met by automated builds.</p>
<h4>Check-in Notes</h4>
<p>These are simple text fields that can be customised, and made mandatory, for each team project. For example, a code (or peer) review can be verified by making the <em>Code Reviewer</em> field mandatory. This applies to all files in source control, so the team would need to decide if it&#8217;s OK to enter &#8220;n/a&#8221; for non-code check-ins or if all check-ins should be reviewed (including dependencies, documentation etc.) Shelvesets can be used to defer check-in and allow a team member to pick up a potential changeset for review.</p>
<h4>Build</h4>
<p>The TFS build system offers the greatest potential for customisation. Out of the box it will verify that code builds, and (if you use MSTest for unit tests) run the tests and calculate code coverage. There is an option in the default template to fail the build if any tests fail, but to take it further you need to customise the work flow. This could be used to fail the build if code coverage has dropped since the previous build, or bring virtually any other metric into the mix &#8211; enabling you to extend the build process as needed to match an extended DoD.</p>
<p>A really powerful option related to Build is Gated Check-in. This reverses the normal sequence so that build happens <em>before</em> check-in and if the build fails the check-in is rejected. This ensures that not only is the DoD tracked, but that code that does not meet it can never reach the code base and impede other work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2012/01/capturing-done-in-vstfs-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recommended TFS 2010 Admin Tools</title>
		<link>http://www.andygeldman.com/index.php/2012/01/recommended-tfs-2010-admin-tools/</link>
		<comments>http://www.andygeldman.com/index.php/2012/01/recommended-tfs-2010-admin-tools/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 18:21:50 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=794</guid>
		<description><![CDATA[Microsoft provides two TFS administration tools as standard: Name Source What TFS admin jobs does it do best? TFS Admin Console TFS installation Configure the installation of TFS Team Explorer Visual Studio or Team Explorer installation Team project settings such as areas and iterations, source control settings, security and groups. Development work such as build <a href='http://www.andygeldman.com/index.php/2012/01/recommended-tfs-2010-admin-tools/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Microsoft provides two TFS administration tools as standard:</p>
<table width="100%">
<tbody>
<tr>
<td><strong>Name</strong></td>
<td><strong>Source</strong></td>
<td><strong>What TFS admin jobs does it do best?</strong></td>
</tr>
<tr>
<td>TFS Admin Console</td>
<td>TFS installation</td>
<td>Configure the installation of TFS</td>
</tr>
<tr>
<td>Team Explorer</td>
<td>Visual Studio or Team Explorer installation</td>
<td>Team project settings such as areas and iterations, source control settings, security and groups. Development work such as build customisation.</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Good as these are, there is much they don&#8217;t do well (or at all). I have found the additional tools below very helpful.</p>
<table width="100%">
<tbody>
<tr>
<td><strong>Name</strong></td>
<td><strong>Source</strong></td>
<td><strong>What TFS admin jobs does it do best?</strong></td>
</tr>
<tr>
<td>TFS Power Tools</td>
<td><a href="http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f/">Visual Studio Gallery</a></td>
<td>Adds teams node, tools for customising work item process templates, backup/restore wizard, alerts explorer, test attachment cleaner etc</td>
</tr>
<tr>
<td>Team Foundation Sidekicks</td>
<td><a href="http://www.attrice.info/cm/tfs/">Attrice Corporation</a></td>
<td>View and undo check-outs, manage workspaces etc</td>
</tr>
<tr>
<td>TFS Administration Tool</td>
<td><a href="http://tfsadmin.codeplex.com/">CodePlex</a></td>
<td>Manage security across different products in a TFS deployment: TFS, SharePoint, and Reporting Services</td>
</tr>
<tr>
<td>Inmeta Build Explorer</td>
<td><a href="http://visualstudiogallery.msdn.microsoft.com/35daa606-4917-43c4-98ab-38632d9dbd45">Visual Studio Gallery</a></td>
<td>Organise build definitions into folders</td>
</tr>
<tr>
<td>TFS Area Import/Export Tool</td>
<td><a href="http://msmvps.com/blogs/vstsblog/archive/2007/07/07/copy-area-and-interation-structure-using-the-area-import-export-tool.aspx">Neno Loje</a></td>
<td>Copy areas and iteration between team projects (great if you have a sandbox or training team project)</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>There are many other add-ins and tools out there, but these are the ones I use with some frequency. I&#8217;ll update the table if I add others to my regular TFS toolbox!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2012/01/recommended-tfs-2010-admin-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work Items Alerts: CoreFields vs ChangedFields</title>
		<link>http://www.andygeldman.com/index.php/2012/01/work-items-alerts-corefields-vs-changedfields/</link>
		<comments>http://www.andygeldman.com/index.php/2012/01/work-items-alerts-corefields-vs-changedfields/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 18:12:43 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[TFS]]></category>
		<category><![CDATA[Work Items]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=757</guid>
		<description><![CDATA[The Visual Studio Alerts Explorer that comes with TFS Power Tools provides a great GUI for configuring email alerts on all kinds of events generated by TFS. However, it is not problem-free. A little while back I came across a bug, in Alerts Explorer or the TFS events system, which had a very irritating effect <a href='http://www.andygeldman.com/index.php/2012/01/work-items-alerts-corefields-vs-changedfields/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The Visual Studio Alerts Explorer that comes with TFS Power Tools provides a great GUI for configuring email alerts on all kinds of events generated by TFS. However, it is not problem-free.</p>
<p>A little while back I came across a bug, in Alerts Explorer or the TFS events system, which had a very irritating effect &#8211; spam! It took a good while to diagnose but a fairly simple workaround was found. Here&#8217;s the scenario&#8230;</p>
<p>Imagine you want to receive an email whenever a work item is assigned to you &#8211; a very common requirement. The obvious way to set it up is like this:</p>
<p><a href="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-05-at-14.32.25.png"><img class="alignleft size-full wp-image-758" title="Snap 2012-01-05 at 14.32.25" src="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-05-at-14.32.25.png" alt="" width="536" height="256" /></a></p>
<p>This alert definition should send an email to Joe Bloggs whenever a work item is assigned to him, except for when he assigned it to himself. And it will do exactly that, most of the time. Unfortunately it will also send an email when a link is added to a work item already assigned to Joe Bloggs, with no other changes made at the same time. Imagine that another user is linking a handful of work items, one at a time, to another work item that is with Joe Bloggs. Poor old Joe will receive one email for every link added!</p>
<p>To diagnose this issue it&#8217;s necessary to understand the TFS eventing system. It basically works as follows:</p>
<ol>
<li>Every time an event happens (the &#8220;WorkItemChangedEvent&#8221; in this case) an XML document is generated by the TFS Eventing system.</li>
<li>TFS sends the XML to all subscribers to that event, which in this case includes the Alerts system.</li>
<li>The Alerts system applies the filter defined for each alert to the event XML to identify which alerts are relevant.</li>
<li>For each alert match, an XSLT transformation is applied to convert the XML to HTML, and an email is fired off.</li>
</ol>
<p>So far, so good. So why does this alert also fire off emails when the only thing changed is a work item link? There are two parts to this puzzle. The first is the Filter Expression for the alert. Alerts Explorer handily exposes the underlying filter generated by the GUI on a second tab:</p>
<p><a href="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-05-at-16.32.57.png"><img class="alignleft size-full wp-image-769" title="Snap 2012-01-05 at 16.32.57" src="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-05-at-16.32.57.png" alt="" width="536" height="265" /></a></p>
<p>This is actually a partial XPath expression, which is applied against the event XML. If there&#8217;s a match then the alert is sent. This filter amounts to a query that (to paraphrase) says <em>CoreFields/AssignedTo/OldValue</em> is not &#8220;Joe Bloggs&#8221; and <em>CoreFields/AssignedTo/NewValue</em> <strong>is</strong> &#8220;Joe Bloggs&#8221; (the <em>ChangedBy </em>field isn&#8217;t part of the problem, so I&#8217;ll ignore it).</p>
<p>The second part of the puzzle is the event XML itself. Unfortunately this is much more difficult to come by than the Filter Expression. There are various methods by which you could get at the XML, but I found a simple solution was to replace the XSLT transformation which would normally generate a nicely formatted HTML email message with one that simply spits out the source XML as HTML, so you can see it in the resulting email. Of course you shouldn&#8217;t do that in a production system, as your users are unlikely to appreciate emails containing raw XML!</p>
<p>Quick instructions on how to replace the alert XSLT:</p>
<ol>
<li>On the TFS application tier go to this folder (or equivalent) &#8211; <em>C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent\Transforms</em></li>
<li>Rename <em>WorkItemChangedEvent.xsl</em> to <em>WorkItemChangedEvent.xsl.bak</em></li>
<li>Download <a href="http://www.andygeldman.com/wp-content/uploads/2012/01/XMLToHTMLVerbatim.zip">XMLToHTMLVerbatim.xsl</a> (Copyright 2002 Oliver Becker) copy it into the folder and rename to <em>WorkItemChangedEvent.xsl</em></li>
<li>Edit and save work items and inspect the resulting emails (there may be a two minute delay as alerts are queued)</li>
</ol>
<p>With that in place you can see that the XML generated when only adding links to a work item looks like this:</p>
<pre class="brush: xml; title: ; notranslate">

&lt;WorkItemChangedEvent xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
 ...
 &lt;Subscriber&gt;UK\JoeBloggs&lt;/Subscriber&gt;
 ...
 &lt;ChangeType&gt;Change&lt;/ChangeType&gt;
 &lt;CoreFields&gt;
 &lt;IntegerFields&gt;
 &lt;Field&gt;
 &lt;Name&gt;ID&lt;/Name&gt;
 &lt;ReferenceName&gt;System.Id&lt;/ReferenceName&gt;
 &lt;OldValue&gt;0&lt;/OldValue&gt;
 &lt;NewValue&gt;192&lt;/NewValue&gt;
 &lt;/Field&gt;
 &lt;Field&gt;
 ...
 &lt;/IntegerFields&gt;
 &lt;StringFields&gt;
 &lt;Field&gt;
 &lt;Name&gt;Work Item Type&lt;/Name&gt;
 &lt;ReferenceName&gt;System.WorkItemType&lt;/ReferenceName&gt;
 &lt;OldValue /&gt;
 &lt;NewValue&gt;Bug&lt;/NewValue&gt;
 &lt;/Field&gt;
 ...
 &lt;Field&gt;
 &lt;Name&gt;Assigned To&lt;/Name&gt;
 &lt;ReferenceName&gt;System.AssignedTo&lt;/ReferenceName&gt;
 &lt;OldValue /&gt;
 &lt;NewValue&gt;Joe Bloggs&lt;/NewValue&gt;
 &lt;/Field&gt;
 &lt;Field&gt;
 &lt;Name&gt;Changed By&lt;/Name&gt;
 &lt;ReferenceName&gt;System.ChangedBy&lt;/ReferenceName&gt;
 &lt;OldValue /&gt;
 &lt;NewValue&gt;Fred Smith&lt;/NewValue&gt;
 &lt;/Field&gt;
 ...
 &lt;/StringFields&gt;
 &lt;/CoreFields&gt;
 &lt;AddedRelations&gt;
 &lt;AddedRelation&gt;
 &lt;LinkName&gt;Affects&lt;/LinkName&gt;
 &lt;WorkItemId&gt;358&lt;/WorkItemId&gt;
 &lt;/AddedRelation&gt;
 &lt;/AddedRelations&gt;
&lt;/WorkItemChangedEvent&gt;
</pre>
<p>Even though the assignment has not changed &#8211; the work item has been with Joe Bloggs the whole time &#8211; the <em>OldValue </em>for AssignedTo is empty. The <em>NewValue </em>correctly says Joe Bloggs, so the filter is met and an alert sent! The eventing system detects the change but the XML has inaccurate values, so it appears that a different change occurred (I have reported this on <a href="https://connect.microsoft.com/VisualStudio/feedback/details/663564/tfs-2010-power-tools-alerts-explorer-incorrectly-uses-corefields-node-for-changes-to-changes-from-operators">Microsoft Connect</a>).</p>
<p>The workaround (which is thankfully much simpler than the investigation) is to modify the alert definition to also reference the XML&#8217;s <em>ChangedFields</em>. These fields are not populated in the example above, but are present in every other type of work item change. It seems a little odd that Alerts Explorer does not reference these fields when you use the <em>Changes To</em> or <em>Changes From </em>operators, because it does when you use the <em>Changes </em>operator. So all you need to do is add a <em>Changes</em> operator to the alert definition like so:</p>
<p><a href="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-05-at-17.55.15.png"><img class="alignleft size-full wp-image-780" title="Snap 2012-01-05 at 17.55.15" src="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-05-at-17.55.15.png" alt="" width="532" height="269" /></a></p>
<p>The filter expression now includes <em>AssignedTo </em>within <em>ChangedFields </em>as shown below, ensuring you don&#8217;t get the alert unless that field really has changed.</p>
<p><a href="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-05-at-17.58.02.png"><img class="alignleft size-full wp-image-781" title="Snap 2012-01-05 at 17.58.02" src="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-05-at-17.58.02.png" alt="" width="542" height="135" /></a></p>
<p>I suspect the fix for this is a change to the TFS eventing system to properly populate the <em>OldValues</em>, or a change to Alerts Explorer to reference <em>ChangedFields </em>when using the <em>Changes To/</em><em>From </em>operator (or both).</p>
<p>Although it&#8217;s painful to debug this issue, it gives an interesting insight into the system and hopefully this post will help others figure out why TFS is spamming them!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2012/01/work-items-alerts-corefields-vs-changedfields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TFS Alerts for Team Leads</title>
		<link>http://www.andygeldman.com/index.php/2012/01/tfs-alerts-for-team-leads/</link>
		<comments>http://www.andygeldman.com/index.php/2012/01/tfs-alerts-for-team-leads/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 19:20:50 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=744</guid>
		<description><![CDATA[TFS has a great (but not perfect) events and alerts system &#8211; you can be sent emails about work item changes, source control check-ins and build completion. TFS Power Tools adds Alerts Explorer to Visual Studio, which is a must-have for configuring alerts as the built-in Project Alerts is very basic. Alerts Explorer allows very <a href='http://www.andygeldman.com/index.php/2012/01/tfs-alerts-for-team-leads/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>TFS has a great (but not perfect) events and alerts system &#8211; you can be sent emails about work item changes, source control check-ins and build completion. TFS Power Tools adds <em>Alerts Explorer</em> to Visual Studio, which is a must-have for configuring alerts as the built-in <em>Project Alerts</em> is very basic.</p>
<p>Alerts Explorer allows very sophisticated filters to be set up, but that power can be confusing. I have found that in a development team lead role just two special alerts provided the oversight I needed. Here&#8217;s how to set them up.</p>
<h4>Alert 1: Check-in Policy Override</h4>
<p>Check-in policies (along with folder security) are invaluable for source control management &#8211; they can enforce check-in comments and linked work items, and prohibit specific file types being checked-in. However, users can simply override the check-in policy! In one way this is helpful, because it allows work to continue past an overly-restrictive policy, but in every other way it&#8217;s madness &#8211; people can ignore your carefully constructed policies whenever they like.</p>
<p>Fortunately there is a good compromise &#8211; you set up an alert telling you when the check-in policy has been overridden. That way, the user can override the policy if they think they really must, but you get to review what happened and take action if necessary. I found that simply telling people that you get an alert when the policy is overridden was a sufficient deterrent 99% of the time.</p>
<p><a href="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-03-at-18.18.59.png"><img class="alignleft size-full wp-image-745" title="Check-in with policy overriden alert" src="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-03-at-18.18.59.png" alt="" width="534" height="230" /></a></p>
<p>This alert is a slight modification of a template that comes with the TFS Power Tools. Note that all source control users must have the power tools installed if you are using any of the check-in policies that come with the power tools, or you will receive an alert every time they check-in (which is quite useful, as you can then tell them to install the power tools!)</p>
<h4>Alert 2: Build Failure</h4>
<p>The Build Notifications tool that comes with Visual Studio is OK, as it generates system tray alerts that are near-synchronous with build completion. But it&#8217;s not much help if a build failed an hour ago or overnight. An email alert can cover this instead.</p>
<p><a href="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-03-at-19.13.38.png"><img class="alignleft size-full wp-image-748" title="Failed builds" src="http://www.andygeldman.com/wp-content/uploads/2012/01/Snap-2012-01-03-at-19.13.38.png" alt="" width="530" height="226" /></a></p>
<p>Note that I have not simply chosen <em>StatusCode = Failed</em> as I also want to be alerted on builds that are &#8220;partially successful&#8221; i.e. that have test failures. I&#8217;ll give users the benefit of the doubt on Stopped builds and assume that builds are only stopped for valid reasons. You may decide differently for your team.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2012/01/tfs-alerts-for-team-leads/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TF201001: Cannot change topology for a link type</title>
		<link>http://www.andygeldman.com/index.php/2011/12/tf201001-cannot-change-topology-for-a-link-type/</link>
		<comments>http://www.andygeldman.com/index.php/2011/12/tf201001-cannot-change-topology-for-a-link-type/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 18:44:14 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[TFS]]></category>
		<category><![CDATA[Work Items]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=736</guid>
		<description><![CDATA[TF201001 is an error you can get when working with custom link types, and is time-consuming and disruptive to resolve, so merits discussion. First, some background&#8230; before TFS 2010 you could link work items together, but couldn&#8217;t specify what their relationship was. In TFS 2010 you can do that, because there are different link types <a href='http://www.andygeldman.com/index.php/2011/12/tf201001-cannot-change-topology-for-a-link-type/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>TF201001 is an error you can get when working with custom link types, and is time-consuming and disruptive to resolve, so merits discussion.</p>
<p>First, some background&#8230; before TFS 2010 you could link work items together, but couldn&#8217;t specify what their relationship was. In TFS 2010 you can do that, because there are different <em>link types</em> to choose from including parent/child, successor/predecessor and related. As you may guess from the names, each of these link types has rules that define how they can be used, called a <em>topology</em>. For example:</p>
<ul>
<li><strong>Parent/child</strong> uses a <em>tree </em>topology &#8211; meaning that relationships must be one-to-many and cannot be circular. So a child can only have one parent (only in the field of computing could that statement pass without bemusement).</li>
<li><strong>Successor/predecessor</strong> uses a <em>dependency </em>topology &#8211; meaning that relationships are many-to-many but cannot be circular, and the direction determines what name is given to the link.</li>
<li><strong>Related</strong> uses a <em>network </em>topology &#8211; meaning that anything goes, including circular relationships, and the link has the same name regardless of direction. It indicates that work items have something in common without saying exactly what that is.</li>
</ul>
<p>You can use the link types that come with TFS 2010 to define richer relationships between work items, but you can also create new custom link types.</p>
<p>You define a custom link type in an XML file like so:</p>
<pre class="brush: xml; title: ; notranslate">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;LinkTypes&gt;
 &lt;LinkType ReferenceName=&quot;MyCo.LinkTypes.Releases&quot; ForwardName=&quot;Releases&quot; ReverseName=&quot;Released By&quot; Topology=&quot;Tree&quot; /&gt;
&lt;/LinkTypes&gt;
</pre>
<p>And upload it into TFS using witadmin:</p>
<pre class="brush: bash; title: ; notranslate">

witadmin importlinktype /collection:http://myserver:8080/tfs/DefaultCollection /f:&quot;LinkType_Releases.xml&quot;
</pre>
<p>This particular link type was created so TFS could be used to track complex configuration changes, linked together under a new <em>Release</em> work item type. The thinking at its creation was that one work item could only be linked to one Release, so the Tree topology was the right choice. It later turned out that under some circumstances one work item could be included in multiple Releases &#8211; which is prohibited by the one-to-many rule of the Tree topology.</p>
<p>So the logical decision is to modify the custom link type to the Dependency topology, which (sadly) results in:</p>
<p><strong><em>TF212018: Work item tracking schema validation error: TF201001: Cannot change topology for a link type MyCo.LinkTypes.Releases, it has already been defined.</em></strong></p>
<p>Ouch! Even though I want a less restrictive topology, TFS prohibits the change. There is no simple way to get around this &#8211; getting the change in place requires a tedious workaround such as:</p>
<ol>
<li>Rename the existing link type</li>
<li>Create a new corrected link type</li>
<li>Change all of the work items using the old link type to the new link type</li>
<li>Delete the old link type</li>
</ol>
<p>I can understand that changing a link type to a more restrictive topology could invalidate existing links, so it makes sense to prohibit that change, but why not allow a change to a less restrictive topology &#8211; which cannot possibly cause that problem?</p>
<p>I&#8217;m guessing that Microsoft either didn&#8217;t think of this scenario, or thought it too rare to accommodate. Either way, the lesson is that custom link type topologies should be chosen with great care and, if in doubt, choose the one that is less restrictive!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2011/12/tf201001-cannot-change-topology-for-a-link-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Process Template Customisation – Look Before You Leap</title>
		<link>http://www.andygeldman.com/index.php/2011/12/process-template-customisation-look-before-you-leap/</link>
		<comments>http://www.andygeldman.com/index.php/2011/12/process-template-customisation-look-before-you-leap/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 14:57:23 +0000</pubDate>
		<dc:creator>Andy Geldman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[TFS]]></category>
		<category><![CDATA[Work Items]]></category>

		<guid isPermaLink="false">http://www.andygeldman.com/?p=726</guid>
		<description><![CDATA[There are circumstances when you might want to make changes to the TFS process template, such as creating a new work item type (WIT). Technically, process template changes are often straightforward. However the main considerations to be wary of are not technical, they are about process and project management &#8211; so don&#8217;t make changes just <a href='http://www.andygeldman.com/index.php/2011/12/process-template-customisation-look-before-you-leap/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>There are circumstances when you might want to make changes to the TFS process template, such as creating a new work item type (WIT). Technically, process template changes are often straightforward. However the main considerations to be wary of are <strong>not</strong> technical, they are about process and project management &#8211; so don&#8217;t make changes just because you can!</p>
<p>Before leaping in, ask yourself the following:</p>
<h3>Are we using the right process template?</h3>
<p>Using a different process template could give you what you  need in a simple and well-proven package. This requires you to create a new Team Project, because you can&#8217;t change the process template for an existing team project. (Although you could get away with it if you haven&#8217;t used Work Items yet, by importing Work Item Type Definitions etc.)</p>
<p>For example, the CMMI  template comes with Risk and Review WITs, along with detailed guidance on how to use them for risk management and code reviews respectively. By the way (and contrary to popular belief) the CMMI process template does  not preclude you from using Agile methodologies, you can absolutely do Agile (and Scrum)  with the CMMI template &#8211; we do. (Although it does lack some  resources available from the Agile  and Scrum templates such as iteration planning workbooks). Work item fields belong to the Project Collection, not Team Projects, so whichever template you adopt you can easily add fields you like from other templates.</p>
<h3>Do you understand your process template?</h3>
<p>There is very detailed MSDN guidance on each template here:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/dd380647.aspx">Agile</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd997574%28v=VS.100%29.aspx">CMMI</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ff731587.aspx">Scrum</a></li>
</ul>
<p>It may be some time since you last read the guidance, or you may have skipped it completely, so take time and understand how the templates are intended to be used. This may sound like preaching, when you just want to make a change, but it&#8217;s not unusual for a team to make an (apparently) must-have modification only to realise later that their needs were already met &#8211; they just hadn&#8217;t realised it. You could even end up reversing you change once you understand the template properly &#8211; a situation I have seen several times.</p>
<h3>Is it you who needs to change?</h3>
<p>The TFS work items system defines and tracks the day-to-day software development process for your team, so it&#8217;s crucial to use it well. Any team could adopt TFS and carry on working exactly the way they did before &#8211; using, abusing or ignoring the system as required to get their work done the old way they are used to.</p>
<p>It&#8217;s easy to think along lines like &#8220;TFS needs to change to fit the way we work&#8221; but make sure you don&#8217;t miss out on process improvements by changing the way you work instead. Question why you work the way you do and don&#8217;t accept that it&#8217;s right without some detached evaluation first. Some working practices are laid down diligently to meet the needs and technology available at that point in time, while others spring up in reaction to particular problems, or develop organically. Requirements, technology and the work you do can change quickly, and the process that was right even just a couple of years ago may not be right now. Don&#8217;t be afraid to adapt yourself rather than your technology &#8211; the default template may define a better process than the one you have now.</p>
<h3>Does the naming fit?</h3>
<p>Language is far from precise, and trying to distil complex concepts into one or two words is extremely difficult. For example, the CMMI state workflow of Proposed/Active/Resolved/Closed is simple, but can be a huge source of confusion &#8211; does Active mean someone is working on it or that just that the work is ready to be worked on? Does Resolved mean the work has been completely finished (a valid interpretation by the dictionary definition) or just that it has been implemented and we need to verify it?</p>
<p>Likewise, words such as &#8220;issue&#8221; can be vastly overused and the Issue work item type could mean almost anything, rather than the blocker or impediment it is intended to be.</p>
<p>Before making wholesale changes, consider if a simple renaming could meet your needs. You can rename almost anything in TFS process templates &#8211; fields, work item types, layout labels, states, transitions etc.</p>
<h3>But if it does need to change&#8230;</h3>
<p>Then absolutely change it!</p>
<p>The message here isn&#8217;t &#8220;never change the process template&#8221;, it&#8217;s &#8220;understand it, then make changes in the right place&#8221;. There are many valid reasons to change the process template, and you should never be held back by a template that isn&#8217;t working for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andygeldman.com/index.php/2011/12/process-template-customisation-look-before-you-leap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

