Team Foundation Server Automated Release Notes generation - tfs

What would be the best method of automatically generating a Release Notes text file from a Team Foundation Server 2008 nightly build?

We created a TFS report that lists all Work Items associated with a specified Iteration (version). In addition we added a custom field to Work Items to indicate if we wanted the work item included in the release notes report. (Not all Work Items are appropriate for all clients/users.)
You could automate this process but you would need to specify the iteration in your build task. Or you could list every work item that has been completed as of a specific date.

I think the solutions here are describing "build notes". If you want that, you really need to checkout the TFS Community Build Manager. It has a feature to generate build notes in Word files by using the OpenXML. It's clicking the VSIX and you're done.
But imho, build notes are not release notes. Release notes provide a more customer friendly way of listing you changes. And you need to be able to specify what work items you want in the notes, and the ones you don't want your customer to see. So for that, I have created a custom Team Explorer add-in. And it does more or less what the build manager does as to generating the OpenXML Word.
I use queries to define what the bugfixes are, what new features are available, ... and then the team explorer extension provides the GUI to specify the document fields (Title, descriptions, remarks, ...) and to select the queries corresponding to the blocks on the release notes. After filling in the details, the word document gets generated. I can provide with all the details if you want.

UPDATE:
I uploaded a sample xsl file for transforming the buildlog.xml to get an informative plain releasenotes.txt. Get it here: Automatically generate release notes textfile from Team Foundation Build
That one is actually pretty easy. Grant Holliday describes it on his blog. It basically goes something like this:
Install MSBuild Community Tasks (which contains the WebDownload Task)
Install MSXSL.exe from Microsoft (for transforming xml files)
Extend the tfsbuild project with information regarding the retrieval of the buildlog.xml (using WebDownload task) and transformation with MSXSL.exe
However, you need to download the MSBuild Community Tasks directly from tigris and not use the link provided in this blog post. This is due to the fact, that the link refers to the wrong version which does not support the UseDefaultCredentials options (that you need for the MSBuild Task to be able to connect to the proper TFS Webservice).
Here is the link to the article:
Building a release notes text file with team build
I got everything working except for the xsl file, because unfortunately, Grant does not offer a sample xsl. If you manage to create a proper xml transform file that fits your needs, it would be awesome if you can send me a copy. ;-)

Related

TFS 2018 - move subset contents to another server/domain

Looking for documentation about moving only a subset of contents from a TFS 2018 server in certain domain and hardware to another TFS 2018 server in another domain and hardware.
More Details :
It is possible to follow general instructions for migrating a tfs to another server/domain, but we need only a subset of the contents i.e. contents for specific team projects in the single default collection that we have. The existing documentation in microsoft docs relates only to all the contents as a whole. We'd thus also like to assess whats recommended : migrate all and delete relevant contents on target or migrate only relevant contents from source to destination. Contents include : code, work items, Build & Release, all history, etc...
There's no way split individual projects out of a team project collection without resorting to third-party integration tools and suffering from a lot of pain.
The best solution is to clone the team project collection using the standard process, migrate it, then delete what you don't want.

Can we generate release notes from TFS

Can we get release information from checkedIN history.
we are using TFS 2012.
we have frequent release mostly on each week or on each 14 days.
Can we generate release document from TFS ?
(something like, based on TFS checked IN comments OR some how )
One way to do this would be to use Work Items (e.g. User Stories and Bugs) to generate your release notes.
But this requires your team to have the discipline to enter the information into TFS that allows it to associate work items with a release. For example:
Require developers to associate change sets with work items
Use fields such as "Iteration" or "Integrated in build" in work items to identify the release to which a work item belongs.
You could then create a suitable Team Query and export it to Excel to generate release notes.
I tend to use the Tf history command line tool to get information of changesets between two particular dates (or changesets). You can pass the /format:detailed parameter to get details such as changes involeed.
For example, the following will list all the changes between the 01/02/2014 & 24/04/2014 and write it to the history file.
tf history /noprompt * /recursive /v:D01/02/2014~D24/04/2014
/format:detailed > C:\history.txt
I like the TFS Changelog tool. Ready to use and easy to integrate.
TFS ChangeLog allows Team Foundation Server (TFS) users to extract information related to Changesets and associated WorkItems into XML format that is transformed into HTML.
All of these are nice tools, but there are a few things still missing I think.
These are technical notes (more like build / history notes) but actual release notes contain more customer friendly items
Not all of the information in TFS are wanted on the customer release notes (internally found bugs vs reported bugs)
As of now I use the TFS Community build manager to generate the technical build notes. It uses OpenXML and works fine for you build notes. It's even easy to create a custom word document for it.
For release notes we actually use the TFS User stories / tasks to be able to query on it. And for now, we create the document manually with the query results. We're looking into creating some tools that might do the following:
Run queries corresponding to the document paragrahs
We have a TFS template field indicating that the work item must be on the customer release notes (but we should change this to use 'special' iterations or so to eliminate the need of a custom field.
Automatically fill in the OpenXml placeholders in the document the same way as the build notes generator does.
Like the TFS Community Build Manager you could create a TFS Community Release Notes Manager that asks for query names and runs these queries to get to the required data.
The main question here is whether there are already tools that do this?
I know this is an old question, but perhaps you can use this task extension Generate Release Notes Build Task (for local TFS or as an extension to VisualStudio.com).
This extension is a build task you can use in build steps. This task generates a markdown release notes file based on a template passed into the tool. Here is an example of release notes output:
Release notes for build SampleSolution.Master
Build Number: 20160229.3 Build started: 29/02/16 15:47:58 Source
Branch: refs/heads/master
Associated work items
Task 60 [Assigned by: Bill ] Design WP8 client Associated change
sets/commits
ID bf9be94e61f71f87cb068353f58e860b982a2b4b Added a template ID
8c3f8f9817606e48f37f8e6d25b5a212230d7a86 Start of the project

Changeset Number into Version Info with hosted TFS

We're using Team Foundation Service instead of a local TFS.
Our solution was created on Visual Studio 2012.
My problem is now that we want all assemblies to have the same version number (this part is already solved by using a CommonAssemblyInfo.cs that is linked into all projects).
The issue I'm facing right now is that we need the tfs changeset number at the last digit of the assembly version (e.g. 1.0.0.4711 where 4711 is the changeset number).
I've found several examples, but none of them worked for me.
And yes, I especially searched here on stackoverflow a lot.
I also have to admit that I've never looked into the MSBuild scripts...
Can anyone please give me a hint on how to accomplish this?
Is it for example possible to use the MSBuild Extension Pack on Team Foundation Service (not local TFS) and if, how to do that?
As always, time is my worst enemy...
Note that from 2010 Tfs employs Windows workflow for building the package the workflow calls msbuild for compiling the projects only - while its possible to pass changeset this way to msbuild its rather more hops.
Following deals with your problem, however the linked solution is more complex that needed:
Can assembly version been automatically updated with each TFS 2010 Build?
This is one of best series of tutorials on the custom build activities, the author is on stack as well i believe, one specificly about versioning
http://www.ewaldhofman.nl/post/2010/05/13/Customize-Team-Build-2010-e28093-Part-5-Increase-AssemblyVersion.aspx
In short you need a custom activity to run before compilation on source files, find all CommonAssemblyInfo.cs files, feed this list to your custom activity, it modifies the values inside with passed value of full version number or only the changeset and optionaly check in the change (probably not since your changeset will be out of sync then).
You can also take a look at https://tfsbuildextensions.codeplex.com/ set of activities there is TfsVersion activity among them, at the very least it will provide examples.
Functionality need for this should be available through Team Explorer and source control - The Custom activity assemblies and build templates usually are located in folder in your team project root - the location of this folder is defined for build controller you can change this through team explorer build section.
Changeset is available from value BuildDetail.SourceGetVersion, not sure if this was fixed/changed in 2012 however there were 2 issues about this value in 2010
Its doesnt respect GetVersion override in default build template - you will manualy need to update if override is used
When running latest build (no override) it will get the last changeset number from tfs - depending on your branches this may not be the same as 'last' changeset for the branch of build. You will either have to live with this, provide overrides for each build or implement activity that checks branch history for last changeset value and overrides it again.
It should be noted that GetVersion should be able to accept any sourcespec version - changeset, date, label etc. I havent played around with this enough to provide more details to you.
Colin Dembovsky wrote a great overview of doing version embedding using the new pre-build script setting in TFS 2013 build definitions.
The Changeset number is easily accessible within the pre-build process in the environment variable TF_BUILD_SOURCEGETVERSION. I was able to use this to embed the Changeset value in our binaries using a script based on Dembovsky's work above. (I used Perl, not powershell, so you probably don't want to see it ;-)
This approach doesn't require any changes to the build workflow which makes it a big win for me.
I've used Wintellect's solution - MSBuild-only, no TFS magic needed. I also added to the auto-generated CSharp file:
[assembly:AssemblyInformationalVersion("$(BuildNumber)")]
So I get the TFS build number.

Determining which TFS process template is being used

How can one determining which TFS process template is being used? A few were installed and now I can't determine which one is being used by TFS.
TFS Team Project Manager on CodePlex is a free tool which will inspect all your team projects process templates (even if they're customized) and tell you which process template was most likely used to create that Team Project (and give you a % confidence in the match). You can even give it additional "source" process templates, such as your company custom process template, and it will tell you which projects were created with it.
In addition to Edward's approach:Another one, quick & dirty and without any capability to reveal any changes you might have performed, is the following:Right-Click on your TeamProject from within the Team Explorer and select "Team Project Process Guidance":
This should pop-up a webpage that will show you the Process Template that was used to create it.
If you have not modified the process templates (either the ones that are included with TFS, or any that you might have downloaded and installed) then you can export the process template as an XML file and compare against the original version.
(That link is really about modifying the process template, but steps 1-3 discuss how to export the current process template for a Team Project.)
Of course, even if you had modified the process templates slightly, using a diff tool may be able to yield results as to which process templates those were derived from.

Editing TFS2010 Build Definitions

We're currently setting up a number of builds in TFS2010 for our various projects/solutions.
We have a large number where the structure and paths, etc. are essentially the same, but one word may change (for example, using all Integration workspaces versus our Trunk workspaces).
In TFS2008, I would simply edit the XML directly and do some creative search and replace or some magic in textpad before saving the file. However, I do not see any immediate way of doing this in TFS2010 - so I'm stuck slogging through the build definition UI.
I know, in doing a SQL Trace, that all of this ends up as XML - so is there a way to directly access this XML for hand-editing vs. being forced to do all changes through the front-end?
Thanks!
Edit for additional clarity
I have the Power Tools installed, etc. and can clone my builds - but my editing options are still limited to the UI, so if I have a large number of workspace path changes I have to do them by hand (one at a time).
My goal is to be able to directly edit the XAML for a specific build definition so I can do a clone, open the XAML, and then do a search/replace in bulk.
Download and install the Team Foundation Server Power Tools. You can also get them through the Visual Studio Extension Gallery. After installing, you can right click on a Build Definition in Team Explorer and select the Clone Build Definition command (added by the Power Tools installation) to make a copy of an existing build definition. Then you can tweak it appropriately for another branch, etc.
The following tool (VS Addin) will satisfy your requirement>
Community TFS Build Manager
http://visualstudiogallery.msdn.microsoft.com/16bafc63-0f20-4cc3-8b67-4e25d150102c
The build definitions are all .xaml files now - they're WF4 workflows, and they're XML files.
Jim Lamb is right. The build templates are .xaml files now. The definitions are accessed through web services.
I'm about to experiment with a quick HTML form posting to /tfs/_tfs_resources/Build/V3.0/BuildService.asmx/QueryBuildDefinitionsByUri. I noticed when I clicked the build definition in Team Explorer that it has an associated URI: vstfs:///Build/Definition/2. Stay tuned.

Resources