Best way to automate change in Code Quality?

Jun 6, 2013 at 8:00 PM
We are using TFS2012 and the beta version of TFS Deployer. I used it in the hopes of avoiding hacking up my build process template. However, I just realized that when our build finishes the build has no quality assigned. I manually set it to "Ready for Deployment" and sure enough, everything worked.

So, is there any way to set all builds matching a certain pattern (name) to a specific Quality?

Jun 7, 2013 at 2:28 PM
More troubling is the fact that I tried doing this in the workflow. I use the SetBuildProperties activity to change the Quality, but that doesn't seem to trigger the deployment.
Jun 11, 2013 at 9:33 PM

Unless you specify otherwise in your DeploymentMappings.xml file, TFS Deployer only looks for finished (Succeeded, PartiallySucceeded, Failed) builds.

Typically, when you set the build quality during a build workflow, the build's status is still InProgress and so TFS Deployer ignores the quality change.

You may need to change the quality as late as possible in the workflow or configure the deployment mappings to match on InProgress builds, or both.

This is of course assuming that TFS is sending the change notifications for InProgress builds. If you turn on Deployer's verbose logging you should be able to see each notification it receives from TFS and the matching it performs to determine whether to process it or not.


Jun 13, 2013 at 12:35 PM
Setting it in the Workflow never worked for me, even in the last steps. Likely it could be made to work but the default 2012 workflow is fairly complicated. Instead I created a tiny service that looks for new builds via the TFS API and sets the build quality. That seems to work well.
Jun 14, 2013 at 11:32 AM
I set the quality at the end of a successful build from my workflow. I modified the template and merge it into new team projects, basing new builds off it. I have Development, QA and Production (and Failed/Rejected) qualities. On a successful build I set it to Development so we get a free deployment to the development environment. Here's the very end of my template ...
    <If Condition="[BuildDetail.CompilationStatus = Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Succeeded And BuildDetail.TestStatus &lt;&gt; BuildPhaseStatus.Failed]" DisplayName="IQ - If Build Succeeded (Deploy)" sap:VirtualizedContainerService.HintSize="1370,252">
        <scg:Dictionary x:TypeArguments="x:String, x:Object">
          <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          <x:Boolean x:Key="IsPinned">False</x:Boolean>
        <Sequence DisplayName="Set Build Quality to Development" sap:VirtualizedContainerService.HintSize="281,146">
            <scg:Dictionary x:TypeArguments="x:String, x:Object">
              <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          <mtbwa:SetBuildProperties DisplayName="Set Build Quality to Development" sap:VirtualizedContainerService.HintSize="200,22" PropertiesToSet="Quality" Quality="Development" />
    <mtbwa:InvokeForReason DisplayName="Check In Gated Changes for CheckInShelveset Builds" sap:VirtualizedContainerService.HintSize="1370,146" Reason="CheckInShelveset">
      <mtbwa:CheckInGatedChanges DisplayName="Check In Gated Changes" sap:VirtualizedContainerService.HintSize="200,22" />