tenex / opensourcecontributors

Find all contributions for a user through the GitHub Archive
91 stars 11 forks source link

Distinguish between issues and pull requests #83

Closed dnicolson closed 6 years ago

dnicolson commented 8 years ago

Currently both issues and pull request are referred to as issues in the events tab, but link to either issues or pull requests.

hut8 commented 8 years ago

Interesting. Issues and Pull Requests are in the same namespace (as you probably know). For whatever reason, the API seems to label them both as issues. For example I made a comment yesterday: rails-api/active_model_serializers/pull/1426#issuecomment-221940036 and in the GitHub API firehose, that event was labeled as an IssueCommentEvent. That does seem like a bug to me, but in the GitHub API.

joshjordan commented 8 years ago

For most issue-type objects in the Github API, there is a pull_request key in the object if it is a pull request (see https://developer.github.com/v3/issues/ ). IssueCommentEvents include the issue object - is the pull_request key included here?

hut8 commented 8 years ago
curl -L http://data.githubarchive.org/2016-05-28-1.json.gz | zcat | grep IssueCommentEvent | grep pulls | head -n5 | jq .

Indeed it is!