Our friends at Microsoft have done a wonderful job releasing TFS 2011 preview, there has been great amount of preview documentation and video samples released to help understand the new features. In this blog post I intend to dive deep and compare the database changes done between the two versions of the product. If you are interested to read more about the actual features of TFS 2011, please refer to bharrys blog posts, this, this and this.
I’ll be using the following pattern,
- About the feature
- Database changes performed to facilitate the new feature
- Possible opportunities for extension (if applicable)
Code Review
Feature
I personally admire the introduction of the new code review feature. After TFS 2005 my enterprise was still keeping code review process outside of TFS, After TFS 2008 a decision was made to still keep code review templates outside of TFS but version them in team site, use the integration between VS and FxCop. TFS 2010 offloaded most of the review activities thanks to the introduction of code analysis, architectural best practice checks and the eco system of community tools. With TFS 2011 I can foresee organizations moving away from a review process outside of TFS.
Changes
- The process template contains two new work item types, codeReviewRequest and CodeReviewResponse
- Two new tables Discussion and Comment have been introduced to track the code review discussion. The Work Item Id is the link to the actual code review type work item which tracks the history of the review process.
- The actual discussion and comments are tracked in the
tbl_Discussion
and tbl_Comment
respectively.
Opportunities
I can think of several opportunities for extension,
- Review Templates! At present the code review process is quite informal, with introduction of review templates senior developers reviewing junior developer code can have a guideline around what they are trying to review and it is in the best interest of junior developers to know against what have they been marked down. This could very well be a visual studio extension that integrates with the team explorer code review context.
- Code Review Report: Project Managers love reports, since the code review details are tracked through work items and available in the tables shown above, it will be a simple but effective task to generate a code review report based on work items in the sprint, broken down by developer. Even better if this was made available as part of the cube it would be possible to generate a view on the files code reviewed.
Feedback Manager
Feature
Appreciations are usually lost in emails, if only there was a way to record task feedback in work items. Microsoft has presented the feedback manager! During the course of software development, it is important to capture feedback from project stakeholders. Feedback Manager is used by project stakeholders to provide feedback on software under development. It enables the capture of audio, video, screenshots, and other attachments to be linked to Team Foundation Server feedback work items.
Changes
- The process template contains a new ‘Feedback’ work item type
- Two new tables
tbl_AssociatedWorkItemForSession
and tbl_Session
have been introduced to track the feedback. The Work Item Uri is the link to the actual work item type feedback which records the history of the session.
- The actual links are stored in the tbl_Session.
-
Local Workspaces
Feature
With TFS 2010 a new workspace type has been added known as ‘Local Workspace’. Local workspace is the default workspace type, TFS assumes that your client is "the master" and TFS needs to understand the changes that you make there and "do the right thing". In local workspaces, files are not read-only. You can edit them at will. They are automatically detected as "checked out" when you edit them. If you create new files, TFS will detect them and enable you to add them to your project. If you delete them locally, TFS will notice and give you the option of either deleting them from TFS or restoring the local copy from the server.
Change
A few changes have gone in to the tbl_Workspace
, you can now see the IsLocal check and also a FileTime flag to validate whether the file time will be check-in or current. Didn’t they promise to enhance the merge experience, check out the new table tbl_ResolveConflict
to help in exactly that.
Version Control Improvements
"Also, for the case of renamed files, I challenge you to find out what it was renamed from in the 2010 version" Quote from bharrys blog
So, lets look at the actual problem,
Command> tf rename $/Project/Main/File1.cs $/Project/Main/File2.cs
Once you check in there will be a "rename" change on the $/Project/Main/File2.cs slot, and a "delete, source rename" change on the $/Project/Main/File1.cs slot. However, while the changes are still pending, only the rename change exists as a pending change. No changes are displayed in Pending Change to indicate that $/Project/Main/File1.cs is being renamed. In fact, if you execute the below tfs will claim there are no pending changes. Which is not true!
Command> tf status $/Project/Main/File1.cs
Though there is no way you could see what the file is being renamed from in TFS 2010 front end, you could always get to this information using the TFS API,
public static void GetPendingChangeDetails()
{
var tfs = TfsTeamProjectCollectionFactory
.GetTeamProjectCollection(new Uri("https://tfs2010:8080/defaultcollection"));
var service = tfs.GetService<VersionControlServer>();
var pendingChanges =
service
.QueryWorkspaces(null, service.AuthorizedUser, Environment.MachineName).First().GetPendingChanges();
foreach (var pendingChange in pendingChanges)
{
Debug.Write(
String.Format("Change Type: {1}{0} BeforeChange: {2}{0} AfterChange: {3}{0}",
Environment.NewLine, pendingChange.ChangeType,
pendingChange.SourceServerItem,
pendingChange.ServerItem));
}
}
Output,
Change Type: Rename
BeforeChange: $/Project/Main/File1.cs
AfterChange: $/Project/Main/File2.cs
Change
The tbl_PendingChange
has the ‘Has Rename’ field to track if the file is a rename operation and make the rename from file available to you on the UI. Thank you Microsoft!
Possible changes to build?
A new tbl_BuildBatch
has been introduced and the tbl_BuildQueue
has a BatchId column added to it. It might be too early to suspect but could this be a new build feature (build in batches or just a performance improvement)?
Database changes i could not explain?
Are we going Async?
Interesting… Why has the IPAddress in the tbl_Command
changed from varchar 32 to varchar 40? TFS 2010 was already storing IPV6.
So, what do you think of the changes? Please feel free to share Feedback/Questions/Suggestions.
That’s about it for todays session, if you enjoyed the post, remember to subscribe to http://feeds.feedburner.com/TarunArora. I’ll be doing some more deep dive sessions on TFS 2011 in the coming days. Till then, keep enjoying TFS 2011 preview