Cobalt Edge

 
Filed under

GitHub

 

Pivotal Tracker GitHub Post-Receive Hook Now Smart About People

That title is a bit cryptic, but here's the deal.  In the past, the GitHub post receive hook for Pivotal Tracker (http://github.com/chris/tracker_github_hook) was configured using a single API key.  This meant all the comments it added to Tracker were as the person who corresponded to the API key - regardless of who actually made the commit to git.  On multi-person teams, that sucks, as you want the comment to be from the person making the git commit.  Well, that's fixed now.  The fix is backward compatible, so if you simply update your version, nothing will break.  

To take advantage of the new ability, you need to get the new version of the code, and then update your configuration file to associate the Pivotal Tracker API token of each person who may make a commit with their git email address.  To do so, add a new user_api_tokens value to the configuration file, listing each person (arbitrary name) and their API token and email address.  The email address needs to match that which is associated with their git/GitHub commits.  Here's an example:

user_api_tokens:
  chris:
    email: 'chris@example.com'
    tracker_api_token: deadbeef340e3bafa96f5b2cac6986ed
  zach:
    email: 'zach@example.com'
    tracker_api_token: badd00d27202feed12de3120903ea83a

Now what will happen is that anytime a commit comes into the post-recieve hook, it'll try to correlate the email of the author of the commit with an entry in user_api_tokens, and if found, it'll use that tracker_api_token to call the Pivotal API, and thus associate the comment in Tracker with the person whose API token it is.

For any email that isn't found, the default/top level tracker_api_token will be used (this can be the same as one of the user_api_tokens), so you still want to keep that one in there as your default API token.

Loading mentions Retweet
Filed under  //   GitHub   PivotalTracker  

Comments [0]