TFS 2010 Integration and Gated Check-in builds

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

TFS 2010 Integration and Gated Check-in builds

Postby rayman2k1 » Fri Feb 21, 2014 2:45 am

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
rayman2k1
 
Posts: 2
Joined: Fri Feb 21, 2014 2:24 am

Postby rayman2k1 » Fri Feb 21, 2014 3:19 pm

Well, it looks like the CommandLineHooks format is easy enough for me to follow. Here is what is working for TFS 2010:

Code: Select all
<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
rayman2k1
 
Posts: 2
Joined: Fri Feb 21, 2014 2:24 am

Postby james.billings » Mon Feb 24, 2014 1:27 pm

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.
james.billings
 
Posts: 1120
Joined: Wed Jun 16, 2010 11:10 am
Location: Red Gate


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 0 guests