TFS2010: Public Workspaces

Public Workspaces is a feature that we built last year mainly for our internal build lab customers. Before TFS2010, if one user tries to use a workspace that belongs to another user on the same machine, they will receive an error message:

No workspace matching *;SecondUser on computer COMPUTER found in Team Foundation Server http://tfsserver:8080.

The Public Workspaces feature removes this limitation of one user per workspace and allows multiple users to use the same workspace mappings on a single machine. Unlocked workspaces are sometimes also referred to as "Shared workspaces", as they can be shared among multiple people.

Additionally, we enabled the ability to change the owner of a workspace, if you don’t want to share a workspace at all, but just reassign it to a different user.

Scenarios

Shared Machines

"I need to setup a shared ProductX enlistment machine; we’d like to use it to run tests, integrations and such."

"Our team has a rotating branch-owner role, so we have no choice but to use a service account."

"We find it very useful to have a shared machine that anyone on our team can use to investigate issues, checkin fixes, etc."

"Is there a way to make a TF enlistment user-neutral, so that anyone who logs into the build machine can open the enlistment, and use TF commands – and those commands will be run as the username of the loggedin user?"

Save disk space

"We need to use it to save disk space on shared machines."

Split personalities

"I have two admin accounts on the box. I use one of them to enlist in the branch and work with TFS. The problem is when I use another one (labaccount vs. personal account) I can login, but I cannot run any tf command because enlistment belongs to the first user only."

Hotdesking

"I'm taking over another dev's machine for a week while he works on another project and he has all the development tools already setup"

Workarounds for TFS2008

Before this feature existed, there were are few different workarounds that people were using:

Workaround

Description

Shelvesets

The various developers pass shelvesets around

Run As

The owner starts a cmd shell / VS window with RunAs

Shared User Account

Create the workspace using a shared system account, then have all developers use that account on that machine.

This has the downside that all changes are checked in as the shared account, rather than the actual user.

You can overcome this by using the "/author" flag with the actual username, but only if the shared account has the CheckinOther permission.

SUBST path substitution

Use the windows SUBST.EXE "Substitution" utility to map a different drive letter to the same physical path. This tricks TFS into thinking that the workspace doesn't exist.

Usage

The owner of the workspace should run the "tf workspace" command and select a workspace permission profile from the drop-down box. The default is "private."

image

  • A Private workspaces works the same as a workspace in TFS2008.
  • A Public (limited) workspace can be used by any valid user. Only the owner can check in or administer the workspace
  • A Public workspace can be used by any valid user. Anybody can check in or administer the workspace as long as they have permissions to the underlying files. The checkins will still be attributed to the person checking them in.

Workspace permissions profiles

 

Private

Public-limited

Public

Read

Everyone

Everyone

Everyone

Use (most operations -- such as pend changes, resolve, etc.)

Owner only

Everyone

Everyone

Check in

Owner only

Owner only

Everyone

Administer (change owner, mappings, etc)

Owner only

Owner only

Everyone

Once a workspace has been made public or public-limited, another user can log onto the machine with the workspace and use the workspace. The other user will need to refresh their local workspace cache manually by using the "tf workspaces /collection:http://server:8080/tfs/collection" command before they will be able to use the workspace (otherwise they will not know the workspace is there -- because they did not create the workspace, and the local workspace cache is per-user).

Published 08 November 09 03:35 by grantholliday

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Redfooty said on November 8, 2009 8:21 PM:

Perfect entry, had a very similar problem at my workplace and they are still trying to work it out, lol :)

Good to see another Aussie showing em how it's done!

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker