Monday, March 10, 2014

MVA Course: Administering TFS 2012 Jump Start (Modules 4 & 5)

Customize TFS for Team Use, and Administer Version Control


Another certificate of completion:





And my copious notes on the presentations:

*******************************************************************************************
MODULE 5
*******************************************************************************************


Configure a team build definition.
- setting up for a symbol server and source server
- setting up for custom build numbers
- configuring build log verbosity
- setting up definition properties including test impact analysis, code analysis, 
  automated unit testing, and architecture validation
- setting up build triggers (gated check-in, continuous integration, scheduled build)
- configuring the build drop location to be in source code control or a fileshare

// new build definitions done in Visual Studio
// General - build name and queue processing:
//   Enabled - requests (user or system) are added to queue and started in priority order
//   Paused - requests are queued but will not start until build admin forces start
//   Disabled - No requests queued or started. Cannot participate in CI or Gated triggers
// Triggers - allow you to configure when builds are run: 
//   manual - check-ins do not trigger builds
//   continuous integration - build each check-in
//   rolling builds - accumulate check-ins until the prior build finishes. makes sense when
//                    you have many check ins and long build times
//   gated check-in - accepts check ins only if the submitted changes merge and build 
//                    successfully. 
//   schedule - build every week on the following days. Can specify to build even if nothing
//              has changed. This produces information that can be pushed into reporting.
// Source settings: control where source is pulled from
//    cause for concern if root folder is specified, because this might result in pulling
//    in code from other branches
// Build defaults - build controller
//    control staging location - allows use of drop folder
//    useful for build-deploy-test workflow
// Process:
//    define projects and configurations to build
//    specify automated tests
//        build on test failure - if any automated tests fail, the whole build will fail
//        designate test platform (x86), filters, run name, sources spec
//  Build number format lets us control the build name - date, version, etc.
//        can't add a literal string to the end of the label
//    Clean workspace - conservative option is to download everything (more overhead)
//    Logging verbosity - minimal, normal, detailed, diagnostic; progressively more detail]
//    Code Analysis - always, never, as configured
//    Source and symbol server - symbol server is basically a file share. folder names with 
//         GUIDs for names
//    Configure the build agent - max execution time, max wait time, name filter, tags
//    Can disable tests - may want to test as an integrated part of another build
//    Can specify command line arguments for MSBuild
// Retention Policy
//    can control how many builds are kept for either Triggered/Manual, or Private builds -
//         - Stopped, Failed, Partially Succeeded, Succeeded.
//    generates some interesting debate between the presenters on how many builds to keep
//    for each status type. Anthony doesn't keep many successful builds, Scott keeps a ton
//    Disk IO on SSD vs 7200rpm is much better.
  
Manage build execution.
- queuing a build with parameters
- reconciling workspaces as part of a gated check-in workflow
- customizing build qualities
- cleanup of builds (applying retention policies)

// In Visual Studios - Team explorer, Builds
// right click - "queue" to queue up a build.
// can queue with defaults or can add parameters to customize particular build
// actions -> view builds opens up the Build Explorer
// can notate quality control status
// 

Modify a process template.
- uploading and downloading process templates
  http://examcr.am/112qRZb
- troubleshooting template errors
  (no links)
- customizing functional areas within process templates, 
  including SSRS, SharePoint, build definitions, Work Items, and queries
  http://examcr.am/18yCUUs  
  
The customisation process
- Download the process template that you are either currently using or that most 
  closely matches what you will be using.
  // don't have blank templates, need to get a template out of the box and customize
- Rename the template (Important)
- Make a few small changes at a time, verifying your changes as you go (incremental)
- Upload to a non-production server to test
  // if you clone a TFS server for testing, change the server ID
  // using a clone of the production server is a good test environment
  // put your changes inside of version control
- Create a new team project using your template
- Verify the changes you have made are correct

// In Visual Studio, go to TEAM, Team Project Collection Settings, Process template 
// manager. Process template are at the collection level. Choose the template that 
// is closest to what you want to use, and download. Places that template on the local
// hard drive. Version control is a good place to put the files and folders.
// processTemplate.xml is the table of contents. Rename by changnig the <name> tag, 
// can add description with <description>, and change version by changing GUID.
// Once template is complete, can upload to TFS server. TFS validates XML file when it is
// uploaded.


Configure a team project.
- defining areas and iterations
- managing users through the default security groups
- managing portal settings (team project portal site URL, process guidance URL)
- defining project-level alerts

// Team explorer, settings takes us to work item areas and iteration. Can also get there 
// through Web Access portal, Admin (gear icon). Iterations lets us define sprints.
// When using a template to create a new team project, iterations and areas are defined
// based on the template.
  
Apply Work Item customizations.
- adding a new Work Item type as a child of an existing Work Item
- customizing field definitions for a Work Item // this is very common
- customizing form layout and workflows
- customizing global lists, link types, and categories

Adding a new field
- Adding fields to Work Item Types is a common form of template customization
- The simplest approach is to copy a field that has similar characteristic and then edit 
  the values.
- The FIELD element syntax:
<FIELD name="field display name" refname="field reference name" 
type="String | Integer | Double | DateTime | PlainText | HTML | History | 
TreePath | GUID " syncnamechanges="true | false" reportable="Dimension | 
Detail | Measure" formula="sum" indexable="true | false" >
</FIELD>
Some common field data types
- DateTime: Specifies a date according to Coordinated Universal Time (UTC) moment in time.
- Double: Specifies a floating-point value. Double fields are frequently used in query 
  filters and results lists.
- HTML: Supports the ability to capture rich-text data and to use longer text descriptions 
  such as a work item description
- Integer: Specifies a 32-bit signed integer value.
- PlainText: Supports entry of a text string that can contain more than 255 Unicode 
  characters.
- String: Supports entry of a text string that can contain up to 255 Unicode characters.

Reportable Attribute Values
- Detail: Use the Detail type only for Integer, Double, String, or DateTime fields. 
  The data in this field is moved into the relational warehouse database in the Work 
  Item and Current Work Item tables but not into the SQL Server Analysis Services cube.
- Dimension: Use the Dimension type only for Integer, String, or DateTime fields. 
  The data in this field enters the relational warehouse database and the Analysis 
  Services cube as an attribute of the Work Item dimension so that the data can be 
  used to filter reports.
- Measure: Use the Measure type only for Integer and Double fields. Measures are the 
  numeric values in your reports.  During processing of the Analysis Services cube, 
  data is precalculated on fields that are set to Measure. 
- None: Specify None when you do not want to include the field in reports. 

// workitem type definition file includes fields, workflows, and forms.  
// good idea when customizing definition file to include comments <!-- blah blah -->
// comments are removed when the template is downloaded. bummer
// if you are not sure on the reportable value, leave it out. A wrong value can live in 
// the cube, but a blank value can be added back in later.
// workflow includes states and transitions
// forms is last available bit, non-visual interface.
// Process template editor can be used to edit XML.
// Creating a team project with a template is sensitive to time changes.

// do process template changes apply to team projects that have alerady been created? No, 
// existing projects are not effected by any changes to the template they were based on.]
// posible to add parameter "/verify" when uploading template to check template for error.
// how do you check which process template was used to create a project? New versions allow
// checking this, can also add fields to track versioning.
// taking 24hrs to convert 100gb database from 2008 to 2012, any tools to speed this up?
// look at hardware contraints - memory, disk space, network IO - should only take a few hours
// test attachment cleanup tool might help with this as well - except 2008 has no
// test attachments. This cleanup tool can strip out unnecessary data like test videos.
// Field name uniqueness - important with regard to SSRS reports.  reference name has to be
// unique, but so does friendly name. Can define XML with reporting name.
// New Kanban states - how to use them with regard to state transitions? Mapping between
// states and metastates...

Create Work Item queries.
- defining query folders and permissions
- applying query types (tree, flat, directed)
- adding fields to a query
- creating a query by using Team Explorer

// Work item queries are accessed through Visual Studio Team Solution explorer -> Work Items
// Right click "My Queries" and select "New Query"
// specify the field, operator, and value, multiple can be AND/OR together.  
// personal queries can be moved to shared queries and then made team favorites, which 
// creates a tile in the web portal for the query
  
Configure client connectivity to Team Foundation Server.
- configuring Visual Studio, Team Explorer, Team Explorer Everywhere, Excel, Project, 
  and other tools to connect to Team Foundation Server
- configuring clients for a proxy server
  
// they're going to cover this later...  
  
EXAM BEST BETS
- Build topics can be found under the following MSDN library node 
  http://examcr.am/158otoL
- Practice, practice, practice. Use a non-production TFS Server to try each customization
- Review MSDN Resources provided at the end of each section


*******************************************************************************************
MODULE 6
*******************************************************************************************


// demo of client connectivity and connecting to proxy server
// can specify the fully qualified TFS server name or just the root, and VS will add
// protocol, port, and path information.
// port 8081 is default for proxy.

// version control is quarter of test but is actually a simple subject (relatively)

Create and manage workspaces.
- cloaking, undoing delete, and modifying a workspace //three completely different things
- deleting a workspace; specifying workspace visibility
- unlocking other users’ checkouts, pending changes, and code
- choosing a default workspace type for a collection
- deleting a shelveset
- deciding between local and server workspaces

Edit Workspace Settings
 - Command Line: use tf workspace
 - UI: Use Manage Workspaces -> Advanced

Cloaking a Working folder
- command line: tf workfold
- UI: Use manage workspaces

// cloaking allows us to leave files out of the workspace, e.g. documentation.

Undeleting a File
- To restore an item deleted from the server
- From the menu bar choose Tools, Options.
- On the Options dialog box, navigate to Source Control, Visual Studio Team Foundation 
  Server.
- Select Show deleted items in the Source Control Explorer, and then choose OK.
- From the menu bar choose View, Other Windows, Source Control Explorer.
- In Source Control Explorer, navigate to the folder that contains the item you want to 
  restore.
- Open the item’s shortcut menu and then choose Undelete.

Configure Default Workspace Type
- Default workspace types (local vs server) can be set at the collection level.
// Team explorer -> Team Project collection -> Source Control -> workspace settings
// local is the default setting on new TFS installs.
// local workspaces allow you to work offline
// server workspaces are used when you have many items
// enable get lates on check out on server workspaces
// can set check-in policy, require check-in notes
// "get latest on check-out" is bad because only file you are working on is grabbed, not
// the related changes in another dependant file
// source control explorer -> workspaces -> create workspace. Config, set paths

Deleting shelvesets
// TFS Sidekicks allows you to delete a workspace
// command line tf workspaces /? gives us information about workspaces and lets us do bulk 
// updates
// tf shelvesets and tf shelve let us manage shelvesets from the command line
// tf undo will undo the check-outs for a given workspace
// tf status will show if files are checked out.
// in Visual Studio, go to Tools -> Options -> source control -> TFS Server -> show 
//    deleted items in the Source Control Explorer

Configure version control proxy.
- measuring the cache hit ratio
- setting up the cache size
- setting up for multiple Team Foundation Server servers
- Using the Proxy.config file

Installing a Proxy Server
// TFS Admin Console -> Proxy Server -> Configure Installed Features -> Configure TFS Proxy

Measuring the Cache Hit Ratio
To view cache performance by using the ProxyStatistics Web service
- Log onto the server whose performance you want to monitor
- For Team Foundation Server Proxy using the default settings for port: 
  http://localhost:8081/VersionControlProxy/v1.0/ProxyStatistics.asmx 
- Click QueryProxyStatistics, and then click Invoke
- An XML output file shows data including OverallCacheMisses, CacheHitsPercentage, 
  and CacheMissPercentage
     <ProxyStatisticsInfo CurrentCacheSize="356352" NoOfRequests="82" 
     OverallCacheHits="41" NoOfFilesInCache="41" OverallCacheMisses="41" 
     CacheHitsPercentage="50" CacheMissPercentage="50" /> 

// unlike test controllers, a proxy server can connect to any number of TFS servers
// requires using proxy.config  
Proxy.config 
  <?xml version="1.0" encoding="utf-8"?>
  <ProxyConfiguration  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Servers>
        <Server><Uri>http://vsalm:8080/tfs/fabrikamfibercollection/</Uri></Server>
        <Server> <Uri>http://vsalm:8080/tfs/tailspintoyscollection/</Uri> </Server>
    </Servers>
    
    <!-- Proxy file cache root folder -->
    <CacheRoot>C:\Program Files\Microsoft Team Foundation Server 11.0\Version Control 
 Proxy\_tfs_data</CacheRoot>
    
    <CacheLimitPolicy> …    
    <!-- Cache limit expressed as percentage of disk space -->
    <PercentageBasedPolicy>75</PercentageBasedPolicy>
   
    <!-- Cache limit expressed as MB -->
    <!-- <FixedSizeBasedPolicy></FixedSizeBasedPolicy> -->
    </CacheLimitPolicy>

<!-- The maximum age (in days) of content in the cache following a cleanup operation -->
    <DeletionAgeThreshold>30</DeletionAgeThreshold>
        
    <!-- Percentage of cache size that needs to be freed up, on hitting cache limit -->
    <CacheDeletionPercent>10</CacheDeletionPercent>
    
    <!-- Indicates how often (number of hours) the proxy statistics information should be 
 persisted to a file-->
    <StatisticsPersistTime>1</StatisticsPersistTime>

  </ProxyConfiguration>
  
Configure team project version control settings.
- enabling multiple checkout
- enabling get latest on checkout
- configuring check-in policies for a team project (Work Items, builds, code analysis, 
  testing policies)
  (no links)
  
To configure checkout settings
- In Team Explorer, select the team project for which you want to configure check-out 
  settings.
- From the Team menu, click Team Project Settings, and then click Source Control.
- In the Source Control Settings dialog box, select the Check-out Settings tab.
- Select or clear the Enable multiple checkout box.
- Select or clear the Enable get latest on check-out box.
- Click OK.

Configuring Check-in Policies
// Under Team Project, select Source Control, Check-in Policy tab
// not possible to set policy against work items to require check-in against certain
// work item types (like restricting check-in to tasks and bugs)

Code Analysis Policy Editor
// check-in policy type. can create a ruleset and use that as the rules for Code Analysis

EXAM BEST BETS
- Understand the differences between local and server workspaces
- Be able to explain cloaked folders
- Know the available options for configuring a proxy server
    - Especially the options found in Proxy.config
- Practice setting up version control check-in policies, especially those that come 
  out-of-the-box
    - Work Items, Builds, Code Analysis
- Understand how to undelete a file 

// can a 2012 proxy work with 2012 and 2010 TFS servers? Don't know
// can proxy point to multiple servers or just multiple TFS servers locally? No you can 
// point it anywhere/
// can you use powershell with TFS? Scott about Hulks out, because no, not exactly powershell
// for TFS. Powertools has something similar
// When would you use a non-private workspace? You might have multiple people on the same 
// machine working on the same workspace (one machine that multiple people remote into for
// coldfusion development)
// can team explorer everywhere connect to TFS proxy? yes.
// can I query moves one by one? They are considered renames, and it's not really possible.

Keller VM for practice:















No comments:

Post a Comment