Basecamp exposes a nice API to consumes its data, this project tries to wrap a HTTParty client around those endpoints and provides a CLI to allow exploring its data.
First things first, grab yourself an access key and access secret registering your own application on https://launchpad.37signals.com/integrations.
Same goes for Github, create an application on: https://github.com/settings/applications/new.
Copy the .env.example into .env and paste those there!
Second, either launch bundle install
locally ๐ท or if you like to keep things tidy use the docker setup:
lfigea@Leos-MacBook-Pro basecamp_playground % docker-compose run --rm explorer cli
Creating basecamp_playground_explorer_run ... done
"https://launchpad.37signals.com/authorization/new?client_id=********************&redirect_uri=https%3A%2F%2Fbke-test.herokuapp.com%2Ftoken&response_type=code&type=web_server"
Visit the link above, accept and type the code you received:
2b*****0
========== YOU HAVE ACCESS TO THE FOLLOWING ACCOUNTS ========
#3*****2 - Barkibu
The constant ACCOUNTS holds your accounts ready for play! Good hacking!
irb(main):001:0>
Now you have a irb session with an authenticated client for the account you selected ready to hack!
To have the interface served on port http://localhost:3000 just run:
docker-composer up
Pseudo-code
def lead_time_estimate(todo)
return unless todo.completed?
pr_comment = todo.detect &:mention_prs?
return unless pr_comment
pr = PR.fetch(pr_comment.pr_number)
work_started_comment = todo.detect &:work_started?
return unless work_started_comment
pr.find_release.created_at - work_started_comment.created_at
end
What this pseudo-code is bad at?
- Todos were not moved to in progress when work actually started... ๐คท๐ฝ Nothing I can do ...
- PR not mentioned on the Todo... ๐คท๐ฝ Nothing I can do ...
- Multiple todos on the same PR... We should group by PR and take the biggest lead_time
- Task is marked as complete before actually being part of a Release ๐ฝ๐ฟ