stephencelis/ghi — pull request #155 by LFDM (2014-02-22 23:25:57+00:00)
Title: Experimental: Events and issues

Github's API also exposes events for issues. http://developer.github.com/v3/issues/events/

This PR exposes them inline with comments of an issue. As usual, please take a look at the various example issues in the test repo (`ghi -- LFDM/ghi_list`)

Some notes:
- I left out some events for now: subscribed, unsubscribed and mentioned. These aren't even shown on github's webpage - it's debatable if they should be included or not
- I originally implemented this for a special reason: I like the cross-referencing of issues, but sadly the API doesn't register them, it's a website only feature for now it seems (already written to GitHub about it though)
- Paging is handled well. This is only meaningful in very rare cases where an issue has over 100 comments (check `ghi show 2639 -- rails/rails` for example). Comments and events are thrown in an array and sorted by their creation date then. The only problem is that we have no way of keeping the paging in sync without requesting either all comments or events all at once. As comments have a much heavier body, they are paged as usual, but the events get all drawn in at the first chance, no matter how many they are. They are synced with the paged comments then to be properly timelined. This adds a performance penalty, which I think is bearable because this is a very rare edge case. Even rails doesn't have that many issues with over 100 comments and for such big issues a little wait should be tolerable :)

It would be much cooler if issue cross-referencing would be possible too, but still - might be a nice addition.