Ask a questionAsk a question
 

AnswerCan i force developers to add comments at check-in ?

  • Friday, August 04, 2006 7:23 AMMarius Onofrei Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I need developers to add comments at check-in time - probably i will need a custom check-in policy (how do i do that ?). I know i can force developers to asociate work items at check-in but in our case it would be much easier if i could force them to add only comments !

    10x

Answers

All Replies

  • Friday, August 04, 2006 8:47 AMMartin WoodwardModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You are correct that you need a custom check-in policy - See this sample over at James Manning's Blog:-

    http://blogs.msdn.com/jmanning/archive/2006/01/21/515858.aspx

    Cheers,

    Martin.
  • Friday, August 04, 2006 9:45 AMMarius Onofrei Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    This really works - 10x a lot.
    A drawback i can see here is that i have to configure every workstation (okay i could build a setup & stuff) - but anyway it's too much work for too little :-P.

    Bye !
  • Friday, August 04, 2006 10:05 AMMartin WoodwardModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I know what you are saying, it would have been nice if this check-in policy was installed out the box...  At least it is possible :-)
  • Friday, August 11, 2006 1:15 AMStephen S at APS Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Martin,

    There seems to be many threads on this subject for which I am also seeking assistance, specifically adding the custom check-in policy to the Add Check-in Policy dialogue box. You are a regular responder to queries.

    The required steps appear to be:
    1) Create the Dll (subclassing PolicyBase or implementing the two interfaces) and deploying the Dll to each developer machine.
    2) Register the custom check-in policy Dll on each machine.
    3) Amend the Add Check-in Policy dialogue box to include the new custom check-in policy.
    4) Select the custom check-in policy from the dialogue for the Team Project.

    All the blog entries and threads deal sufficiently with steps 1 and 2 but not step 3. An MSDN Walkthrough points to downloading the Visual Studio SDK, which I have, and some thread entries talk of using the existing custom check-in policy example, which I have NOT found.

    Would you be able to confirm the required steps and provide some more specific enlightenment on how one adds the created and deployed custom policy to the Add Check-in Dialogue to be able to select it for the Team Project.

    Cheers,

    Stephen
  • Saturday, August 12, 2006 4:02 AMBuck HodgesMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    You don't need the SDK for steps 3 and 4.

    Here are the steps you need to set the checkin policy on the team project (condensed from http://msdn2.microsoft.com/en-us/library/ms181459.aspx).

    1. From Team Explorer, right-click your team project, click Team Project Settings, and then click Source Control.

      The Source Control Settings dialog box appears.

    2. Click the Check-in Policy tab and the click Add.

      The Add Check-in Policy dialog box appears.

    3. In the Check-in Policy list, select the policy type you want and then click OK.

    4. When you are satisfied with the settings for the check-in policies, click OK; the new check-in policy now displays with future check-ins.

    Buck

  • Monday, August 14, 2006 1:25 AMStephen S at APS Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Buck,

    Thanks for your reply. I suspect we are not talking about the same context. I wish to be able to add the created and registered custom check-in policy to the AddCheck-in Policy dialogue box so that it can be selectable for each of the Team Projects.

    The most relevant MSDN URL appears to be
    http://msdn2.microsoft.com/en-us/library/ms181281.aspx

    It includes the following which references the Visual Studio SDK which I have downloaded but can not easily find the relevant area in the SDK 2006.04.

    Creating Policy Plug-ins

    You can create custom policy plug-ins that appear in the Add Checkin Policy dialog box by using the extensibility provided in the Visual Studio Team Foundation Server SDK. The Visual Studio Team Foundation Server SDK is available for download at http://go.microsoft.com/fwlink/?linkid=68586 as a part of Visual Studio SDK. For more information on policy plug-ins, search the Visual Studio SDK Help after you have installed the SDK.


  • Monday, August 14, 2006 7:47 PMeraniopub Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    hello.

    i developed custom check-in policy using info fron James Manning's Blog.

    everything goes smooth and the code compiled, but i have few little questions:

    1.  you wrote: "Register the custom check-in policy Dll on each machine". where to register the dll?

         i put it in the GAC and it didnt recognize it in the "add check-in policy". maybe i shuld put it

         in the "E:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies"?

        (i'm out of the office right now so i will try it asap)

    2. i understand that i need to deploy this dll to each developer machine, and only in the server i need to  Select the custom check-in policy from the dialogue for the Team Project.

    is this correct?

     

    thanks in advance.

  • Tuesday, August 15, 2006 4:56 AMStephen S at APS Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    http://blogs.vertigosoftware.com/teamsystem/archive/2006/02.aspx

    The above URL is to another blog detailing with screen shots amongst other things creating, registering and selecting the custom check-in policy from the Add Check-in Policy dialogue.

    Registering is in the local registry and the blog includes the required registry location.

    The first two steps (creating the custom check-in policy and registering the Dll) are fairly well documented in blogs and books. It is the next step, getting the custom check-in policy name to be added to the Add Check-in Policy dialogue so that it can be selected for Team Projects that I am finding a black hole. This blog links to an MSDN entry

    http://msdn2.microsoft.com/en-us/library/ms181281.aspx

    which contains the following paragraph and the link to downloading the VSTF SDK which is where the trail of comprehensibility ends for me. If you discover where one finds the relevant part in the SDK and what one needs to specifically do, please add it to this thread so that there may be a sense of completion.

    Creating Policy Plug-ins

    You can create custom policy plug-ins that appear in the Add Checkin Policy dialog box by using the extensibility provided in the Visual Studio Team Foundation Server SDK. The Visual Studio Team Foundation Server SDK is available for download at http://go.microsoft.com/fwlink/?linkid=68586 as a part of Visual Studio SDK. For more information on policy plug-ins, search the Visual Studio SDK Help after you have installed the SDK.


  • Tuesday, August 15, 2006 11:31 PMeraniopub Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    ok i solve the problem and i want to share the steps involved:
    (some of them "copy & paste" from different blogs and artivles).
    -------------------------------------------------------------------------------------------

    1. build the custom checkin policy dll. (as described in here)

    2. 
    copy it to a path on thr local machine.
       for example, c:\CheckinPolicies\MyPolicy.dll
      (this dll shuld be in each developer machine, include the TFS.)

    3.add registry key to   HKLM\Software\Microsoft\VisualStudio\8.0TeamFoundation\SourceControl\Checkin Policies
    of type REG_SZ.
     The name should be the class of the policy, and the data is the absolute path to the .dll

    4. once you've done that, This MSDN article describes how to add the policy in the UI

    note: i created installation package for easy deployment to all machines, but i hope tha in the next TFS version MS will add the comment checkin policy as a build in policy.

  • Thursday, August 17, 2006 12:18 PMJames M ManningModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Once the DLL is properly registered and the policy class inside the DLL is public, it will appear when in the UI automatically for "Add Checkin Policy", as when that dialog comes up, we scan the list of registered policies.

    The most common problems I see with this are 1) not registering properly (eraniopub's reply with details is good) and 2) the policy class wasn't public.

  • Thursday, August 17, 2006 12:26 PMMarius Onofrei Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Glad this topic was of such use - actually about step 3 - the name of the key should be the name of the dll (without extension) and the value is the absolute path to the dll.

    The rest should go smooth - if you are interested i can post my solution (that was built after this thread); there's a setup project there too, so that you don't have to mess around with the registry.

    Best of luck !

     eraniopub wrote:

    ok i solve the problem and i want to share the steps involved:
    (some of them "copy & paste" from different blogs and artivles).
    -------------------------------------------------------------------------------------------

    1. build the custom checkin policy dll. (as described in here)

    2.
    copy it to a path on thr local machine.
    for example, c:\CheckinPolicies\MyPolicy.dll
    (this dll shuld be in each developer machine, include the TFS.)

    3.add registry key to HKLM\Software\Microsoft\VisualStudio\8.0TeamFoundation\SourceControl\Checkin Policies
    of type REG_SZ.
    The name should be the class of the policy, and the data is the absolute path to the .dll

    4. once you've done that, This MSDN article describes how to add the policy in the UI

    note: i created installation package for easy deployment to all machines, but i hope tha in the next TFS version MS will add the comment checkin policy as a build in policy.

  • Thursday, August 17, 2006 9:23 PMeraniopub Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    i will be glad if you post your solution,

    best regards,

    eraniopub.

  • Friday, August 18, 2006 8:35 AMMarius Onofrei Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals