yakshaveinc / tasks

distributed roadmap
The Unlicense
1 stars 0 forks source link

Asynchronous GitHub checks API #22

Open abitrolly opened 6 years ago

abitrolly commented 6 years ago

Problem. I want to use GitHub Check API to check repository PR commit by a worker deployed on my machine. The worker can not be 100% online and it will miss webhooks events from GitHub. But GitHub provides events polling API, so maybe it can be used to query the event.

Research. I just pushed an update to PR in fedora-packages just before this comment https://github.com/fedora-infra/fedora-packages/pull/383#issuecomment-405428925 and there is no check event in public repository event stream https://api.github.com/repos/fedora-infra/fedora-packages/issues/events (and no PR update event either).

✗ curl -s https://api.github.com/repos/fedora-infra/fedora-packages/issues/events | grep \"event\"
    "event": "head_ref_deleted",
    "event": "closed",
    "event": "merged",
    "event": "closed",
    "event": "head_ref_deleted",
    "event": "head_ref_deleted",
    "event": "closed",
...
abitrolly commented 6 years ago

Repository feed is more interesting than issue feed:

✗curl -s https://api.github.com/repos/fedora-infra/fedora-packages/events | grep -E 'Event\"'  
    "type": "IssueCommentEvent",
    "type": "IssueCommentEvent",
    "type": "WatchEvent",
    "type": "IssuesEvent",
    "type": "DeleteEvent",
    "type": "PushEvent",
    "type": "PushEvent",
    "type": "PullRequestEvent",
    "type": "IssueCommentEvent",
    "type": "PullRequestEvent",
    "type": "IssueCommentEvent",
    "type": "PullRequestEvent",
    "type": "PullRequestEvent",
...