LDAP synchronization with Mercurial proves difficult. Help me figure out a good feature request for this.

At our company, we set the standard "username" attribute for our Mercurial users to be "Full Name <e-mail>" which, unfortunately, cannot be retrieved properly by TeamCity's LDAP configuration.  Although our LDAP does hold a user's full name and e-mail address, it does not have any one variable that matches a user's Mercurial "username."  Thus, we cannot get LDAP to syncronize with our TeamCity server correctly unless we do one of the following:

  • Force a new standard on everyone such that they set their .hgrc file's "username" attribute to match one of the LDAP fields.  This could be e-mail, username, or full name.
  • Just manually edit everyone's vcs root name or request that they input it themselves in order to set up their notifications properly.  AKA: Not even bother synchronizing.
  • Request a feature that allows regex use inside TeamCity's LDAP config file, thus allowing us to pull and format LDAP's attributes to match what we get from Mercurial.
  • Insert a new LDAP field that would match our .hgrc file's "username" format.
  • Request a feature that would make TeamCity's Mercurial plug-in use (and display) a user's unix name instead of the "username" set in their .hgrc file.

To be honest, I'm leaning toward the last bullet point.  We like keeping our current username format so that commit messages look nicer, but if it means TeamCity's front page is going to be full of long names that are all getting cut apart, it begins to look real ugly.  Matching unix name would be easiest for LDAP sync and would keep us from commiting any errors related to .hgrc's settings; which are local to each user, not centralized anywhere, and thus not a very good attribute for TeamCity to keep track of!

I'd love to hear what other folks here think and any other possible solutions available that don't require my learning java just to write a plug-in to make this work better.  

Comment actions Permalink

I have just started to implement LDAP sync and have hit a very similar scenario.  Possibly my forum-searching has been rubbish but I was surprised nobody else has had this problem for Mercurial or Git, since I believe "My Name <my@email.com>" is a pretty-much universal format.  I'd really like LDAP sync to set users' Hg/Git username fields to this format.  I don't really mind how, but having to change the directory seems messy so I'd opt for supporting regex in the attribute definitions of the ldap.config.properties file.  Apologies if there is in fact a way of doing this that I've missed!

P.S. do I get a reward for excavating a four-year-old thread? :D

Comment actions Permalink

Updated with what I'd like, which is slightly more complex than that issue (combine displayName and mail in a specific format: "Barack Obama <baz@whitehouse.gov>")


Please sign in to leave a comment.