customizing and extending tfs michael juřek software architect microsoft s.r.o
TRANSCRIPT
Customizing and extending Customizing and extending TFSTFSMichael JuřekSoftware ArchitectMicrosoft s.r.o.
AgendaAgenda
Team Foundation Architecture Process Templates Work Item Types Source Code Control Build Portal and reports
Integrated Platform for Collaborating on Integrated Platform for Collaborating on Software Development Projects.Software Development Projects.
Version Version ControlControl
Work Item Work Item TrackingTracking
Build Build AutomationAutomation
ProjectProject
PortalPortal
ReportingReporting
Team Foundation ServerTeam Foundation Server
Team Logical ArchitectureTeam Logical Architecture
Custom reportingtools
MS ExceMS Projectl
Team Foundation Data Tier
Version ControlProxy
Report Client
Team Foundation Client Tier
CoreData
VersionControlWork Items Team Build
Data
SQLReportingServices
WindowsSharePoint
Services
SQLReportingServices
WindowsSharePoint
Services
Work ItemTrackingService
VersionControlService
TeamBuild
Service
CoreServices
Warehouse
Adapters
Team Foundation App Tier
WSS Proxies
SQL RS Proxies
Team Foundation Object Model
MS ExcelPlug-in
MS ProjectPlug-in
Visual Studio Packages
Internet Explorer
BuildProcess
VersionControlProxy
Service
Build Machine
Customization PointsCustomization Points Process
Template Modify, build,
or buy Work Item
Types Modify or build
Checkin Policy Modify or build
Reporting Modify, build, or connect different report builders
Project Portal Modify Sharepoint template Extend library folder structure, change or add doc templates
Extension PointsExtension Points Core services
Add a new tool with new artifact types, link types, database, WS’s
Link to other tools’ artifacts
Raise, subscribe to events
Integrate into Team Explorer
Extend the Project Creation Wizard
Work Item Tracking Write against OM Respond to events Link to Work Items Integrate with WI Picker Integrate with WI Form Support for custom
controls in SP1
Source Control Write against OM Add new file type
support Participate in
integrated check-in Define new policy Respond to events
Reporting Extend warehouse
with your own data Build
Add new Build tasks Create a checkin
validation system
TFS Administration ToolTFS Administration Toolhttp://www.codeplex.com/Wiki/View.aspx?ProjectName=TFSAdminhttp://www.codeplex.com/Wiki/View.aspx?ProjectName=TFSAdmin
Policy Override Notification Policy Override Notification ToolToolhttp://members.chello.nl/m.dekunst/SubScribeToPolicyViolation.ziphttp://members.chello.nl/m.dekunst/SubScribeToPolicyViolation.zip
AgendaAgenda
Team Foundation Architecture Process Templates Work Item Types Source Code Control Build Portal and reports
Process TemplatesProcess Templates
Process Templates Project process blueprint Package of tool settings and
templates Two included with Team
Foundation Server MSF for Agile Software
Development MSF for CMMI® Process
Improvement Modify ours, handcraft your own,
or buy
Process Process TemplateTemplate
ProcessTemplate.xmlProcessTemplate.xml
ReportsReports
Work Work ItemsItems
WorkItems.xWorkItems.xmlmlBug.xmlBug.xml
Template Template DefinitionDefinition
Version ControlVersion Control
VersionControl.xVersionControl.xmlml
Reports.xmlReports.xml
BugTrends.rdlBugTrends.rdl
CustomWIType.xCustomWIType.xmlml
Process Group
Process Group
References
References
Anatomy of a Process Anatomy of a Process TemplateTemplate
Process TemplateProcess Template Project Lifecycle
Phases and Iterations Exit Criteria
Process Guidance Document Templates Work Item Types and Rules
Bug, Task, Risk Work Packages (Scenario, Feature, Requirement)
Work items Work Item Types (such as Defect, Requirement, Issue, Task,
etc) Queries Work Item Instances/starter tasks
Windows SharePoint Services Process guidance WSS Site Template WSS Library & Folder Structure Document templates and all files stored on the Project Portal
Reports and their folder structure Default groups and their permissions Classifications: Areas and Iterations Source Control Settings
Process Template EditorProcess Template Editor http://www.imaginets.com/Default.aspx?tabid=133
Process Template EditorProcess Template Editorhttp://www.imaginets.com/Default.aspx?http://www.imaginets.com/Default.aspx?tabid=133tabid=133
AgendaAgenda
Team Foundation Architecture Process Templates Work Item Types Source Code Control Build Portal and reports
WIT customizationWIT customizationWIT customizationWIT customization Work Item Type Definition
Fields, form, state transitions Found in two places:
Process Template “Live” Team Project
Scenarios Add enterprise specific work item
types Modify existing work item type
forms and rules TFS ships with pre-defined types
TIP: Use as blueprint
Work Item Work Item StoreStore
Work Item Object ModelWork Item Object Model WITWITXSDXSD
Work Item TypeWork Item TypeXMLXML
c:\ witimportc:\ witimportc:\ witexportc:\ witexport c:\ witimport /vc:\ witimport /v
ValidatValidatee
NotepadNotepad, Process , Process Template Template Editor, …Editor, …
ImportImportExportExport
VisualVisualStudioStudio
Customizing Work Item TypesCustomizing Work Item Types
<WITD application="my editor" version="1.0"><WITD application="my editor" version="1.0">
<WORKITEMTYPE name="Custom Code Defect"><WORKITEMTYPE name="Custom Code Defect"> <FIELDS><FIELDS> <FIELD name="Severity" refname="Custom.Severity" <FIELD name="Severity" refname="Custom.Severity" type="Integer">type="Integer"> <HELPTEXT>How severe the code defect is</HELPTEXT><HELPTEXT>How severe the code defect is</HELPTEXT> <REQUIRED /><REQUIRED />
</FIELD></FIELD> </FIELDS></FIELDS> <WORKFLOW><WORKFLOW> <STATES><STATES> <STATE value="Active" /><STATE value="Active" /> </STATES></STATES> <TRANSITIONS><TRANSITIONS> <TRANSITION from="" to="Active"><TRANSITION from="" to="Active"> <REASONS><REASONS> <DEFAULTREASON value="New" /><DEFAULTREASON value="New" /> </REASONS></REASONS> </TRANSITION></TRANSITION> </TRANSITIONS></TRANSITIONS>
</WORKFLOW></WORKFLOW> <FORM><FORM> <Layout><Layout> <Control Type="FieldControl" FieldName="Custom.Severity" <Control Type="FieldControl" FieldName="Custom.Severity" Label="Severity" LabelPosition="Left" />Label="Severity" LabelPosition="Left" /> </Layout></Layout>
</FORM></FORM> </WORKITEMTYPE></WORKITEMTYPE></WITD></WITD>
Work Item Type DefinitionWork Item Type Definition
Name Fields
Field Rules
Work Flow States Transitio
ns Field
Rules
Form
Work Item Type FieldsWork Item Type Fields Field reference names
Think “column name” Use in your tooling Server scope Follow domain name convention
Microsoft.TeamFoundationServer.WorkItemTracking.Foobar
System.* reserved Field friendly names
Think “column alias” Use in your queries Server scope Can be renamed, Title->Issue for example
Field labels Appear on WI forms Localizable
Active
Pending
Resolved
Closed
/ Pend
/ Resolve
/ Verify
/ Edit
/ Re-activate
/ Re-activate
/ Resolve
/ Open
/ Edit
/ Edit
RegressionRe-activate
Test Failed,Resolution Denied
Fixed, Defered,Won’t Fix,Duplicate,As DesignedNo Repro
From CustomerFrom QA
/ Re-activate
Test Passed,Resolution Confirmed
Fixed
Wrong Fix
Fix Ready
UpdatedBlockedinvestigatingFixing
TestingReviewing
/ Edit
Ammended
Example WI State DiagramExample WI State Diagram
WIT SecurityWIT Security in TFS 2005 in TFS 2005
You can: Set permissions by project areas (in
UI) Set permissions for a state
transition of WI type (in WI type definition) Creating WI is also transition
You can’t: Have item-level permissions Have field-level permissions
AgendaAgenda
Team Foundation Architecture Process Templates Work Item Types Source Code Control Build Portal and reports
Source Control GotchasSource Control Gotchas Sharing and pinning are not
supported Concurrent check-out by default Limited offline support No Get Latest on check-out Features only in command line
Undo another user’s changes Features only in TFS Power Toys
Rollback (but actually „Compensate“) Annotate (also in VS UI) TreeDiff (also in VS UI) Merge on Unshelve
““Missing” VSS featuresMissing” VSS features Branching and Merging is the recommended
way but it is not direct equivalent Isolation between possibly breaking changes Mastering branching and merging is crucial
Pinning Branching and merging enables any and all of the
following scenarios: Promotion modeling, Pinning, Frequent Releases,
Service Packs, etc.
Sharing For VSS-style sharing, put common files in a
common directory and use ‘Add as Link’ References with relative paths If shared files change often, share source code If shared files are DLLs, consider NOT sharing
automatically 3rd party products – e.g. TFSLinks
(ComponentSoftware Inc.)
Check-in policiesCheck-in policies In the TFS box
Work Items, Tests, Code Analysis Work Items highly recommended, others
are usually impractically restrictive Custom:
Easy - just derive from PolicyBase Warnings:
Run on client, not server Easy to hack by a malicious user
Collaboration tool, not security measure Only type names and parameters on
server Need to deploy manually to clients
Team Foundation Power Team Foundation Power ToysToyshttp://www.microsoft.com/downloads/details.aspx?FamilyId=3F21144A-4E98-4CE0-830F-D1F3E8AC9D67&dishttp://www.microsoft.com/downloads/details.aspx?FamilyId=3F21144A-4E98-4CE0-830F-D1F3E8AC9D67&displaylang=enplaylang=en
Forbidden Patterns PolicyForbidden Patterns PolicyVisual Studio 2005 SDKVisual Studio 2005 SDK
AgendaAgenda
Team Foundation Architecture Process Templates Work Item Types Source Code Control Build Portal and reports
Typical team buildTypical team build
InitializationInitialization Build ServerBuild ServerPreparationPreparation
Source CodeSource CodeSynch. Synch.
Code Churn Code Churn CalculationCalculation
Report Report GenerationGeneration
PublishingPublishing
Work Items Work Items UpdateUpdate
Code Code Coverage Coverage
CalculationCalculation
Compilation,Compilation,Static Static
AnalysisAnalysisUnit TestsUnit Tests
Customizing TFS BuildsCustomizing TFS Builds See walkthrough:
http://msdn2.microsoft.com/en-us/library/ms400767.aspx
Find the right task: MSBuild -
http://msdn2.microsoft.com/en-us/library/7z253716.aspx
TFS - http://msdn2.microsoft.com/en-us/library/ms243778.aspx
Third-party (mostly freeware) See http://msbuildtasks.tigris.org/
Build your own Find the right target (17 out of 35
provided): http://msdn2.microsoft.com/en-us/library/aa33760
4.aspx
CustomCustom Build Task Build Task MSBuild SidekickMSBuild Sidekickhttp://www.attrice.info/msbuild/index.htmhttp://www.attrice.info/msbuild/index.htm
Team Build SidekickTeam Build Sidekickhttp://www.attrice.info/cm/tfs/TeamBuildAddin.hthttp://www.attrice.info/cm/tfs/TeamBuildAddin.htmm
AgendaAgenda
Team Foundation Architecture Process Templates Work Item Types Source Code Control Build Portal and reports
Project PortalProject PortalProject PortalProject Portal Dependency on WSS:
WSS must be installed before TFS installation
You can remove WSS site creation from process template
WSS Site per project New web parts can be added to the
gallery Sharepoint templates can be modified
or extended Initial content in Process Template You will typically see bug Q915746
Contact local MS Support Services for fix
Reporting - High Level Reporting - High Level ArchitectureArchitecture
Adapter Adapter Adapter Adapter
Work Item Tracking
Version Control
TeamBuild
TeamTest
3rd PartyData
Sources
Adapter
Team Foundation Relational Warehouse
Team Foundation OLAP Warehouse
OLAPSemantic Model
Adapter
Common Structures
Report Builder Reports
Report Designer Reports
ExcelReports
Report Designer: Precision Layout, Developer-built
Report Builder: End-user ad-hoc charts and lists with drill-throughExcel: Portable, familiar, exploratory analytical reports
Integrated ReportingIntegrated Reporting
**
** **
** **
** ** ** **
**
** **
**
ProjectProjectStructureStructure
ProjectProjectStructureStructure
IterationIterationStructureStructure
IterationIterationStructureStructure
WorkWorkItemItem
WorkWorkItemItem
LabelLabelLabelLabel VersionedVersionedItemItem
VersionedVersionedItemItem
LatestLatestItemItem
VersionVersion
LatestLatestItemItem
VersionVersionChangesetChangesetChangesetChangeset
BuildBuildBuildBuild TestTestResultResult
TestTestResultResult
SummarySummary
TFS is highly customizable and extensible products
MSDN and Visual Studio 2005 SDK are your primary resources
Many free and commercial 3rd party tools http://accentient.com/widgets.aspx