Presentation Transcript
Source Code ControlusingVisual Studio Team System : Source Code Control using Visual Studio Team System Mathias Olausson
Solution Architect
Callista Knowledgebase
About... : About...
Agenda : Agenda
Agenda : Agenda
The Situation Today : The Situation Today
Remedy : Remedy
ALM : ALM Source: The Changing Face of Application Life-cycle Management - Forrester August 2006
Visual Studio Team System : Visual Studio Team System
Visual Studio Team System : Visual Studio Team System Visual Studio Team Suite MSF Process and Guidance Visual Studio Team Foundation Server Visual Studio Industry Partners Software Architects Software Developers Software Testers Database Professionals Visual Studio Team Explorer Application Modeling Infrastructure and Deployment Modeling Code Analysis Performance Tuning Security Analysis Database Deployment Database Change Mgmt. Database Testing Performance Testing Manual Testing Test Case Management Visual Studio Professional Edition Change Management Work Item Tracking Reporting Project Site Integration Services Project Management Load Test Agent Visio and UML Modeling Class Modeling Unit Testing Code Coverage
Team Project : Team Project Server-based project in the TFS
Container of:
Work items
Source code
Build data
Test results
Project Documents
Integrated with:
Team Portal
Process Guidance
Reports
Work Items : Work Items
Logical Workflow of TFS : Logical Workflow of TFS
Logical Workflow of Environments : Logical Workflow of Environments
What’s new in TFS 2008? : What’s new in TFS 2008?
DEMO : DEMO TFS Web Access
Agenda : Agenda
Requirements of SCCM : Requirements of SCCM
Goals for TFS : Goals for TFS Scalability
Reliability
Remote Development
Parallel Development
Integrated Check-in Experience
New From The Ground Up : New From The Ground Up Scalability
Three Tier Architecture
SQL Server 2005
500+ Person Team
Storage limited to SQL Server and hardware
Reliability
Atomic Check-ins
Security
Remote Development
HTTP Transport
Proxy Server Visual
Studio 2005 MSSQL/TCP SOAP / HTTP(S) SQL Server 2005
Supporting the Enterprise - Source Control Proxy : Supporting the Enterprise - Source Control Proxy SOAP Messages SOAP Messages SOAP Messages File Transfers File Transfers File Transfers
Supporting the Enterprise - Source Control Proxy : Supporting the Enterprise - Source Control Proxy SOAP Messages SOAP Messages SOAP Messages File Uploads File Uploads File Uploads Downloads
Parallel Development : Parallel Development Multiple Releases
Branching
Create a copy of a set of files for a separate work effort (i.e. a release that will need to be supported)
Each branch can have different permissions configuration
Merging
Combine the changes in one branch into another branch
Multiple Checkouts
File can be checked out by multiple developers
Later combine the changes locally, before checking in
Integrated Check-In Experience : Integrated Check-In Experience Combines source changes, comments, work items, checkin policy, notifications
Captures valuable data relationships
Customizable to your organization process
Work items can be associated with or resolved by a check-in
Changesets : Changesets Logical container of data related to check-in
File and branch information
Links to work items
Check-in notes
Comment
Policy compliance
Metadata (date, time, user)
Unit of atomic checkin
Uniquely identified
Numeric identifier
Incremental
Represents a point in time of source repository
Viewing Changesets : Viewing Changesets Use the History command or the Source Control Explorer
For a list of all changesets in a particular Team Project, view History of the $/TeamProject folder in Source Control Explorer
For Searching, use the ‘Get Specific Version’ dialog from Source Control Explorer
Clients : Clients Visual Studio 2005
Team Source Explorer
Team Source Command Line Utility
TFS Web Access
MSSCCI Clients
Visual Basic 6.0
Visual Studio .NET 2003
Others…
Third Party Tools
Team Prise
Unix, Linux, Mac OS clients
Eclipse/Websphere integration
Configuration : Configuration
How to Rollback : How to Rollback No pending changes
Get Specific Version
Checkout the entire folder (solution). This does not perform a Get Latest operation.
Check-in (Resolve conflicts selecting ‘keep local changes’)
Repeat Check-in operation (no conflicts should occur)
Documents and Version control : Documents and Version control
Locking : Locking Applied to a file or folder
Checkout Lock
Prevents other contributors from checking out a branch or file
More restrictive
Check-in Lock
Allows checkout, but not check-in
Allows others to work with a file, but not check in
One lock allowed per file or folder
Labels : Labels Label
Is a selection of files from different branches
Is an “unversioned” entity
Includes a single version of any selected file
Example
Milestone
like “Beta2”
Use files from “B2Release” branch
Omit XYZ.cs from branch
Include XYZ.cs from “B2QuickFix” branch
What’s new in TFS 2008? : What’s new in TFS 2008?
Scenario #1Fundamentals : Scenario #1 Fundamentals
Shelving : Shelving Set aside pending changes without checkin
Optionally revert to unmodified files
Restore shelved changes by “unshelving”
Unshelve other user’s changes
Power of task branching with less overhead
Shelving : Shelving Shelveset
Result of shelving
A copy of a set of pending changes (and adds), saved on the server for later usage
Can be retrieved later by creator and/or other team member
Examples
Share a work in progress with another team member
Code review before finishing current tasks
Put a incomplete effort on the server for backup
To put aside an effort because a higher priority task arrived
Shelving
Can reset the workspace to base version (optionally undo all pending changes after creating the shelveset)
Shelvesets Permissions : Shelvesets Permissions No permissions required to create a shelveset
Read and PendChange (Check out) permissions required to UnShelve
Scenario #2Switching context : Scenario #2 Switching context
Workspaces : Workspaces Client side copy of source checked out from repository
Owned by one user on one machine
Changes in workspace create “pending changes”
Typical Sequence of Events
Check Out
Coding…
Get Latest
Coding, Testing…
Check-in
Workspace Mapping = Repository folder mapped to Local Folder
Scenario #3Splitting work : Scenario #3 Splitting work
Check-In Policies : Check-In Policies Restrict changes that can be submitted
Configurable at project level
Applied locally = must be installed on client
Check-In Policies (cont’d) : Check-In Policies (cont’d) Three policies included with Team Foundation:
Work items associated
Checkin tests pass
Static analysis is clean
Team Foundation Power Tools adds four
Custom Path policy
Forbidden patterns
Changeset comments
Work Item Query
Extensible through plugin model
Build your own!
Custom check-in policies : Custom check-in policies
Scenario #4Working with Policies : Scenario #4 Working with Policies
Source Code Migration : Source Code Migration
VSS Feature Differences : VSS Feature Differences VSS does not have:
Workspaces
Changesets
Shelvesets
Content Merge, Namespace Merge (branch)
Auditing
Locking
Atomic checkins
Team Foundation Version Control does not have:
Share (but has much better support for parallel development)
Pin
Archive and Restore
Destroy
Shadow folders
Branching and merging is a lot more reliable in TFVC
Archive before migrating from VSS to TFVC!
Visual SourceSafe 2005 Comparison : Visual SourceSafe 2005 Comparison
Converters to TFS : Converters to TFS VSSConverter
Pick and Choose folders
Replays VSS actions to VSTS for history capture
Reports
Pre-migration analysis
User mapping file
Post-migration results
Allows for pinned files
Also see related Walkthroughs
Converters to TFS : Converters to TFS TFSMigrationToolkit
www.codeplex.com/TFSMigrationToolkit
Framework for conversion and replication of
Source Code
Work Items
3rd-party and open source solutions
Other migration questions : Other migration questions
Scenario #5Migration : Scenario #5 Migration
What files should be versioned? : What files should be versioned?
DEMO : DEMO News in TFS 2008
Agenda : Agenda
What is build automation? : What is build automation?
What is MSBuild? : What is MSBuild? A fully extensible build system that ships with the .NET Framework 2.0.
A build system that is seamlessly integrated with Visual Studio 2005.
Uses an XML file for describing your project’s properties, items, and build process.
MSBuild Project File Structure : MSBuild Project File Structure
MyCoolApp
true
$(AppName).exe
Overriding Targets : Overriding Targets
MSBuild files : MSBuild files C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.Tasks
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\*.targets
What is Team Build? : What is Team Build? A fully automated build solution that is easy to use and configure
Capable of a complete end-to-end build
Seamlessly integrated into Visual Studio Team System and Team Foundation Server
Fully extensible through standard MSBuild extensibility mechanisms (create custom tasks and loggers)
Team BuildArchitecture : Team Build Architecture Team Foundation Client Application Tier Build Machine Create build type
Start build
View Reports Team Build Web
Services MSBuild Drop Location Data Tier Sources
Work items
Team Build data Team Foundation warehouse Team Build Windows Service
Team Build Process : Team Build Process
Team Foundation Build Types : Team Foundation Build Types In TFS 2005
Stored in $/TeamProject/TeamBuildTypes Folder in TFVC
TFSBuild.proj
TFSBuild.rsp
VCOverrides.vsprops
WorkspaceMapping.xml
In TFS 2008
Stored in database + in $/TeamProject
Team Build Command Line : Team Build Command Line TfsBuild.exe
Start
Stop
Delete
Help
Key Features : Key Features Out-of-box public builds
Integrate with source control system and work item tacking
Configuration wizard
Single click to kick off build
Notifications
Build
Test
Publish metrics
Key Features (cont’d) : Key Features (cont’d) Central Build reports
Build status and progress
Compilation errors and warnings
Test and Static Analysis results
Work items and changesets included in the build
Code coverage
Key Features (cont’d) : Key Features (cont’d) Build Quality Trends
Store Build health information in warehouse
Generate trend reports
Other Build Types
Remote build server support
Desktop Builds
Build notifications : Build notifications
What’s new in TFS 2008? : What’s new in TFS 2008?
Build And Deployment : Build And Deployment
Scenario #5Creating a Team Build : Scenario #5 Creating a Team Build
Continuous Integration : Continuous Integration
Continuous Integration in VSTS : Continuous Integration in VSTS
Continuous Integration in VSTS : Continuous Integration in VSTS
Scenario #6Implementing Continuous Integration : Scenario #6 Implementing Continuous Integration
Team Build Customization : Team Build Customization
Customizable Build Targets : Customizable Build Targets
Team Foundation Build Tasks : Team Foundation Build Tasks
Desktop Builds : Desktop Builds
Team Build Extensions : Team Build Extensions
Custom MSBuild Tasks : Custom MSBuild Tasks public class MakeDir : Task
{
private string[] directories;
public string Directories
{
get {return directories;}
set {directories = value;}
}
public override bool Execute()
{
foreach (string directory in directories)
{
System.IO.Directory.CreateDirectory(directory);
}
return true;
}
}
Scenario #7Customizing the build definition : Scenario #7 Customizing the build definition
Agenda : Agenda
Configuration Management : Configuration Management
Branch And Merge : Branch And Merge Branch
Purpose: Isolation
Independent path of development (i.e. when a version or code base will need to be supported)
Experimental development, keep or throw away
Multiple development efforts to the same sub-system
A branch relationship is created in TFS to avoid duplication of history and metadata
Uses path-space branching
Intelligent copies
Branch And Merge (cont’d) : Branch And Merge (cont’d) Merge
Sync a branch into another
Cherry Picking changesets (include or omit)
History can be queried
Ability to show changes that have not been merged
Baseless Merge : Baseless Merge Merge between items that aren’t directly branched from each other
Can only be done from the command line: tf merge /baseless shared-source shared-target tf checkin
After checking in the baseless merge, the source and target are related as though the target had been branched from the source
Branch and Merge Terms : Branch and Merge Terms
Branch and Merge Strategies : Branch and Merge Strategies
No Branches : No Branches
Branch for Release : Branch for Release
Branch for Maintenance : Branch for Maintenance
Branch for Feature : Branch for Feature
Branching conciderations : Branching conciderations
The VBL Model : The VBL Model
Branching best-practices : Branching best-practices
Branching Check-List : Branching Check-List
Example : Example
Scenario #8Implementing a branch model : Scenario #8 Implementing a branch model
Reporting : Reporting
DEMO : DEMO Reports
Agenda : Agenda
Call to Action : Call to Action
ALM Live : ALM Live
Q & A : Q & A
Slide107 : © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION..
Catch the
buzz on authorSTREAM
Copyright © 2002-2008 authorSTREAM. All rights reserved.