1 / 41

Visual Studio Team System

Visual Studio Team System. Visual Studio 2008 SDK. Agenda:. Introduction Work Item Object Model Event System Check-in Policies. Purpose of the SDK. Integrate existing management tools Work Items Change sets Test Results Integrate error logging systems

zev
Download Presentation

Visual Studio Team System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Visual Studio Team System Visual Studio 2008 SDK

  2. Agenda: Introduction Work Item Object Model Event System Check-in Policies

  3. Purpose of the SDK • Integrate existing management tools • Work Items • Change sets • Test Results • Integrate error logging systems • Create bugs, tasks, or other work items from system crash reports • Extend your development experience

  4. Architecture of the SDK • Provides an abstraction over the underlying server architecture • Object models are grouped by feature area • Provides 2 main object models • Client Object Model • Work Item Tracking • Custom Check-in Policies • Application Tier Object Model • Event System

  5. Team Foundation Server • Core object on a team foundation server • Abstracts the common infrastructure for TFS components: • Server discovery • User credentials • Team Projects • Work Item Store • Globalization information

  6. Work Item Object Model • Provides a managed API to Work Item Tracking components of TFS • Programmatically create or change work items • Team Explorer uses this exact same API for its native work item functionality

  7. Work Item Store • Root node of the Work Item Object Model • Retrieve instances of individual work items • Stores information about the context of work item • Created through an instance of the TeamFoundationServer class

  8. Object Model Architecture • Hierarchical structure • TeamFoundationServer • WorkItemStore • Project • WorkItemTypes • WorkItemType • StoredQueries • FieldDefinitions • RegisteredLinkTypes

  9. Architecture Breakdown • TeamFoundationServer class • The server that stores the Team Foundation Database • WorkItemStore class • Database that stores all Project and related data • Project • Describes the overall project

  10. Architecture Breakdown • WorkItemTypes • A collection containing types of work items that exist within the project (bug, task, scenario, etc) • You can create a WorkItem as soon as you know a WorkItemType within a Project • Contains a collection FieldDefinitions specific to this work item type

  11. Architecture Breakdown • FieldDefinitions • Desription for fields used throughout a project in a WorkItemStore or in a WorkItemType • RegisteredLinkTypes • Link types available to all Projects under a WorkItemStore • Links can link to things like ”Related WorkItem”, ”Source Code File”, ”Test Result”, and so on

  12. Work Items Facts • Uniquely identified by an ID • Defined by a WorkItemType • Belongs to a project • Contains fields which are stored in a Field collection, as definied by its WorkItemType • Previous versions of it can be retrieved by specifying the revision number or the date/ or a revision

  13. Retrieving Work Items • Retrieved through an instance of WorkItemStore • Can be retrieved by: • WorkItem ID • URI (vstfs:///WorkItemTracking/WorkItem/[ID]) • Using the WIQL • Previous versions can be retrieved by: • ID or URI plus DateTime • ID or URI plus revision number

  14. Work Item Query Language • SQL-like language for querying work items against the work item object model • Build more complex queries than supported in the query builder (team explorer) • Returns a WorkItemCollection of all work items matching the query string

  15. WIQL - Active Bugs

  16. Demo Work Item Explorer

  17. Eventing Service • Reliable, asynchronous publish-and-subscribe event notification system • Users and Services may subscribe • Two Subscription Models • E-mail (Plain Text or HTML) • Web Services

  18. Event Types • There are several Event types • Not well documented • EventType is defined by a schema • Schema’s are located in the TFS installation folder • C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Services\v1.0\Transforms • SOME Schema’s are definied in the database • In the TfsIntegration database, there is a table called tbl_event_type • USE TfsIntegration SELECT [name], [event_type_schema] FROM tbl_event_type

  19. Available Event Types RED– available through Team Explorer under Project Alerts

  20. Web Service Subscription • Run BisSubscribe.exe specifying: • The EventType • deliveryType as Soap • Web Service URL • Filter expression BisSubscribe.exe /eventType CheckinEvent /address http://christian/Service.asmx /deliveryType Soap /server MAGNI /filter ”TeamProject=’Commentor Framework’”

  21. Web Service Definition • Must have a specific shape • XML passed in is definied by a schema • public void Notify(string, string);

  22. WCF Service Definition

  23. Listing your Subscriptions • Viewed and modified in Team Explorer • Visual Studio 2008 Power Tools is required

  24. Event Subscription • Programmatically Subscribe or UnSubscribe to TFS events • Required References • Microsoft.TeamFoundation.dll • IEventService - Provides support for event subscription • Microsoft.TeamFoundation.Client.dll • TeamFoundationServer Factory – TFS instance

  25. IEventService • SubscribeEvent() • User ID (string) • Event Type (string) • Filter Expression (string) • DeliveryPreference() • Address – Email address or Web Service URL • Schedule – Daily, Weekly, Immediately • Type – EmailHtml, EmailPlaintext, or Soap (Web Services) • Classification (string) • Tag or Name to for the event

  26. Programmatic Event Subscription • Add a reference to • Microsoft.TeamFoundation • Microsoft.TeamFoundation.Client

  27. Cancelling Subscription • UnSubscribeEvent() • Subscription ID (int)

  28. Demo Email Subscription via C# Web Service Subscription via C# Web Service Notification Desktop Notification

  29. Custom Check-in Policy • Visual Studio Team System object model • Not fully documented • Part of the client object model

  30. Creating Check-in Policies • Fully customizable • Enforce company coding standards • Disallow certain design patterns • Code documentation standards • Etc.

  31. Creating a Check-in Policy • Create a new Class Library project • Add the [Serializable] attribute to the class • Add a reference to Microsoft.TeamFoundation.VersionControl.Client.dll • Make the class implement the following: • IPolicyDefinition • IPolicyEvaluation

  32. IPolicyDefinition • Determines how the check-in policy is displayed to the user

  33. IPolicyEvaluation • During the actual Check-in • Calls Initialize() then Evaluate()

  34. Evaluating the Check-in • Initialize() is passed reference to IPendingCheckin • This gives access to any pending changes • Evaluate() returns an array of PolicyFailure objects

  35. CheckedPendingChangesChanged • IPolicyEvaluate has PolicyStateChanged event definied on the interface • Visual Studio subscribes to this event • Subscribe to CheckedPendingChangesChanged event in Initialize() • Visual Studio fires CheckedPendingChangesChanged event to signal change of files being checked in • When files [de]selected in the Pending Check-ins Window • Respond to CheckedPendingChangesChanged event by: • Re-evaluating the Policy • Firing PolicyStateChanged event • Pass list of Policy Failures

  36. CheckedPendingChangesChanged

  37. Deplying Check-in Policies • Add registry entry on the server and clients • Assembly must be copied to: • Team Foundation Server machine • User workstations

  38. Policy Error • Policy must be installed properly both on the server and client • Error dialog is shown otherwise

  39. Overriding Check-in Policies • User has the possibility of override the check-in policies • Information is logged • No direct or easy way to view the log, one must query directly to the database

  40. Demo No Tabs Custom Policy View Overriden Check-in Policies

  41. The End

More Related