Search code examples
tfsteam-explorer-everywhere

Team Explorer Everywhere Command Line Client workflow map validation errors


I'm working on a MacOS machine and trying to configure a TFS workspace, to work with VS Code and a proper extension.

I may be wrong but all the extensions available requires that the workspace is already mapped to a local folder, which is the problematic part for me.

In the following both 'company' and 'www.mysite.com' are placeholders.

The first command I execute to create the workspace works fine:

tf workspace -new Oliviers-MacBook-Pro -collection:https://dev.azure.com/company/

The second command I execute:

tf workfold -map ‘$/www.mysite.com’ /Users/oliviermatrot -collection:https://dev.azure.com/company/ -workspace:Oliviers-MacBook-Pro

Fails with validation errors :

An input validation error occurred: TF10122: The path $/www.mysite.com/$RECYCLE.BIN/desktop.ini contains a $ sign at the beginning of a path component. Remove the $ sign, then try again.

I have no idea why there is a validation process triggered by this command. I found out that there is a cloack option to disable validation on the server folder but it does not work for me:

tf workfold -cloak -collection:https://dev.azure.com/company/ -workspace:Oliviers-MacBook-Pro $/www.mysite.com/

An error occurred: The item $/www.mysite.com may not be cloaked because it does not have a mapped parent.

I am unable to find an up to date method to work with TFS on a Mac, even this resource does not work.

As an additional note, here is the link my manager sent me to be able to setup my workspace:

https://dev.azure.com/company/www.mysite.com/_versionControl?path=%24/www.mysite.com/Trunk

So, why is such a validation process and how can I disable it?

EDIT : Here is the DevOps portal. No $RECYCLE.BIN directory.

enter image description here


Solution

  • The second command I execute...

    tf workfold -map '$/www.mysite.com' /Users/oliviermatrot - collection:https://dev.azure.com/company/ -workspace:Oliviers-MacBook-Pro
    

    ...fails with this error:

    An input validation error occurred:
    TF10122: The path $/www.mysite.com/$RECYCLE.BIN/desktop.ini contains a $ sign at the beginning of a path component. Remove the $ sign, then try again.

    The error isn't refering to the $ at the start of the TFS path ($/ww…), but to the $RECYCLE.BIN path-component (i.e. file or folder name).

    So, for context: remember that TFS is basically Microsoft-of-2005's take on SVN, (back when Ballmer was in charge and MS' Not-Invented-Here-Syndrome was in full-effect). A TFS server hosts multiple Team Projects - each of which is its own source-control repository - just like an SVN or git repository: it's a self-contained folder tree containing your versioned project files.

    (An interesting thing is that SVN and TFS implement branches as though they're sibling subdirectories in the same filesystem hierarchy; whereas git branches are more like parallel universes such that two branches don't share the same filesystem space at the same time - so SVN and TFS branches are URI addressable just like any other subdirectory in a repo, whereas git branches are addressed via an entirely separate namespace - just something to think about).

    So, in an on-prem TFS your "Team Project" (i.e. your project repo) itself will be addressable by a HTTPS URI, of the form https://{serverName}/{TeamProjectCollection}/{TeamProjectName}/paths/to/files/go/here. For AzureDevOps (AzDO) where it's your Organization's scope substitues. So with schemes like this it means TFS needs a way to tell what part of a path-string is the actual repository-root-relative path and what is the Team Project Collection Name, Project Name, etc - and so TFS does this with the $ character: i.e. whenever TFS sees a path starting with $/ then it knows that's the repo-root - so if it sees $ within a path, then (e.g, when handling a HTTP request operating on a TFS repo) it trims-off anything to the left of the $ - so-far, so-good.

    ...so because $ is reserved by TFS it means you cannot use TFS with any files or folder-names that start with the $ character.


    Now, in your case, it looks like you do have a (hidden) filesystem directory, an immediate child of your macOS profile directory, named $RECYCLE.BIN (which seems to be the work of Parallels Virtualization) - normally this wouldn't be a problem because you're not meant to use your macOS (or Windows) profile directory root as the directory mapped to your source-control repos.

    The solution here is to create a new empty directory that will be the new root of your mapped TFS work directories, like so:

    cd ~
    
    ## `pwd` should indicate you're in "/Users/oliviermatrot"
    
    mkdir TFSRoot
    
    cd TFSRoot
    
    tf workfold -map "$/" "/Users/oliviermatrot/TFSRoot/"