Measuring the impacts of renaming a TFS projects collection - tfs

To get rid of an issue with the name set previously for our projects collection, I have to rename it.
The procedure seems really simple :
detach the collection
rename the collection
Reattach collection
My issue is that I do not have access right now to my preprod TFS and can't measure what will have to be changed/put back or what I need to communicate to my users.
So, there's my question :
What are the impacts of changing a projects collection name except the URL changing ?
Thank you

Related

Managing Database Code Reviews in TFS

I am currently faced with a situation where I am working in a TFS repository that has a large source control folder dedicated to the database. There are sub folders for various database objects like tables, stored procedures, functions, etc. Right now our team is expected to create a DB code review task each time we check in a database change against one of these objects. Over the past couple months I have had somewhere between 40-50 check ins touching various database objects. The problem is that this is not really efficient because a material percentage of these check ins and subsequent reviews become a waste of time because chronologically later check ins make that code obsolete. I am just one dev on an 8-10 person team too, those poor DBA's!
I have what I think would be a working solution but I don't think it's possible to get this data out of the UI (at least in TFS 2012) and I'm not sure how to even begin a query to get it (assuming they will even give me access to the tfs db).
What I would like to get is a result set including all modified files within a specific source control folder and sub folders between two dates. I would then like to be able to get the id of the changeset that was in effect at the beginning date and the changeset id that was in effect at the end of that date.
The table would hopefully look something like this:
File1 - BeginningChangesetID - EndingChangesetID
File2 - BeginningChangesetID - EndingChangesetID
This way we could structure our DB code reviews such that we can provide a file name, the beginning changeset and the ending changeset. This would allow the DBA to pop open source control, navigate to the file, right click and compare those two versions of the file and then be able to provide meaningful feedback on code that is relevant. If anyone has any recommendations on how to extract this information from TFS it would be much appreciated! Sample queries would also be great. If this data is retrievable through the UI in a version later than 2012, I'm looking for that as well.
If you right-click a folder in the source control explorer you have the option to diff the folder. In the Diff window you can select the version of the folder to compare on both sides.
Set the source to:
$/Project/Folder
[SERVER]
Version: date
Set the target to:
$/Project/Folder
[Server]
Version; another date
You can configure what to show, it seems you're interested in: most options, in source, in target, changed.
You can achieve the same thing from the commandline:
tf vc folderdiff $/Project/folder;D"2017-01-01" $/project/folder;D"2017-02-01"
/recursive /view:different,sourceonly,targetonly

TFS 2015 Archive

I have a TFS 2015 installation where we have a rather big number of projects. Currently there are old projects, that aren't used anymore but need to stay available as an archive (read only).
I'd like to make a workspace or something in TFS so that these projects normally don't come up in the normal view.
One way I found out is to set the TFS offline, make a copy of the database, bring the copy of the database online and then delete all projects that are still active and rename it. After that bring back online the original database and delete all archived projects.
This can be done once. Maybe once a year, but it will result in a large number of databases. This will make it worse than leaving the inactive projects in the workspace.
Does anyone have better idea? Or: What do you do with old projects?
First, there currently is no archiving function on TFS. However you can use something else as a workaround. To do this, you can either create a project designated as archived that you then have to assign permissions to and so on or move the project into another collection using the TFS Integration Toolkit.
Set the Read permission to Deny of contributor group will hidden the collection to come up in the normal view.
Below are some related blogs for your reference:
How to: Archive Team Foundation Server Team Projects
completely archive a TFS2012 project
Moreover, there has been a feature request in UserVoice, you can also vote up it to get more attention.
The process you are using (cloning a collection) would be the only method to achieve an archive as you describe it.
I would start by understanding why you have so many projects! Prefer larger Team Projects that contain many Products, Projects, Teams that are easier to manage.

TFS workspaces with the same computer name

I have a tfs on visualstudio.com and I access it from my home and work by using same live.com login. These two computers are named the same (even the full paths to the solution folder are the same) and thus the workspaces got named the same. Now, when I try to do get-latest, it never gets me anything whether I am at home or at work because it probably thinks it already has all latest files in it. Assuming my hypothesis is right, is there a way to make these look distinct to the tfs ? The only way to get-latest for me is to get-specific and mark the second tick, but it also overrides my web.config file (which is not exactly the same since the connection strings are a bit different) which is excluded from the project for obvious reasons (to not be locked/changed since each user needs it different for their own sql server connection string)
Workspaces are uniquely identified by workspace name and username. However TFS only sends a list of "local" workspaces to each machine that you use based on its name. If you have two machines with the same name then they both workspaces will be listed as local to that machine and Visual Studio will get confused and your workspaces will be corrupted. To solve this issue you need to rename one of your computers.
You can work around it without renaming the computers by creating two workspaces with names like "home" and "work". You will however need to make really sure that you only use one in each location as crossover will give you the same problem as above.

TFS API 2010: Track a file across all branches

Using the TFS API I am trying to approximate bugs/file.
A bug (as I define it) originates from a file in a change set that has been associated with a work item that has type WorkItemType = 'Bug'. For example, in branch-a, branch-a/1.txt and branch-a/2.txt are checked in and associated with a 'Bug' work item. Call this changeset X. There are now two bugs in branch-a associated with those two files.
If I merge branch-a back into its parent (the root branch), the root also gains these bugs, so root/1.txt and root/2.txt are also bugs - basically the root branch has gained the buggy history of it child. Bugs can be inherited in this fashion. This property is preserved across renames. So if root/1.txt was renamed to root/hello.txt it's still a bug.
I start with iterating over all "Bug" work items in the TFS project:
In this example there is a single work item, which is associated with changeset X, which is associated with changes on branch-a/1.txt and branch-a/2.txt (although those files could be renamed now in the present).
Now I want to know all places where branch-a/1.txt and branch-a/2.txt ended up (once again, even with renames).
So, given a Changeset cs and a Change c within cs, I want know for each branch if c made it into that branch and the most recent file name where c resides.
Another way to think about the problem is thinking about moving forward through history. I start at specific point in time with a change in a single branch. Now this change needs to be tracked all the way to the present.
Any ideas? I can provide clarification as needed.
Thank you!
Have you tried tracking the changeset?
View History on the file that has the change (1.txt) > Right Click on the changeset > Track Changeset > Check all visible > Visualize.
Not sure if this is exactly what you want but it might a good place to start.
Video that shows it: YouTube video
Not sure if it's possible using the API. This link seems to suggest that it's not possible using API calls. This link seems to suggest that it is possible.

Corrupted TFS project

I'm banging my head for several hours but couldn't find the solution on my problem. I have a team project collection. one of the project in collection is corrupted probably. It doesn't show up either in Team Explorer nor in TFS Administrator. but I can see that project in Source Control Explorer from VS. I tried TFSDeleteProject but it says:
TF200016: The following project does not exist:........
I can't create a team project with same name, nor I can delete it.
I looked at the database and there are entries about the corrupt project in many tables. Any idea how to remove it? maybe with the help of some SPs? I tried DeleteProject stored procedure, it didn't show an error, but it also didn't delete the project.
thanks.
Have you tried simply deleting it from source control?
TFS is comprised of several components (issue tracker, reports, source control, etc.), which, although typically used together, can also function individually. A file/folder in source control that does not belong to any project is thus possible. I don't know if you can create this situation manually, but it could result from a bug.
You need to use tfsdeleteproject to remove this.
The DB isn't corrupt, you cannot delete Team Project level source control folders through the UI.
tfsdeleteproject /collection:<url> <teamproject|srcfoldername>
You can always get the collection url by selecting the collection node in Team Explorer and hitting F4 to view the properties pane. Copy/paste the url. The Source Control folder you are trying to delete is likely the same as your Team project name.

Resources