Best way to automate change in Code Quality?

Jun 6, 2013 at 9: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?

TIA.
Jun 7, 2013 at 3: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.
Coordinator
Jun 11, 2013 at 10:33 PM
Hi,

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.

Regards,

Jason
Jun 13, 2013 at 1: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 12:32 PM
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">
      <sap:WorkflowViewStateService.ViewState>
        <scg:Dictionary x:TypeArguments="x:String, x:Object">
          <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          <x:Boolean x:Key="IsPinned">False</x:Boolean>
        </scg:Dictionary>
      </sap:WorkflowViewStateService.ViewState>
      <If.Then>
        <Sequence DisplayName="Set Build Quality to Development" sap:VirtualizedContainerService.HintSize="281,146">
          <sap:WorkflowViewStateService.ViewState>
            <scg:Dictionary x:TypeArguments="x:String, x:Object">
              <x:Boolean x:Key="IsExpanded">True</x:Boolean>
            </scg:Dictionary>
          </sap:WorkflowViewStateService.ViewState>
          <mtbwa:SetBuildProperties DisplayName="Set Build Quality to Development" sap:VirtualizedContainerService.HintSize="200,22" PropertiesToSet="Quality" Quality="Development" />
        </Sequence>
      </If.Then>
    </If>
    <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" />
    </mtbwa:InvokeForReason>
  </Sequence>
</Activity>