locked
Howto: User-mapping with SVN adapter RRS feed

  • Question

  • Hello,

    I want to migrate sourcecode from SVN to TFS2010 using the TFS Integration Platform.

    I am using the Codeplex Release from March 25th of the TFS Integration Platform.

    The SVN Adapter basically works. I can get the sourcecode from the SVN repository into TFS, including the full history (all revisions from SVN).

    However all the checkins into TFS are done as the user that is running the TFS Integration Platform Shell.

    I was wondering how I can configure a mapping of SVN users to TFS users.
    My SVN users are not in the ActiveDirectory or configured as Windows users.

    I just would like to specify an explicit mapping for each SVN user to an existing TFS user.

    On this forum I found several hints at using a <UserMappings> element or a <ValueMap name="UserMap"> or an <AliasMappings> ... but there seems no concrete example how to configure that with the SVN adapter. All my experiments are failing...

    Is this supposed to work with the SVN adapter?

    Could somebody give me a hint or a pointer how to configure this mapping?

    Thanks
    jonas

     


    Wednesday, August 3, 2011 7:43 AM

Answers

  • Sorry about that!  That's what happens when I suggest something that hasn't been tried.

    The following section was tried by the author the Subversion adapter over the weekend (since he suspected by response might not work) and it worked for him, so give this a try:

     <UserIdentityMappings EnableValidation="false">
          <UserIdentityLookupAddins />
          <DisplayNameMappings DirectionOfMapping="LeftToRight">
            <DisplayNameMapping Left="svnuser1" Right="domain\user1" MappingRule="SimpleReplacement" />
            <DisplayNameMapping Left="svnuser2" Right="domain\user2" MappingRule="SimpleReplacement" />
          </DisplayNameMappings>
    </UserIdentityMappings>

    Monday, August 8, 2011 2:11 PM
    Moderator

All replies

  • I believe you should be able to get this working with the SVN adapter, though I've never tried it (and it would probably take me longer to set up an environment to try it than it would for you to try it).   Since you would just like to specify an explicit mapping for each SVN user to an existing TFS user, I believe that all you need to do is add a UserIdentityMapping section to your migration session's XML, like the following (but of course with many more AliasMappings with your user names):

    <UserIdentityMappings EnableValidation="false">  
      <AliasMappings DirectionOfMapping="LeftToRight">  
        <AliasMapping Left="svnuser1" Right="mydomain\tfsuser1" MappingRule="SimpleReplacement" />
        <AliasMapping Left="johnqsmith" Right="mydomain\johnqsmith" MappingRule="SimpleReplacement" />
      </AliasMappings>  
    </UserIdentityMappings>

    This goes inside the <SessionGroup> element in the XML configuration (don't put it inside any other sub-elements).

    FYI, there's a blog post at http://blogs.msdn.com/b/willy-peter_schaub/archive/2010/04/10/tfs-integration-platform-what-is-the-lookup-service-q-a-27.aspx that goes into great detail about all of the options there are for user mapping and look up, but since you simply want explicit 1-1 conversion and are presumably enter the explicitly mapping data for each user, you should be able to use the simple setting shown above and not need to configure the "TFS Active Directory User Id Lookup Service Addin" described in the blog post and the example config it uses.

    Sorry for the delayed response - I wanted to verify (and have now done so) that the Subversion adadter source code does get the username for each Subversion changeset and save that in the intermediate database used by the TFS Integration Platform.   This should be used by the UserIdentity translation service in the platform to map to a Windows domain\alias from the mappings and that will be used by the TFS adapter when checking into TFS.

    Good luck, Bill

    Friday, August 5, 2011 6:19 PM
    Moderator
  • Thanks for your answer.

    However the proposed solution does not seem to work for me.

    I included the <AliasMappings> as you suggested.

    The migration then works fine in the sense that the sources are checked into my target TFS project. But all changesets are still by the user that is running the TFS Integration Platform Shell, even though this user is not even listed in my <AliasMappings>. (The changeset comment shows the original SVN user, so I could verify that the name in the mapping is written correctly...)

    I also found this thread, where it is reported that <AliasMapping> is not working:
    http://social.msdn.microsoft.com/Forums/en-US/tfsintegration/thread/59f1b742-2595-4d90-ad59-44be7e914d13/

    What do you suggest as a next step fro me to try?
    Is there some log to see if the Mapping is really attempted?
    Actually I would like to avoid the setup of the "TFS Active Directory User Id Lookup Service Addin" if possible ...

    Thanks
    jonas


    Saturday, August 6, 2011 7:14 AM
  • Sorry about that!  That's what happens when I suggest something that hasn't been tried.

    The following section was tried by the author the Subversion adapter over the weekend (since he suspected by response might not work) and it worked for him, so give this a try:

     <UserIdentityMappings EnableValidation="false">
          <UserIdentityLookupAddins />
          <DisplayNameMappings DirectionOfMapping="LeftToRight">
            <DisplayNameMapping Left="svnuser1" Right="domain\user1" MappingRule="SimpleReplacement" />
            <DisplayNameMapping Left="svnuser2" Right="domain\user2" MappingRule="SimpleReplacement" />
          </DisplayNameMappings>
    </UserIdentityMappings>

    Monday, August 8, 2011 2:11 PM
    Moderator
  • Thanks! This worked and solved my problem.

    I cross-posted the solution over at StackOverflow:

    http://stackoverflow.com/questions/6939243/tfs-integration-platform-how-to-map-users-with-the-svn-adapter


    Monday, August 8, 2011 10:09 PM
  • I tried plugging in the same thing. As the xml has a section for <UserIdentityMappings already I just replaced the mapping information like the example above but xml keeps giving me a syntax error. on this line <DisplayNameMappings DirectionOfMapping="LeftToRight">
     saying text is not allowed here. Also it seems that there is an addin on the TFS side of the mapping that would seem to try and auto map the users for me can anyone tell me more about that or how to use it? If it attempts to match the SVN ID with an account on the network automagically then that is all I need my account names are the same on both sides. Thanks.
    Wednesday, September 14, 2011 2:14 PM