Geeks With Blogs

News




View Tarun Arora's profile on LinkedIn

profile for Tarun Arora at Stack Overflow, Q&A for professional and enthusiast programmers

Tarun Arora - Visual Studio ALM MVP ALM, Agile, Automation, Performance Testing, Software QA, Cloud, ...

 

Scribe - Test Scribe is a documentation power tool designed to construct documents directly from TFS for test plan and test run artefacts for the purpose of discussion, reporting etc. Scribe only works with Microsoft Test Manager, so if you needed to generate documentation for TFS Builds, what options do you have? You could potentially modify the Build Process template to generate report documentation as the build is executed or you could use the TFS data warehouse to extract data to create rich reports or use the TFS API like I did to create Release Notes.  

Recently I stumbled upon Build Manager, build manager is a solution developed by the ALM Rangers, it is intended to ease the management of builds in medium to large Team Foundation Server environments, though it does provide a few features which all users may find useful. You can check out the feature offering in the latest release here. So… I decided to extend Build Manager to create a prototype for Scribe like functionality to generate Build Notes.

Download Source

Download the source and demo executable from here, unzip the contents, you should get the folder structure “..\tfsbuildextensions-72864\TFSBuildManager\MAIN”

  • Demo => “..\tfsbuildextensions-72864\TFSBuildManager\MAIN\Demo\TFSBuildManager.Application.exe”
  • Source => “..\tfsbuildextensions-72864\TFSBuildManager\MAIN\Source\TFSBuildManager.sln”

       image

Feature Walkthrough

  • Open the source code from “..\tfsbuildextensions-72864\TFSBuildManager\MAIN\Source\TFSBuildManager.sln” and set “TFSBuildManager.Application” as the start up project.
  • Fire up the build Manager and load builds from across build definitions,

        image

  • Select the builds you would like to generate the build notes for | right click and from the context menu choose Build Notes

        image

  • Select what you want, mission reduce unnecessary noise!

        image 

  • I am using Open XML SDK for Microsoft Office to generate the build notes, so even if the client does not have Microsoft Office installed the build notes would be generated. I used the Open XML SDK 2.0 Productivity Tool – which let’s you reflect the code for an existing word document. Though at present I have not spend too much time abstracting the template logic [but this is still a prototype In love so I guess that’s acceptable]. I found a very useful walkthrough here that helped me create the build notes template. 

         And the final few lines of magical code…

   public void GenerateBuildNotes(IEnumerable<IBuildDetail> buildDefinitions, BuildNoteOptionsEnum noteOptions)
   {
       var builds = buildDefinitions.ToArray();

       // Pass Values to Template to create the document
       var path = String.Format("{0}\\{1}.doc", Path.GetTempPath(), Guid.NewGuid());
       Template template = new Template(path, builds, noteOptions, _workItemStore);
       template.CreatePackage();

       // Open the document
       Process.Start(path);
   }
  • I have bulk tested this for around 125 builds and usually completes in less than a couple of seconds

        image

        image

 

I need your Help!

Now what I have done so far is a skeleton structure – Build Details, Work Item Details and Change set Details (Download), I want to make build notes comprehensive, but at the same time, the user has the option of enabling/disabling what they want included in the build notes. I need your suggestion on what information would you like to see in the build notes. Some possibilities that come to my mind as I finish this post,

  • Build Completing time
  • Test Execution Status
  • Flag to indicate whether change set is a result of merge
  • File details in the change set

You can download the source and have a play around, looking forward to your feedback on further features that can be added to the build notes.

Thank you for taking the time out and reading this blog post. If you enjoyed the post, remember to subscribe to http://feeds.feedburner.com/TarunArora.

Check out the other posts on cool tools using TFS API. In love

Posted on Saturday, January 7, 2012 12:52 PM TFS2010 , TFS API , TFS Utilties | Back to top


Comments on this post: Build Manager Extension–Scribe for Build Notes

# re: Build Manager Extension–Scribe for Build Notes
Requesting Gravatar...
I pulled down this code today to see if it was a better alternative to creating build notes than what I already created.
Neither the included .exe (in Demo) in the downloaded package nor recompiling from Source produced a client that looks like your photos above.
The tabs, filters, and build notes options dont exist in the running client.
Also compiling in debug mode worked fine, release mode failed all over the place.
What am I missing?
Left by Russ on Jan 13, 2012 9:19 PM

# re: Build Manager Extension–Scribe for Build Notes
Requesting Gravatar...
Hi Russ,

I am investigating this and will get back to you shortly. Mean while you could have a look at the http://geekswithblogs.net/TarunArora/archive/2011/12/24/tfs-apindashrelease-notes-from-tfs-builds.aspx which does almost the same thing but in a slightly lighter application.

Tarun
Left by Tarun Arora on Jan 13, 2012 9:22 PM

# re: Build Manager Extension–Scribe for Build Notes
Requesting Gravatar...
Hi Russ,

Found the issue, the conversion of the selected items to IEnumurable (in BuildViewModel) and back to IBuildDetail in (TfsClientRepository) causes the InformationNodeConvertors in the method GenerateBuildNotes to lose the values. Dam! I should have retest this after re factoring.

As a quick fix you can get the build through uri by using the context again and that should bring back the InformationNodeConvertor values back. I'll fix this issue and upload the fix as soon as I get a chance.

Thanks once again for reporting this issue.

Cheers, Tarun
Left by Tarun Arora on Jan 13, 2012 9:30 PM

# re: Build Manager Extension–Scribe for Build Notes
Requesting Gravatar...
Alright Russ,

Here is the fix!

Replace the method GenerateBuildNotes in TfsClientRepository.cs with the below code.

public void GenerateBuildNotes(IEnumerable<IBuildDetail> builds, BuildNoteOptionsEnum noteOptions)
{
// Get the complete build information for the selected builds
var b = builds.ToArray();
var buildDetails = new IBuildDetail[b.Count()];
for (var i = 0; i < b.Count(); i++)
{
var build = b[i];
buildDetails[i] = buildServer.GetBuild(build.Uri);
}

// Pass Values to Template to create the document
var path = String.Format("{0}\\{1}.doc", Path.GetTempPath(), Guid.NewGuid());
var template = new Template(path, buildDetails, noteOptions, _workItemStore);
template.CreatePackage();

// Open the document
Process.Start(path);
}

Hope this helps.

Cheers, Tarun
Left by Tarun Arora on Jan 13, 2012 11:18 PM

# re: Build Manager Extension–Scribe for Build Notes
Requesting Gravatar...
Hi Tarun,

Good stuff. My expereince of release notes has been varied so definitely need full control over what goes in there. Laetly I've seen a trend towards PPT rather than DOC formated notes. This gives a 'dashboard' effect and can be used more effectively in meetings (such as mlestone releases).

One aspect of the PPT (Or DOC) was test run status. Terminology varies by org but essentially it gives you a view of how many tests are passing/failed/not run per stage. This gives a good view of how complete the product is or of the quality. Would be useful to include if we can. P.S. it is generally in the form of a chart ... :-)
Left by DavidJ on Feb 06, 2012 11:31 AM

comments powered by Disqus

Copyright © Tarun Arora [Microsoft MVP] | Powered by: GeeksWithBlogs.net