How to Setup VSTS to work with VS Code over Unix (TEE-CLC) - tfs

I had been trying to setup my VS Code and plugin VS Team Services 1.22.0 (need to setup TEE-CLC). But I have been hitting the same wall.
Checks:
-Java Installl
-Download TEE-CLC
-Installed VS Team Services Plug In
-Setup "tfvc.location"
-Created a local folder in my documents
Over TEE-CLC 14.123.1 I had accepted the Eula(Easy process), created a workspace using the TEE in VSTS(with success):
tf workspace -new MyWorkspace -collection:https://dummy.visualstudio.com/
Workspace 'MyWorkspace' created.
Then the part where I get stuck is mapping my local folder.
I had try official setup process(plugging over VS Code)
Used this How do you create new windows workspace with TFS command line client that is running on unix
Follow videos to setup TEE-CLC without success.
I know I'm missing something but don't find yet what could be.

If you use on-premises TFS, you must be running Team Foundation Server 2015 Update 2 or later.
After installing Team Services extension and TEE CLC (see how to set it up by viewing this video), you also need the following steps:
Set the tfvc.location VS Code setting to the full path of your TF command line client.
Open a folder containing a Local TFVC Workspace and sign in when prompted. Refer to this site.
Set the SCM Provider to TFVC. Refer to this site for more information.
If you are unable to access the existing local workspace using TEE
CLC, try the steps below:
using the CLC, run the tf workspaces -collection:<collection-url> command, to help the CLC be aware of the workspaces in the specified
collection.
Run the tf workfold command from the local folder being accessed from Visual Studio Code.
Running both commands should make the TEE CLC aware of the workspace
and as well as verify that access to it is possible.
I'd like to suggest go through the website below:
https://github.com/Microsoft/vsts-vscode/blob/master/TFVC_README.md

Related

Team Explorer configuration via command line

I am trying to automatically configure the TF Workspace for all users when they login on a PC which is different from what they normally code on.
I am currently running the following to configure the workspace via a logon script
./TF.exe workspace /new /collection:azuredevops.url/project /permission:public /location:Server /filetime:current /noprompt
But when the user starts Visual Studio in Team Explorer it is not enabled /online for the user.
Even the "Connect to a project" is empty
How do I configure this in PowerShell or CMD using TF or any other function?
In the command line you are using, I see you set the value of the option /collection as "azuredevops.url/project".
According to the docs about tf workspace command (see here):
/collection: Specifies the project collection.
It seems that the value of the option /collection should be set as the collection URL.
I tried both the collection URL and the project URL in the command, only the collection URL did work, the project URL returned error.
In addition, you can manually try the following command on the machine,
tf.exe workspace /new /collection:<collection URL>
to see if it can normally pop-up the window like as the screenshot shows below.
This can verify if the tf workspace command is working on your machine.
[UPDATE]
The TF.exe is a tool that integrates some interfaces of Azure DevOps. It helps you set up the configurations of TFVC workspace on background, instead of manually filling the parameters via the VS UI. It's not a VS integrating tool that can fill parameters on the VS UI.
When you open VS, to automatically connect the project on the VS UI, you need to use the VS integrating API (or interfaces collection) to achieve the operation on the VS UI. However, currently, we have no such API or CLI to do this. So, you need to manually connect the project after opening VS.

Delete TFS workspace mapping after jenkins job execution

I am trying to run a Jenkins job that uses TFVC plugin. We earlier had a problem with length of the TFS workspace names (exception for length > 75 chars). In order to address this we made a change in the TFVC configuration.
Default workspace name in TFVC: Hudson-${JOB_NAME}-${NODE_NAME}
After change: Hudson-${JOB_NAME}
Post this change the job had one successful run. We are unable to run this repeatedly as the TFS workspace created during the successful run was not deleted. and is throwing the following exception:
FATAL: hudson.remoting.ProxyException: com.microsoft.tfs.core.exceptions.TECoreException: The workspace scanAPI;tfsjenkins already exists on computer ip-XX-XX-XX-XX.
I have tried deleting the Jenkins workspace in pre/post build steps. This has no impact on the TFS workspace.
Additional information: The jobs are being run on a linux node and hence I am unable to run windows commands
You can use Post Build script that use tf.exe to delete the TFVC workpsace, with the delete command.
Create a global environment variable to be able to access the TF.exe easier. for example:
Note: the path to tf.exe it depend to which Visual Studio is installed in the Jenkins machine.
Add a Windows batch command from the scripts menu with the following command:
%TFS% workspace /delete /noprompt /collection:”https://tfs.codeplex.com:443/tfs/TFS27″ “Hudson-%JOB_NAME%;snd\7astlivec_cp”
Replace the URL with your TFS Server URL and change snd\7astlivec_cp with your TFS user. The command is going to delete the newly created TFS workspace.
Another option is to add tf.exe. location to the machine PATH variable and use it directly: tf workspace /delete .......
Update
For Linux, you should be able to use this through team explorer everywhere. It also include a tf command line.
Take a look at Setting up a workspace using Team Explorer Everywhere on Linux
Should be similar on Linux.
Instead of creating the default workspace by specifying workspace name in UI setting, you could also use a Windows batch command to handle this process.
If you want to delete workspace, just add a new post build step, a cleanup command could be added to delete the previously created TFS workspace.
%TFS% workspace /delete /noprompt /collection:"{your-tfs-team-project-collection-url}" "Hudson-%JOB_NAME%;{your-domain-user-name}"
More details your could kindly refer this step-by-step tutorial Jenkins Get Source Code By Specific TFS Changeset

The workspace already exists for you on this computer or another JetBrains WebStorm

I'm working in Linux Mint 19 & using JetBrains. I have Team Foundation Server 2015 Update 4 installed on premise by my company whenever I try to checkout a project from the TFS I'm getting this message:
The workspace 'SmartGPS_Git' already exists for you on this computer
or another. Please try checking out the repository again with a
different unique directory name.
TEE CLC tool is configured in JetBrains WebStorm.
I tried to
Uninstall JetBrains WebStorm & reinstall it
remove TEE CLC tool with no luck
tf workspace /server:http://{TFSServername}:8080/tfs/{CollectionName} /delete “{workspacename};{owner}” it didn't even work
On Windows you can remove any workspace with the Visual Studio but here I don't have Visual Studio.
Please try to use /collection instead of /server to delete the workspace, the command should look like:
workspace /delete [/collection:<url>] [<workspacename;[workspaceowner]>]
Also, you can try to create a new workspace to see whether the issue persists:
workspace /new [/noprompt] [/template:<value>] [/computer:<value>] [/comment:<value>|#valuefile]
[/collection:<url>] [/location:server|local] [/filetime:current|checkin]
[/permission:Private|PublicLimited|Public] [<workspacename;[workspaceowner]>]

How to integrate TFS in WebStorm?

I'm using Git with WebStorm's version control already, but have to use TFS version control. After some research fond this plugin but there is no tutorial that aiming to configure that plugin.
Can anyone guide me?
You can opt for using git tfs, locally you can still use Git and all of the advantages you're used to. And then push from git to TFVC. You'll need to install Team Explorer or the Team Explorer Cross Platform Commandline Tools.
Or you can use the native plugin for, thelatest version of the TFS / Azure DevOps (Server) plugin can be found on the Jetbrains site. It requires TFS 2015 or newer. You can use the plugin you found for older versions of TFS.
A good explanation to get started can be found here. The part to configure TFVC is replicated below.
Visual Studio Team Services plugin and TFVC
Before starting with TFVC, we need an external tool. The tool in question is TF command line tool. It ships with the Microsoft Team Explorer Everywhere 2015 and you can download it here.
The file we are interested in is TEE-CLC-14.0.3.zip. Download it and unzip it in a folder of your choice. You should end up with something similar to this.
Now, open the command prompt, move into the folder where you have extracted the TF command line tool and run the following:
tf eula /accept
If command succeeded and you haven’t received any error, you are good to go.
Now back to IDEA. Open the settings panel.
and move to Version Control -> TFVC pane. In the select path to executable field, enter the exact path to the tf.cmd command file located in TF command line tool folder.
Once done, press the test button and you should see the following message
Confirm all of the open windows and get back to the IDEA welcome page. Now you are ready to choose Team Services TFVC (Preview) version control.
At this point, same as for Git, you will be prompted about the connection towards your TFS. The following dialog will be shown.
Move to the Team Foundation Server tab and specify the address of your TFS server, then click connect. You will now be prompted for the credentials and if everything is ok, you will be shown the list of available TFVC repositories.
You can now create a new workspace directly from IDEA and start working with your TFVC repositories.

Unable to validate collection

I am trying to set up TFS for vscode. I am getting the error, unable to validate the collection assuming 'default collection', when signing in. Any recommendations oh how to resolve this issue.
Firstly make sure you have correctly set the TFVC support.
Below is a short list of steps to get up-and-running with TFVC support:
Install the Team Services extension for Visual Studio Code.
Team Foundation Server requires your domain credentials.
Ensure you have a TF command line client installed (either TF.exe or
the TEE CLC).
Set the tfvc.location VS Code setting to the full path of your TF
command line client.
Open a folder containing a Local TFVC Workspace and sign in when
prompted.
Set the SCM Provider to TFVC.
For more detail tutorial you could also take a look at my reply in this question How can I connect to on-premises TFS using visual studio code?
Back on the error message, it may related to the workspace. Check if you have correctly mapped the workspace. Just try to remap the existing workspace or create a new workspace and map sources to a new local folder, then check that again.
Also just try to specify the collection and team project name in the user settings like this:
{
"tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\tf.exe",
"team.remoteUrl": "http://server:8080/tfs/collection",
"team.teamProject": "TeamProjectName",
"tfvc.restrictWorkspace": true,
"window.zoomLevel": 2
}

Resources