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

Questions about the way of handling webhook event #244

Closed
MichaelTsengLZ opened this issue Jul 13, 2017 · 2 comments
Closed

Questions about the way of handling webhook event #244

MichaelTsengLZ opened this issue Jul 13, 2017 · 2 comments

Comments

@MichaelTsengLZ
Copy link
Contributor

Since I'm making some changes, I'm confused by the code which handles webhook event. For me, cla.check() is able to handle a webhook event. The function handleWebhook() first get commits(but don't use the commits) and then call cla.check(). I feel it's really redundant. Could anyone give me some guidance?

@thojansen
Copy link
Contributor

@KharitonOff would be the right one to help out here 😃

@KharitonOff
Copy link
Contributor

The main reason of getting commits first and calling cla.check() afterwards is the problem with GitHub API we faced lately: sometimes the PR API (https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request) didn't respond with appropriate data straight after the PR was created, it took a bit of time until the API responded as expected.

So, in order to handle this latency I added this api-call before check() and the timeout function for the case the GitHub API response has no data yet.

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

3 participants