Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS Label Inconsistency

Tags:

tfs

tfsbuild

I've been working with Team Foundation Server 2012 to get a Continuous Integration build for a data warehouse project working. In doing so I noticed that the labeling and building from a label wasn't yielding the results that I was expecting. In researching the problem I was able to replicate the issue using only the command line arguments provided by Team Foundation Servers Command Line tools. That helped me to eliminate anything in the build definition that may have been affecting the build.

So this is my problem: I have a build that is building 2 different projects in a single build. It basically has two *.SLN files associated with it. I applied a label to 2 assets, one in each project. I can then execute the command to view which assets have the label. When doing this I get the expected result. However, when I execute the command to get the assets associated with this label it only pulls 1 of the two files. I've verified that I can pull both files, by removing one of the projects. This is the setup that I have with the build definition, work space and label

TFS Paths:
$/Dev/Project1
$/Dev/Project2

Workspace Mapping
Project1: C:/SourceControl/Project1
Project2: C:/SourceControl/Project2

DeploymentFolder
Project1: //DevServer/SSIS/Project1
Project2: //DevServer/SSIS/Project2

Executed Commands:
Apply Label:
tf label TestLabel $/DEV/Project1/PackageA.dtsx
tf label TestLabel $/DEV/Project2/PackageA.dtsx

Review Label:
tf labels /format:Detailed LTestLabel

Get From Label:
tf get /r /version:LTestLabel

After executing the tf get command I get the following results

Deployment folder: //DevServer/SSIS/Project1 contains the file PackageA.dtsx
Deployment folder: //DevServer/SSIS/Project2 contains 0 Files.

It appears that there is a filter or restriction on pulling assets in different projects with the same label. I would expect that if I apply a label to any asset in TFS, then pull the labels, it should allow me to retrieve all assets with that applied label. Has anyone heard or experienced this? Any help provided would be appreciated.

like image 883
swilliams Avatar asked Nov 15 '13 05:11

swilliams


1 Answers

You don't specify what (local) folder you're in when you execute the get: since you don't specify a folder to get, it implies the current one, equivalent to:

tf get /recursive /version:Llabelname .

If you want to get both, specify a directory containing both, for example:

tf get /recursive /version:Llabelname $/

This, of course, assumes that both the files in your label are mapped.

like image 62
Edward Thomson Avatar answered Nov 29 '22 18:11

Edward Thomson