This adds support for multiple projects per channel. For now, the first channel is the primary/default.
I've moved !setgithubproject -> !setgithubprojects and added !addgithubproject <channel> <project> as well as !deletegithubproject <channel> <project>.
!addgithubproject <channel> <project>
!deletegithubproject <channel> <project>
For auth, I've added !setauthforproject <project> <auth> (not sure if this should have 'github' somewhere in the command name?), as well as !setdefaultauth <auth> which will set a global auth default for anything without a specific auth set (very useful for me as I add many projects but all can use the same auth).
!setauthforproject <project> <auth>
To facilitate multiple repos with issues/prs, i've updated EasyLinks.pm to use the following:
If you just type issue 42 you will get the issue for the default project (the first one added to that channel). If there are other projects, you can do api issue 42 and it will search through all your projects for the first one that matches 'api' and use that one. If none are found to match, it reverts back to the default again. The same happens with !pr. This makes it so that with !pr you don't have to type the full project name.
api issue 42
I've also made !pr support authenticated requests using the same auth_for_project and auth_default parameters as everything else. This does replace the LWP::Simple requirement with LWP::UserAgent (updated in the makefile).
I'd love some comments and feedback. Thanks!
Allow multiple projects per channel. Currently the 'primary' is just …
…the first one set. Also allows pull request listings from private repos
Rename setgithubproject -> setgithubprojects, implemented setauthfor …
…and setdefaultauth as well as added tests for that.
added !addgithubproject functionality
Added !deletegithubproject functionality. Also fixed warning in PullR…
updated Makefile with LWP::UserAgent requirement, remove LWP::Simple
Excellent stuff - merged!
I'll look in to making use of GitHub's new hooks very soon, hopefully this afternoon.
I should be able to rip out most of Announce (all the polling crap), and add some code to automatically determine the external IP/hostname of the machine we're on, pick an ephemeral port at random and fire up a listener on it, then poke GitHub's new web hooks API to arrange for web hooks to hit us with those details; or, perhaps, require a specific port to be configured, so it can be allowed through the firewall.