Options

TFS 2010 Integration and Gated Check-in builds

rayman2k1rayman2k1 Posts: 3
Hello,

I have seen this question asked a couple of times, but never satisfactorily answered.

Is it possible (from the UI) to link Red Gate Source Control to a Source Control path in Team Foundation Server where a Gated Check-in build is deployed?

As far as I can tell, it is not. When I try to establish the link, I get the message:
System.Web.Services.Protocols.SoapException: Your check-in could not be completed because it affects the following gated build definitions...

Has any progress been made in allowing for this to be bypassed from the UI? I understand that it may be possible to do this using the command-line (i.e. setting Source Control: Custom, and creating a hook file for a tf command). However, this route really is really not ideal. Furthermore, I do not see implementing this this being more challenging than a feature that SC3 already has, which is to ignore check-in policies (as described here)

If anyone has an answer (or a good hook file) please let me know.

Thank you

Comments

  • Options
    Well, it looks like the CommandLineHooks format is easy enough for me to follow. Here is what is working for TFS 2010:
    <HooksConfig version="1" type="HooksConfig">
      <!-- The name of the config file that will be displayed in the SQL Source Control user interface -->
      <Name>Team Foundation Server</Name>
      <Commands type="Commands" version="2">
        <element>
          <key type="string">GetLatest</key>
          <!-- Updates the local working folder with latest version in source control. -->
          <!-- Valid macros: ($ScriptsFolder) ($Message) -->
          <value version="1" type="GenericHookCommand">
            <CommandLine>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" get ($ScriptsFolder) /recursive /noprompt</CommandLine>
            <Verify>exitCode == 0</Verify>
          </value>
        </element>
        <element>
          <key type="string">Add</key>
          <!-- Adds new files to the local working copy. Changes can then be committed to source control using the Commit command. -->
          <!-- Valid macros: ($ScriptsFolder) ($Message) ($Files) ($Folders) -->
          <value version="1" type="GenericHookCommand">
            <CommandLine>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" add ($Folders) ($Files) /recursive /noprompt</CommandLine>
            <Verify>exitCode == 0</Verify>
          </value>
        </element>
        <element>
          <key type="string">Edit</key>
          <!-- Makes the local working copy of the file(s) available for editing. Changes can then be committed to source control using the Commit command. -->
          <!-- Valid macros: ($ScriptsFolder) ($Message) ($Files) ($Folders) -->
          <value version="1" type="GenericHookCommand">
            <CommandLine>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" checkout ($Files) ($Folders) /noprompt</CommandLine>
            <Verify>exitCode == 0</Verify>
          </value>
        </element>
        <element>
          <key type="string">Delete</key>
          <!-- Deletes the file(s) from the local working copy. Changes can then be committed to source control using the Commit command. -->
          <!-- Valid macros: ($ScriptsFolder) ($Message) ($Files) ($Folders) -->
          <value version="1" type="GenericHookCommand">
            <CommandLine>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" delete ($Files) ($Folders) /noprompt</CommandLine>
            <Verify>exitCode == 0</Verify>
          </value>
        </element>
        <element>
          <key type="string">Commit</key>
          <!-- Commits all changes in the local working folder to source control. -->
          <!-- Valid macros: ($ScriptsFolder) ($Message) -->
          <value version="1" type="GenericHookCommand">
            <CommandLine>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" checkin ($ScriptsFolder) /comment:"($Message)" /bypass /override:"Checked in from Red Gate" /recursive /noprompt</CommandLine>
            <Verify>exitCode == 0</Verify>
          </value>
        </element>
        <element>
          <key type="string">Revert</key>
          <!-- Undoes changes if an error occurs during a commit -->
          <!-- Valid macros: ($ScriptsFolder) -->
          <value version="1" type="GenericHookCommand">
            <CommandLine>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" undo ($ScriptsFolder) /noprompt</CommandLine>
            <Verify>exitCode == 0</Verify>
          </value>
        </element>
      </Commands>
    </HooksConfig>
    


    Cheers,

    Reza
  • Options
    Good news if you've managed to get around the issue with a commandlinehooks file.

    The specific feature suggestion you ideally need is logged here - please do vote and comment there, as the more popular it is, the more likely it is that the team will be able to dedicate time to implementing it.
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.