Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Events to GitHub plugin #98

Open
AloisMahdal opened this issue May 24, 2016 · 3 comments
Open

Add Events to GitHub plugin #98

AloisMahdal opened this issue May 24, 2016 · 3 comments
Assignees

Comments

@AloisMahdal
Copy link
Contributor

GitHub plugin currently does not show events such as comments or Pull Request review comments. Please add this so that selected event types can be shown along with issues.

Relevant doc: https://developer.github.com/v3/activity/events/

@AloisMahdal
Copy link
Contributor Author

I have looked into this a bit, and unfortunately it's more complicated than I expected so had to give up for now. However, what I've found out about events in GitHub API:

  • https://github.com/AloisMahdal/events seems to be the right endpoint.
  • The endpoint does not support date range querying, so returned data would have to be filtered in the plugin. (Dates returned by GitHub API are ISO 8601 in UTC zero, eg. 2016-05-24T12:32:59Z.)
  • The list is limited to last 90 days/300 events, so they are not suitable for longer, eg. yearly reports.
  • There are currently 25 types of events; however, I believe 2-5 should suffice (Issue comment, Commit comment, PR Review comment, maybe fork and/or create...)

@mfrodl mfrodl self-assigned this Nov 14, 2016
@mfrodl
Copy link

mfrodl commented Nov 25, 2016

There is a way to find a user's events even beyond these limits. However, we must know (1) what kind of events we are looking for, and (2) where exactly to look for them.

For instance, this request will fetch all comments on issues (including pull requests) in the psss/did repository:

Pagination is fully supported (unlike with events), so one can e.g. find issue comments no. 101 by 200 (sorted by creation time):

Similarly, commit comments can be fetched by:

This should be pull request review comments (although it is empty for this particular repository):

I have not found a way to limit the search to a specific user. That entails transferring possibly much larger data volumes, especially in the case of big repositories with many active contributors. Whether this might lead to significant performance regressions, I dare not say.

In order to make the above work, did must know which repositories to look into. This could be defined in the config file, e.g.

[github]
type = github
url = https://api.github.com/
token = <token>
repos = psss/did, sosreport/sos, scikit-learn/scikit-learn

Such a solution would happen to resolve issue #86 too.

Any thoughts on this?

@AloisMahdal
Copy link
Contributor Author

Nice work!

Adding the repos = seems to me as way to go, even I kinda missed the filtering.

Regarding the performance, this is hard to say. Certainly some repos could have loads and loads of comments so the hit could be significant.

On the other hand issue/review comments are relevant (no less than eg. Bugzilla comments), and since to make this work user would have to set the repos= key, at least it won't take them by surprise and they have way to control it. Plus, there could be also another key to limit event types so that people could further optimize settings to their needs.

Seems worth trying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants