change check-in setting for entire project - tfs

We have a TFS server setup with three projects. Recently we wanted to change TFS so that code checkins had to have a Work Item Number associated with it. I was able to accomplish this by:
In Visual Studio
Team -> Team Project Settings -> Source Control
Then select checkin policy tab and add "Require associated work items."
Source
The problem is that it only seemed to work for one of the three (the first one) projects. I've tried Team -> Team Project Collection Settings but there is no option for the checkin policy.
I've also tried highlighting the individual project I wanted to change the check in policy but they all seem to show that the checkin policy has been setup correctly for requiring a work item with code checkin.
How can I change the settings that all the projects on the TFS server have the same checkin policy?

Check-in policies are set per team project. There is no global meaning collection or server level way of setting and enforcing check-in policies on all of existing and future team projects. You will need to add appropriate check-in policies for each and every team project you need using the project level source control setting in Team Explorer. You can also use TFS client SDK to automate that process to iterate all or some of the existing team projects and add check-in policies. Another option is to take advantage of TFS server side events to get notified when a new team project is created and add check-in policies in response in case of automating the configuration of check-in policies for newly created team projects.
Team Foundation Server Event Service

Related

Having multiple custom check-in policies in VS 2015

I have been asked to create a second custom checkin policy for a second project on our TFS server. So both projects reside on the same TFS server in the same collection but are different projects under that collection. I created the second check-in policy just like the first. When I run the VSIX installer the new one installs. Once I run VS 2015 I can see both custom check-in policies under the TOOS/Extensions and Updates. However when I go to TEAM/Team Project Settings/Source Control/Check-in Policy the new one does not show when you click "Add". The existing one is there but not the new one.
Is there an issue with having two custom check-in policies?
First please make sure you have selected the right team project. Since the check-in policy is based on team project- level.
Also remember to registering Custom Policy:
You need to add an entry to the Windows registry so that your policy appears in the Add Check-in Policy dialog box.
Here is an example of the .reg file that registers the policy.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\Checkin Policies]
"Devart.ReviewAssistant.TeamFoundation"="c:\\Program Files\\Devart\\ReviewAssistant\\Devart.ReviewAssistant.TeamFoundation.dll"
Note: that you must install the policy assembly on every computer that needs to have a reference the assembly.
Make sure that you provide valid installation instructions for your policy as it will help fellow developers to install it. More detailed info please refer this blog: Creating TFS Custom Check-in Policy

Visual Studio TFS checkout missing "Check out" checkout type

When my guys checkout a file, I would like them to lock it so others can't also make changes, I see from this post: http://msdn.microsoft.com/en-us/library/jj155783.aspx that this is possible using the Check Out type, however, this appears to be missing from the list of options I have available. I only have Unchanged and Check In.
I am using the free version of TFS in the cloud linked directly with VS2013.
I am using TFS Source Control and have "Enable Multiple Checkouts" disabled. I have also changed the default workspace type to server from local.
This article on MSDN describes the available lock types:
In Visual Studio Team Foundation Server 2012, check-out locks are
generally not effective because of local workspaces (see Decide
between using a local or a server workspace). Specifically, check-out
locks are:
Not enforceable because other users might be using local workspaces.
Not available if you are using a local workspace.
Disabled if a member of the Administrators security group of your
team project collection has enabled asynchronous checkout for your
team’s server workspaces.
A check-out lock prevents users who are using server workspaces from
checking out and making changes to the locked item in their
workspaces. You cannot apply a check-out lock to an item for which any
pending changes exist, in any workspace other than your own.
Check whether your workspace is a local one or if the administrator has set the option for asynchronous check outs.
In my installation of Visual Studio Online I have a local workspace by default. As soon as I changed it to be stored on the server, the Check Out option was available.
In order to change the type of workspace, carry out the following steps:
In Source Control Explorer, locate the workspace drop down at the top and choose Workspaces....
Select Edit, then Advanced.
Change location from Local to Server.
Exit the dialogs using the Ok or the Close buttons respectively.
Exclusive checkout option will not be available if the workspace Location is set to Local. If that option is needed then workspace location under workspace settings needs to be set to be “Server”.
First open team explorer settings the and go to the settings, click on source control under the Team project Collection.
then uncheck enable asynchronous checkout in server workspaces
now you can disable multi checkout

TFS in Visual Studio Online

I used before free TFS from Visual Studio Online. I worked fine, I added some projects to TFS and did check-in and check-out without problem. But now it just stop working. When I try to check-in new projects, I get the following error:
The following issues were encountered during check in: TF10169:
Unsupported pending change attempted on team project folder $/Code.
Use the Project Creation Wizard in Team Explorer to create a project
or the Team Project deletion tool to delete one.
What is Project Creation Wizard? How I can run it? And what is happened with my account? I see the message:
Your account is an Early Adopter account. In 31 days your account will
revert to a standard account.
Maybe that's why it's not working anymore?
You cannot create or delete folders at the top-level of the source tree. (Eg, $/Code).
The top level of the source tree is reserved for Team Projects, which must be created and deleting specially. If you want to delete $/Code, you will need to undo your pending change that deletes it and instead delete it using the Project Creation Wizard or the TfsDeleteProject command.

Delete a collection from TFS

I want to use a free tfs account for a sample project. So i created a free account on visualstudio.com and created 2 collections. And i want delete one them but i cannot delete it.
There is no any members in the collection. It doesn't allow me to delete. As you see on the screenshot, delete button is disabled. Also Is there any way that if i've an admin account, is possible to change or delete collections from visual studio?
I'm not sure how/if it applies to free TFS versions, but the following link shows how to delete Team Project Collections in general. Looks like doing it via command line tool is the way to go.
https://rules.ssw.com.au/do-you-know-how-to-delete-a-team-project-collection
Here is the main part:
On TFS server, open Administrative Command Prompt and change to TFS Tools Directory.
%programfiles%\microsoft team foundation server[versionnumber]\tools
Type the command:
TFSConfig Collection /delete /collectionName:[COLLECTION NAME]
You're mixing collections and team projects. You cannot create a collection in Team Foundation Service as of now. That may or may not change in the future. When you sign up, there is one collection created for you and that one will contain your team projects and you will need to live with that one. If you have a need to have another collection then you can sign up under another account. You can however delete team projects but not from the web UI. You will need to use the command line tool DaveShaw gave a link for. You can also check out the blog post below:
How to delete a team project from Team Foundation Service (tfs.visualstudio.com)
You look like you are trying to deleted a "Team" from a "Team Project"? You have to have at least one "Team" in a "Team Project", and that will have the same name as the "Team Project".
If you are wanting to delete the entire "Team Project" (containing all the Work Items, Source, Builds, etc), you can do it using the tfsdeleteproject command line tool.
Even we had similar issue. Unfortunately we had deleted a Collection DB without Stopping and Detaching the collection from TFS admin console in TFS 2018. Later we tried to detach the collection, but no luck. Initially we had ignored this issue since it was test TFS collection and that too in QA server. Later during up-gradation to Azure DevOps 2019 server we faced issue with Existing Deployment option. we couldn't complete the upgradation. we followed below steps to fix the issue:
**1. Restored the VM/QA TFS server with VM snapshot backup created before upgradation.
Run below command to remove the deleted collection from TFS Config DB.
"TFSConfig Collection /delete /collectionName:[COLLECTION NAME]"
Stop TFS services and done upgradation to Azure DevOps Server 2019 successfully.**

TFS 2008 ignores team project check-in settings

I'm trying to set up our TFS 2008 instance to require that projects build before they can be checked in.
I have created a check-in policy using the out of the box "Builds" policy, but I'm still able to check broken projects in after mangling the code and attempting to build the project.
We're a small shop, and TFS was originally set up with our team's Active Directory group listed as TFS admins. Is this the problem? Do check-in policies apply to TFS admins?
Any other suggestions?
Check-in policies are a client-side check only. If the client does not have the check-in policy available, the check will not run. Instead, they will get a generic policy failure saying that not all policies were run. Additionally, any user (there's no special permission for it) can override a check-in policy failure with a comment.
The "Builds" check-in policy does the following:
Request from the server a list of build definitions affected by this check in
For each build definition returned where the last build was not "good," create a checkin policy error message containing the build definition's name and the user that triggered the build.
If the policy detects a broken CI build, show an error when you attempt to check in. "The last build failed.."
It sounds like you're trying to make sure that people don't break the build with their check-ins. TFS2010 includes a new feature called Gated Check-In that validates changes before they are committed to source control.
If you are using TFS2008 and can't upgrade, you'll need to look at something like OpenGauntlet - however the user experience is much improved with TFS2010.
TFS was originally set up with our
team's Active Directory group listed
as TFS admins. Is this the problem?
This is probably not the best idea. Team Foundation Server Administrators can do destructive things like destroy files+history and delete projects. If there's any chance that somebody might become disgruntled, you might want to reduce the number of admins or ensure that you have good backups.
As a middle-ground, you could have 1 or 2 people as TFS Admins, and everybody else as a Team Project Administrator. Most people only need Contributor access though.
In TFS2010, there is a new concept called "Project Collections". Typically, organizations have 1 or 2 people as "Project Collection Administrators" so they can add new projects and build controllers.
Check-in policies apply to everyone. Did you verify that your deployment of the policy is active on all machines?

Resources