I suggest you ...

provide a way to version-control build definitions

Currently, there is no way to revert back to an old version of a Build definition once you've made changes to it.

791 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Visual Studio ALM TeamVisual Studio ALM Team shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    30 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Kaushik PatelKaushik Patel commented  ·   ·  Flag as inappropriate

        People are keep changing build definition and sometimes it result in build failures. It is very difficult to identify who made changes and what changes made by him/her

      • Atul TrikhaAtul Trikha commented  ·   ·  Flag as inappropriate

        I got into the same issue where someone from the team modified the Build Definition, I tried to find all the available option but found none except ‘Xeam Build Definition Extension’ which is only supported VS 2012 onward and has some downsides, so finally to get the immediate work around I wrote a small app which returns the Last Modified By and Last Modified Date and the complete Build Definition details which you can compare with previous version to find what got changed.Below is the code snippet, hope that helps

        Imports Microsoft.TeamFoundation.Build.Client

        Private Const RootFolder As String = "C:\TFS Utility Reports\"

        ''' <summary>
        ''' To Get the Build Definition Details
        ''' </summary>
        ''' <param name="teamProjectName"></param>
        ''' <param name="buildDefinitionName"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Shared Function GetBuildDefinitionDetails(teamProjectName As String, buildDefinitionName As String) As String
        Dim buildDefinitionSummary As String = Nothing
        Dim buildDefinitionDetails As String = Nothing
        Dim reportPath As String = RootFolder & "Build Definitions\" & buildDefinitionName
        Dim buildDefinitionDetailsFileName As String = reportPath & "\" & buildDefinitionName & "_" & Date.Now.ToString(CultureInfo.CurrentCulture).Replace("/", String.Empty).Replace(":", String.Empty) & ".txt"
        Dim buildService = CType(TfsTeamProjectCollection.GetService(GetType(IBuildServer)), IBuildServer)
        Dim buildDefinition As IBuildDefinition = buildService.GetBuildDefinition(teamProjectName, buildDefinitionName)
        If buildDefinition IsNot Nothing Then
        GetAllBuildDefinitions(teamProjectName)
        buildDefinitionSummary = buildDefinition.ToString()
        UpdateFile(buildDefinitionSummary, buildDefinitionDetailsFileName, reportPath)
        If buildDefinition.Workspace IsNot Nothing Then
        buildDefinitionDetails = String.Format(CultureInfo.CurrentCulture, "Last Modified By: {0}, Last Modified Date: {1}",
        buildDefinition.Workspace.LastModifiedBy,
        buildDefinition.Workspace.LastModifiedDate)
        End If
        End If
        Return buildDefinitionDetails
        End Function

        ''' <summary>
        ''' Generate Log/Summary/Report
        ''' </summary>
        ''' <param name="lineToWrite"></param>
        ''' <param name="filePath"></param>
        ''' <param name="folderPath"></param>
        ''' <remarks></remarks>
        Private Shared Sub UpdateFile(ByVal lineToWrite As String, ByVal filePath As String, ByVal folderPath As String)
        Dim strFileName As String = String.Empty
        lineToWrite = lineToWrite.Trim()
        strFileName = filePath
        Dim di As IO.DirectoryInfo = New IO.DirectoryInfo(folderPath)
        If Not di.Exists Then
        di.Create()
        End If
        Dim streamWriter As New StreamWriter(strFileName, True, System.Text.Encoding.ASCII)
        Try
        Dim strOutput As String
        strOutput = lineToWrite.ToString
        streamWriter.WriteLine(strOutput)
        Catch ex As Exception
        Throw
        Finally
        streamWriter.Dispose()
        End Try
        End Sub

      • Glen AppletonGlen Appleton commented  ·   ·  Flag as inappropriate

        Please consider this as a high priority item in the next release as it is virtually the only area in TFS for which I cannot audit changes.

      • Reinhard KuhnReinhard Kuhn commented  ·   ·  Flag as inappropriate

        Still considering? Since 2011?
        Do you realize how painfully ironic it is to reside right in the middle of a powerfull versioning system and force the enterprise user, dealing with literally hundreds of build definitions, to maintain this important element in a fire-and-forget fashion flying blind without instruments?

        Seriously? Its not even hard to implement.

      • RavneetRavneet commented  ·   ·  Flag as inappropriate

        till data, we have no alternative/method or mechanism to track changes done in build definitions. I strongly agree with Mike G.

      • Mike GMike G commented  ·   ·  Flag as inappropriate

        Please Microsoft, at least provide an audit trail of the changes that happen in build definitions. It's too easy for someone to break a build definition without anyone else knowing that they made a change. Sure the XAML is tracked in source control, but that’s only half the story of a build.

        Seven people in my company have access to build settings/authoring. If one of them takes a peek inside some build definitions, and accidentally makes a change, and accidentally hits save, it won’t be until a build breaks that anyone notices. And then we are left with the mess of trying to find out what the settings were that got changed.

        If we had a log of who/when/which build definition was changed - that would be a simple start. Then if we could see before and after changes, that would be valuable too.

      • Jeff SchwandtJeff Schwandt commented  ·   ·  Flag as inappropriate

        @Michael.Peterson - You're thinking of the Build Template. That is a XAML file. The Build Definition is not exposed as a file.

      • DavidDavid commented  ·   ·  Flag as inappropriate

        I want to see changesets, who modified it, and its relations to other files.!

      • Sam SmithSam Smith commented  ·   ·  Flag as inappropriate

        This is definitely a feature our development group would use - especially after recently having build issues. We currently store our definitions in text files within the solution - not ideal at all.

      • Anonymous commented  ·   ·  Flag as inappropriate

        At least provide a simple history mechanism. Also check for concurrent editings and warn user when defintion was changed by someone else.

      • garygary commented  ·   ·  Flag as inappropriate

        Anything regarding to tfs build are versioning but except build definition. We really want this.

      ← Previous 1

      Feedback and Knowledge Base