Showing posts with label TFS 2013. Show all posts
Showing posts with label TFS 2013. Show all posts

Monday, April 13, 2015

Release Build Failed in Release Management

vswhitelogoI had recently setup a new stage in my deploy process.  It had yet to be tested and a developer checked in some code which triggered a build.  My team (devops) was promptly contacted with a generic failure message (from the person and system).  What had happened?
The build error as seen within Visual Studio was:
ERROR: The deployment for release template 'Prospect Connect' has not been completed successfully. Check the releases history for more details.
Exit: 1

This doesn’t give anyone much to go on.  Furthermore the following message was also included which didn’t help:
Exception Stack Trace:    at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Unfortunately as of 2013 Update 4 you cannot drill into the Release Manager error within Visual Studio.  My developers don’t have access to RM yet so it was up to me to see what had happened.
As it turns out the new stage I added was failing because the environment is in a different domain and it could not access the drop location.  What I wanted to change though is a way to generate good builds and green lights back to the team.  They only care about deploys to the first (dev) environment and not the next stage.
To accomplish that I removed the automation from the second stage.  I had only put it in place until the team could decide what their process was going to be.  For now I will send notification to the devops team to approve and deploy builds to the next stage.
My goal was accomplished because the system stops at that point and send back to TFS Build a successful deploy message for the first stage.
What other things in RM have you seen that return an Exit 1 back to TFS Build?

Tuesday, March 31, 2015

Default Access in TFS Requires a TFS CAL

When adding new users to TFS be careful.  Adding them to a team sets them with the Basic (default) access level.  This means you need to be proactive when adding any users to TFS. 

Make sure you move them into the appropriate AD group within your Access levels

del.icio.us Tags: ,,
before you add them to a team.  Otherwise you will end up like me having to take away features from someone who was like “cool I like that feature.”  In my case they were just a stakeholder.

Ensure you do this so when true up time comes you are not paying for CALs when you didn’t really need them.

DefaultLevel

Monday, March 2, 2015

Modifying Code Reviews in TFS 2013

Recently I made a security change that effectively prevented Contributors from editing work items in the default area for the team project.  This also stopped anyone who just left the default area (the root) selected when creating a code review.

In implementing portfolio management I am now reserving the root area for epic/project work item types only.  These WIT I will end up locking down to be created/edited by our PMO office.  I do not want a random developer creating a user story with a crazy title that will be visible to senior leadership or our PMO office.

Upon searching nothing jumped out as an easy way to change the area.  Also when opening the code review work item the area path was grayed out and not alterable.  Then it dawned on me that this is a work item and like any other work item I should be able to query it and edit the results.

image

The query about showed me all the open code reviews that where in my root area (PD).  I then selected the results and moved them to the appropriate area path.

One final note is to remind your teams that when they create code reviews from changesets to not leave the default area selected.  Select the area that matches your product or team.

del.icio.us Tags: ,

Thursday, February 26, 2015

Changing a Work Item Type in Team Foundation Server is not deep

I have a whole bunch of cards I created with the wrong work item type.  I read Damian’s post on how to do this.  When I performed the steps in the TFS Web Access and in Visual Studio the existing links did not stay linked to the copy.

In Damian’s post he states that it is a deep copy of the work item (and he even has screen shots.)  So at this point I am not sure if it is because of 2013 Update 4 or if the change in the work item type is causing this. 

image

Below is a copy where you can see only the related link exists.

image

These are custom WIT but I have also tried it on Features, Stories, etc..

del.icio.us Tags: ,

Thursday, January 29, 2015

TFS Wildcards in Workspaces Command

A user wanted to know how to list all of a certain users workspaces across all machines without having to install TFS Sidekicks.  It is a simple command and you can use the * wildcard for the owner or computer.
tf workspaces /owner:UserName /computer:* /collection:TFSURLIncludingCollection
This will produce a nicely formatted list of workspaces for that user.  This could be used in a script to delete workspaces for a user but with Sidekicks around that is my preferred option as an administrator.
del.icio.us Tags: ,

Tuesday, January 27, 2015

TFS Wildcards and History

A coworker had asked me the other day if it was possible to get a list of changes for a subfolder with a certain name.  This subfolder lets call it Views is located in multiple places on the branch.
I tested out to see if you could place wildcards in the itemspec path.  The answer is no you cannot.  You can only place wildcards at the end.  For example this does not work:
tf history -server:http://tfs/tfs/MyCollection $/MyProject/Branches/Database/MSSQL/*/Views/* -recursive -format:detailed –noprompt
This does work:
tf history -server:http://tfs/tfs/MyCollection $/MyProject/Branches/Database/MSSQL/* -recursive -format:detailed –noprompt
In the end you would have to write a script to sort through the files in each changeset and filter out just the changesets returned that had /View/ in the path.  If I get some time to write this script I will post it.  Hope this help you.

del.icio.us Tags: ,

Tuesday, January 13, 2015

Using TFS 2013 Update 4 License Change for Agile Teams

We are in the process of upgrading to Update 4 and were figuring out how the license changes affect us (was hoping for costs savings.)  They don’t and probably won’t save us on MSDN costs.  Read on to see how it could save you.

Development

All of our developers and testers have an MSDN Premium or Ultimate.  This covers them not only for TFS but also access to all there test environments and whatever software they have installed.  They will remain at the Advanced access level.

Product Management

The next layer of user is the product owner.  Our product owner sits with each team and helps to manage and groom the backlog.  They also validate work is done which means they use development environments.  That being said they will continue to need MSDN Premium.
I was hoping we could drop them down to Basic (TFS CAL) but the environment thing stops that.  With Basic access a product owner could plan and prioritize user stories for their team but not features.  I guess features is what Microsoft deems advanced planning.  This would be a big cost savings to some companies.
Our next layer is product manages themselves.  While they don’t hop on the development environments that still need to be able to plan and prioritize at the feature level.  With Microsoft’s new license structure nothing changes for us.  Again to get just that feature requires an MSDN license.  That is pretty costly unless I can get them to use the feedback or storyboarding features.

The Stakeholder

This access level is free and allows the editing and creating of work items.  If your product managers are willing to do some work in Excel this will provide your company with some cost savings. 
They can prioritize by using the Team add on in Excel.  To do that just have a query of the features and make sure the Stack Rank is one of the columns.  They can then modify the stack ranks to prioritize the work items.  Once that is done a publish up to TFS will update it for the teams to work from.
This could become cumbersome as working with the stack ranks is not easy for a large number of work items.  The PM’s at my company need to be able to work fast so this will not fly.  Hopefully some one else out there will be able to do this and same some $$. 
Happy ALM’ing!
del.icio.us Tags: ,,

Thursday, November 20, 2014

Setting up a client trace with TFS 2013

Users may report performance issues with Team Foundation Version Control. Sometimes it may be something the TFS client is doing or sometimes it may be the server side.  I have seen a post around source control permissions causing the issue.  This is unlikely the cause in my case because the user was able to work around the slowness by converting their workspaces to server workspace's and then back to local.  I am trying to figure out what is causing this and came across this post regarding TFS Client Tracing.  With a few tweaks I was able to get it to work with Visual Studio 2013 Update 4.

Below is an updated version for Visual Studio 2013.

  1. Shut down Visual Studio
  2. Using Windows Explorer navigate to the following directory (my install was in Program Files (x86) directory):
    C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE
  3. Make a backup copy of the devenv.exe.config
  4. Edit devenv.exe.config by adding the following before the last </configuration> :
<system.diagnostics>
<switches>
<add name="TeamFoundationSoapProxy" value="4" />
<add name="VersionControl" value="4" />
</switches>
<trace autoflush="true" indentsize="3">
<listeners>
<add name="myListener" type="Microsoft.TeamFoundation.TeamFoundationTextWriterTraceListener,Microsoft.TeamFoundation.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" initializeData="c:\tf.log" />
<add name="perfListener" type="Microsoft.TeamFoundation.Client.PerfTraceListener,Microsoft.TeamFoundation.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</listeners>
</trace>
</system.diagnostics>

  1. Trace data will be written to "c:\tf.log (blold above).  Change this file name if you prefer
  2. Save the file
  3. Start Visual Studio
  4. Run steps you are interested in tracing
  5. Open c:\tf.log or the file you specified it in step 5
  6. This writes a lot of data so you will want to restore to the original setting when finished by copying the original devenv.exe.config file back or commenting out the lines in step 4 by surrounding the lines with <!-- and --> .

Tuesday, November 4, 2014

Switching Workspace Location on a Mac

vswhitelogoOne of our developers is doing development on a Mac.  The user has TEE (Team Explorer Everywhere) plug-in installed for Eclipse.  The user initially created a server workspace and wanted to switch it to a local workspace.  Unfortunately when doing that in the UI it did not work and gave a permission denied error.  How to fix that?

As luck would have it they did not take a screenshot of the error and I didn’t want to bug him too much to recreate it.  Developers at my company are very busy and they need time to focus (so I minimize disruptions to them). 

Looking at the file in question we could see that it had these permissions

--r—r—r root staff

Our best guess is the Eclipse UI did not have enough rights to alter the permissions on the file.  Upon doing some research there is no command line option to alter the location to local using the tf workfold nor the tf workspace commands.  The only time you can set this on the command line is when creating a NEW workspace.

So my final recommendation to this poor soul was to have 2 workspaces.  One server workspace for managing (branch/merge) whole branches and create a second workspace that is local.  The day to day work on his cards would be done there.

One note I have asked him to run Eclipse with sudo so we will see if that works.  I will update the post if I hear good news.

Thursday, October 30, 2014

Cleaning A TFS Workspace

This option doesn’t clean files not under source control that may live in your workspace.  It also doesn’t undo checkouts.

  • Get specific Version…

clip_image001

  • Check the first box for overwriting writable files
  • If you check the second checkbox as well it will download everything

clip_image002

There are other Powertools commands to clean your workspace. Be careful with these as they may delete items you don't have under source control.

  • tfpt scorch – Ensure source control and the local disk are identical
  • tfpt treeclean – Delete files and folders not under version control
del.icio.us Tags: ,

Monday, October 27, 2014

Exception System.IO.FileLoadException, Exception thrown executing tests

We are in the process of moving from CuiseControl.NET and NAnt into TFSBuild.  One of the .NET solutions I was prototyping kept giving me a generic error message when it tried to run the NUnit tests we have.

The message was…

Exception System.IO.FileLoadException, Exception thrown executing tests mytest.dll

Took me a few days but finally came across a post that got me thinking.  Some of our references are fully signed.  So that means the test which is unsigned is trying to call some signed assemblies to execute. 

I first enabled verification skipping on the build machine (see the SN help for this).  That worked and it was able to execute NUnit tests.  But I don’t want that enabled on my build machine.  Having that could result in files not getting signed and deployed.  This would result in runtime errors in our environments.

The solution is to add a line similar to this on the MSBuild arguments (under Advanced) for your build definitions.  It will look something like this:

/p:SignAssembly=true,DelaySign=false,AssemblyOriginatorKeyFile=..\..\Global\MyPrivateKey.snk

 

del.icio.us Tags: ,

Wednesday, October 22, 2014

Deleting a Branch or Folder in TFS Without Getting The Whole Branch in Your Workspace

imageOne of our teams has a rather large branch consisting of some 53k files.  Using one of the IDE’s it requires you to have the latest of the branch before the Delete option will no longer be grayed out.  This results in frustration by the team as they regularly delete feature branches after it has been merged to their Integration branch.  There does not seem to be a way in Visual Studio 2013 to not do a recursive get latest.

Did some searching on the internet and Stackoverflow.com had some answers with very short ways of what I am about to show.  I felt some more detail might help others out there searching for speed.

The first thing you need to do is open a command prompt where the tf.exe command is accessible (or you will need to type the full path to it each command).  Mine is found in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE.  This is in my PATH but I am not sure if Visual Studio put it there or if I did. 

  1. From the command line go to the folder above the branch you want to delete using CD pathname
  2. In my example I am deleting the Int branch.  So we need to get just that object.  Type in tf get branchname (Ex: tf get Int).  This also got the immediate children into my workspace as well.  Not so bad as getting the entire branch.  The command line has a recursive option if you want to get the whole thing.
  3. Now we delete the branch with a tf delete $/TFS/Path/To/The/Branch  (Ex: Tf delete $/TheMaster/Branches/Unmanaged/sandbox/mrainey/Int)  You can see in my picture above only the branch has a red X on it. 
  4. Last but not least submit the pending changes.  I did this in Visual Studio so I could verify what was in my list of things to check in.  the only thing listed was the branch so it was a simple check in option. 

So just the branch was deleted and none of the children folders/files remain either.  Very clean and quick.

del.icio.us Tags: ,

Wednesday, September 24, 2014

TFS Query–Tasks Completed Yesterday

Sometimes boards get allot of cards on it and during your standup it may be hard to remember what you did yesterday.  That done column gets pretty big even for smaller sprints when teams create a hundred tasks.  I did not see this query in the default set.  It was easy as it is just one new clause added on to the existing Completed Tasks query. 

Just add the following clause:

And Closed Date = @Today – 1

image

del.icio.us Tags: ,

Tuesday, September 9, 2014

Planning with Iterations

imageOne of the things some of the teams would like to start using is the planning feature in TFS.  This feature is enabled on the Stories backlog.  Over on the right there is the Forecast option.  Just turn this on and set the velocity to your teams.  Currently this is a manual task and you will need to determine what velocity to use (last sprint, an average, etc.)
image
Once this is set you will see a line break with the iteration in the backlog.  This is useful for your planning meetings as well as forecasting how many iterations will be needed to complete a feature (all user stories done).
The question that our team had was how many iterations do you make visible/available for planning into the future? Initially I thought having to many future iterations would clutter things so I created them but did not make them visible.  Unfortunately this does not help the end user as those iterations don’t show up for planning purposes.
image
Going back into the admin page for the team I then selected all of the iterations I had created.  Thus making them visible for planning.  Now we can see all of the iterations and the team was able to forecast how many until this epic would complete.
image
Currently we are going to try out 2 week sprints and see how that goes.  I have read others doing three weeks but as a friend told me it is much easier to think about what you can get done this week and next.  This keeps things focused and easier to manager.  We will see.  Thanks for reading.
Are you able to plan out 2 weeks ahead what your going to do?

del.icio.us Tags: ,

Friday, August 8, 2014

SQL Server Reporting Services Permissions for TFS 2013

SQL Server Reporting Services (SSRS) Setup
Some teams would like to be able to create and upload their own reports.  Following a similar approach for multiple teams in one collection/team project approach a folder called _Teams under the team project folder was created.

Under the team folder will be folders for each team who want custom reports.  The permissions Microsoft says to grant are admin level permissions.  Because of this they will be restricted to SG.TFSTeamAdministrators security group.  The rest of the team will still be able to view the reports.  This is done ONCE on the _Teams folder.  No further action is required to maintain this.
 


Report Builder Setup
The Report Builder button was not showing up for the users.  After further research a Microsoft article was found that had some basic setup information in it.  I was hesitant at first but after seeing other posts about the missing button I pulled the trigger and created a new role assignment at the system level.  It grants System User to all of the collections users.  We have an AD group for this so that was used.  This was granted in the report manager application as well by clicking on the Site Settings in the upper right corner and going to the security section.



This was probably an omission in the TFS Setup instructions because it is custom and not needed for TFS to publish reports (no need for Report Builder). 

SQL Server Analysis Services Setup
The next step is granting permissions for SQL Server Analysis Server.  The Microsoft article written for TFS 2013 details the permissions needed for both the relational data warehouse and analysis cube.  Because this grants permissions at a collection level, it will be restricted to a security group you have created that contains all of the team administrators for TFS.
  • For the database you will need to create the login for the group at the instance level and then assign it the roles on the Tfs_Warehosue database.
     
  • Make sure when adding a group to check the box for searching those objects.  It is not checked by default.  his tip applies to the database and the cub (Analysis Services) permissions.


Thursday, August 7, 2014

Update Other Users Profile Picture in TFS 2013

As TFS administrators we have been contemplating how to change profile pictures for those who choose not to upload one.  Team and person identity is important in building a strong team.  There is no active directory integration yet for setting these automatically so after some digging an existing solution was found.


One thing not mentioned in the article is that you must have Visual Studio or Team Explorer 2012 installed or you will get Could not load file or assembly 'Microsoft.TeamFoundation.Client, Version=11.0.0.0…


The site mentions recycling app pools or rebooting the application servers.  Since this is production that would have to go through the change management process.  That did not have to be done as our picture changes updated right away with a (ctrl-f5.)

Monday, August 4, 2014

Team Explorer Everywhere on MAC

Setup Team Explorer Everywhere 2013
We have a build server for Apple applications.  This will need to switch over to TFS as part of the migration from SVN to TFS 2013.  Microsoft (MS) does make interaction with Team Foundation Server (TFS) possible through the use of Microsoft Team Explorer Everywhere 2013 (TEE).  It can be downloaded here.  One thing to note is this is a command line utility.  There is no GUI for it unless you install Eclipse and then the TFS plug-in for Eclipse.

The install documentation is very lax and consists of 3 basic steps.

To install the Cross-Platform Command-Line Client for Team Foundation Server
  1. Unzip the archive (TEE-CLC-12.0.0.zip file) that contains the client.
  2. Configure your shell or system path to include the folder to which you unzipped the archive.
  3. To verify that the client is working, at a command prompt, type tf, and then press the ENTER key.

I believe MS assumes you know the OS in detail.  However this is not always the case (I know nothing about MAC X).  Below are the steps I followed to get the utility running for all users.  I do have prior knowledge of Unix command line which helped me get through this.

  1. Download and unzip to a location on the MAC.  In my case this was to the Dumps share (Unzipped from Windows to the MAC share).
  2. Log into the MAC build server as an administrator (or someone with SUDO permissions.)
  3. Since I unzipped the folder as my Windows user the MAC user did not even have writes to read the folder contents.  Grant Everyone read by overwriting the MAC permissions in Finder
  4. On the MAC build server open the command line console.
  5. So that all users have access to TEE we will copy the folder a common location.   Use the cp command to accomplish this.
    cd /usr/local
    sudo cp -R /dumps/TEE-CLC-12.0.1 .
You should get a prompt for your password.  If you do not have sudo rights you will not be able to execute this command.

  1. Edit the system path for MACs to include this new folder in searching for commands.
    sudo nano /etc/paths
  2. Add a new line at the end of the file that has /usr/local/TEE-CLC-12.0.1
  3. Save and close the file (Ctrl-X and Yes)
  4. You will not be able to run the tf command until permissions are granted to all users.
    cd /usr/local/TEE-CLC-12.0.1
    sudo chmod 755 tf
  5. Close and reopen a new terminal to apply the path changes
  6. Type in tf.  Now you should get the help information for the file if the path and application are setup properly.

Thursday, July 31, 2014

Adding TFS 2013 User Story Points field in Microsoft Project

Although we are an agile shop we still have a few managers who like to use Microsoft Project.  There is no project server setup to integrate with Team Foundation Server.  As of now the manager would like to export from TFS into MS Project, update, and import back in.  

Once the data is in project he will setup dependencies and other linking project managers like to do.  With the goal of producing a Gantt chart to help with dates.  They already have this by working with the velocity and burn down charts so I believe the main benefit is the setting up of task dependencies and making those visible.  I haven't found a good way to do this in TFS yet (sibling links don't stop you from completing a task before a dependency.)

Project uses field mappings between TFS and itself to define what fields show up in Project and which are editable.  One of the fields the project manager wanted to be able to update is StoryPoints.  As luck would have it this is not one of the default fields that show up.

This Microsoft article gives some explanation to the TFSFieldMapping file and how to download and upload it to TFS.

I followed the documentation and went with the advice of the project manager to add the field as ProjectField="pjTaskText20".  I learned a few things by doing this.  When trying to upload I got this message:

TF233004: You must install Office Primary Interop Assemblies (PIA) in order for Team Foundation Server to validate the Office Project Field Mapping file prior to upload. To install PIA, go to the Microsoft Web site: http://go.microsoft.com/fwlink/?LinkId=168855.

I went to Microsoft's site and found the Microsoft Office 2010: Primary Interop Assemblies Redistributable.  After installing this I got the same message.  The internet certainly makes work easier.  After some searching I found a post that says this doesn't work.  What you really need to do is install MS Project.  Hopefully for the reader you have this available to you.

On the next upload attempt I did get a little further.
Connecting...
Validating...
TF233003: Cannot upload the specified file as it either contains invalid elements or the elements are not in the correct sequence. Correct the Team Foundation Server Field Mapping file and try again.
Error detail:
TF234001: Work item field Microsoft.VSTS.Scheduling.StoryPoints is mapped to the wrong field type in Microsoft Project. You can map work item fields of type Double only to Project Cost, Duration, Work, and Number fields. Map the work item field to a Microsoft Project field of type Double.

Again I turned to the internet and found a better article.   What I needed was to define it as a Number (I guess that suffices for type Double.)
Columns displayed in Project depend on the predefined TFS - MS Project work item field mapping. To make Story Points show up in MS Project, you have to customize the Project-TFS mapping file since Story Points are not mapped to a Project field by default.
1. From the VS Command Prompt, run "TFSFieldMapping download" command to get the mapping file locally.
2. Add a new entry to the file to map your Story Points field to an MS Project field (pjTaskNumberx)
3. From the VS Command Prompt, run "TFSFieldMapping upload" command to push the mapping file back to the TFS Server.


This worked like a charm.  Below is the command I used for the download and what the tfsfieldmappingfile looks like with my addition.  As always you should keep a copy of the original field mapping file (in TFS) and check in any changes to it.

I hope this helps you in your quest to be the best TFS admin that ever walked the earth!

From C:\Program Files\Common Files\Microsoft Shared\Team Foundation Server\12.0 I ran:


tfsfieldmapping download /collection:http://tfs/tfs/mycollection/teamproject:myteamproject/mappingfile:C:\WS\TFS\myteamproject\myTFSworkspaceSoICanKeepTrackOfMyChanges\TFSConfig\tfsfieldmappingfile.txt


Wednesday, July 23, 2014

Visual Source Safe migration to Team Foundation Server 2013

Below are some of the steps and the process behind migrating our ancient Visual Source Safe repository into TFS 2013.  Hopefully this will shed some light on things to think about before and during the conversion.

The first thing was to get my hands on the VSS Migration Wizard.  This was out on Microsoft's website. 
This tool recommends having it local to the server where the VSS repository is located.  What I decided to do is spin up a virtual machine with SQL for this migration task.  Note that for large VSS repositories you may need SQL Standard or higher and not SQL Express.

Our VSS database was on a network file share.  This is the typically setup for VSS.  To get it to migrate quickly I used Robocopy to copy the whole structure to the VM where the migration tool was installed.  This not only gets it local (like the wizard wants it) but it also preserves the original VSS repo.  The only thing I changed in the SourceSafe config file was the location of the log file.  The log variable was still pointing to the network share.  After that I was able to log in with no issues.

The preservation was needed because A) it hasn't had analyze run on it in years and B)it was on a version of VSS not supported by the wizard.  I figured out the second part by running the wizard and having it verify things for me.   We were on 6.0 but I think it needs to be 6.0 c or d or higher for it to work.

The next step was getting past the verification.  Luckily someone had placed the Visual SourceSafe 2005 ISO out on our network.  That was a life saver as it is very hard to find old Microsoft releases.  This I installed on the migration VM where the copy of VSS repository lived.  I followed the VSS 2005 upgrade instructions included with the media to get the copied repository upgraded.

With the upgrade done the wizard worked like a charm.  I did setup a new TFS team project just for this repo.  The wizard took about 7 hours for our 2 GB VSS repository.  There were 73 file conversion errors.  They were all listed in the log.  Upon looking at one of the files that erred in TFS it was just a 0 byte file but it did exist.  The VSS file I was able to get with no issues and placed it on the tip in TFS.  That will have to work as I can get through these files quicker than trying to figure out the issue and resolving it.

Some of the other issues it ran into was files that were checked in with the 8.3 DOS file format/length restriction.  There is a Microsoft documented workaround the migration log points you at to resolve this.  For me it was files that were accidentally checked in (like log files) that were not needed.

This conversion was just to preserve it for historical purposes.  I am not actually building anything from it so having a few errors is OK.  I have all of the valid files in SVN right now which I will be converting to TFS soon.


If you have any VSS to TFS stories to share let me know.  I am always curious as to what others have done.

Monday, July 7, 2014

TFS 2013 Merge Tips

We did our first team merge last week.  There were several things we learned about doing merges of your whole branch.  Below are some of the learning's and any helpful links we came across for our next merge.

White-space

At some point one of the developers ran an application that reformatted the code.  In doing so it removed extra white-space in various places.  This caused a large number of files to not automatically resolve and where presented as conflicts.  We are not sure why but since the white-space was different on both branches this flagged the file.

This article found on stackoverflow.com was detailed enough to show us how to get around this however the code would be different between trunk and the branch.  The right thing to do would be determine which format was correct and accept the files on that branch.  In our case it was the source branch so we went through the several hundred files and accepted source version for those.

Ignoring Folders

There is folder we call Global that has files global to all solutions (files in the folder are references by each solution or project).  There are also build scripts in it managed by my team.  We do not want the developers to attempt to merge these folders without my team reviewing the changes.  Once we had a developer change a global file not knowing what global meant and a bad change was propagated to all solutions.  This caused confusion and delay.

You could have the team doing the merge ignore the folder by using the command-line and using the /discard parameter.  This is where I found that on stackoverflow.com.

We decided on another path.  With TFS source control permissions we can set it so that the teams cannot merge certain folders and/or files.  So when they do the merge it will give a permission error and not attempt to merge it.  This way they don't have to remember what to discard.  The other benefit is if they want to modify a global file it will have to be reviewed and changed by the build team.

Merge vs. Edit

During the merge session the pending changelist was still quite large.  They team was worried that builds would be kicked off by the system for allot of applications that had no changes between the branches except for files that we ignore.  What we noticed in the pending list were two key words.  Some files just had a merge and some had merge,edit next to them.  Doing some digging the merge means it is just creating a merge record but not checking in a new version of the file at the destination.  While merge,edit has both a merge record being created and a new file version being checked in (which will trigger a build).