Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location of changeset comments on a Team Foundation server?

One of my colleagues is working on a Continuous Integration build script that makes a new build every time a developer makes a checkin, and sends an email out to the development team when the build finishes. We want to take any comments associated with the checkin (the same comments you'd see by right-clicking on a project file and selecting View History) and include them in the email. However, we're not sure where in the back-end of TFS to point the script so it can retrieve those comments. Does anyone know where we should look?

like image 743
estanford Avatar asked Oct 24 '25 14:10

estanford


1 Answers

Are you using TFS API for that? If so, you simply do:

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("http://WhateverServerUrl");
IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));
VersionControlServer VsServer = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
IBuildDetail build = buildServer.GetAllBuildDetails(new Uri("http://WhateverBuildUrl"));

List<IChangesetSummary> associatedChangesets = InformationNodeConverters.GetAssociatedChangesets(build);

foreach (IChangesetSummary changeSetData in associatedChangesets)
{
    Changeset changeSet = VsServer.GetChangeset(changeSetData.ChangesetId);
    string x = changeSet.Comment;
} 

If you are trying to look it up in the DB, you can look at the changeset title:

USE tfs_warehouse
SELECT [ChangesetID]
      ,[ChangesetTitle]
  FROM [tfs_warehouse].[dbo].[DimChangeset]

From here add a where clause to either the id, date etc.

This is where that data is stored in TFS 2010.

In TFS 2008, you would use TfsWarehouse and look at dbo.ChangeSet Changset column.

like image 64
Mike Veigel Avatar answered Oct 26 '25 11:10

Mike Veigel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!