LLNL / scraper

Python library for getting metadata from source code hosting tools
MIT License
49 stars 23 forks source link

adding token support for bitbucket, adding create/mod date for bitbucket #50

Closed leebrian closed 4 years ago

leebrian commented 4 years ago

We recently had a group start using bitbucket so I took a look at bitbucket support and made two changes.

  1. Added support for token instead of userid and password. I'm not comfortable storing userid and password in config files, or setting it in environment variables. This is kind of a hack as the stashy client doesn't directly allow creating sessions with tokens, so I had to set the internal variable directly and this might break in future versions. So I +1 https://github.com/LLNL/scraper/issues/43 to switch over to the atlassian new package, although I couldn't easily see how to use a token in that package either.
  2. Previously date was always null, so I added calls to the repo to check commit history for all the commits and set the created and last modified. This ends up being null if it's an empty repository with no commits. This has a performance hit because it makes additional calls for each repo, but it was pretty fast as the calls are small.
IanLee1521 commented 4 years ago

This looks great, thanks!