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

Inconsistent fetching of commits #158

Open
3 of 4 tasks
martindekov opened this issue Jul 25, 2020 · 4 comments
Open
3 of 4 tasks

Inconsistent fetching of commits #158

martindekov opened this issue Jul 25, 2020 · 4 comments

Comments

@martindekov
Copy link
Sponsor Contributor

martindekov commented Jul 25, 2020

Inconsistent error:

exit status 1
time="2020-07-24T10:05:39Z" level=fatal msg="Error getting commits for PR 44\nGET https://api.github.com/repos/martindekov/push2/pulls/44/commits: 401 Bad credentials []"

This error is here:

log.Fatalf("Error getting commits for PR %d\n%s", req.PullRequest.Number, err.Error())

And the function is:

func fetchPullRequestCommits(req types.PullRequestOuter, client *github.Client) ([]*github.RepositoryCommit, error) {

Things I went through while trying to make the error consistent and it didn't:

Expected Behaviour

Every request for the commits has the same behavior on error or success.

Current Behaviour

Requesting the commits in a PR is inconsistent and might fail.

Possible Solution

In this case we can re-try the request. Possibly if the problem is in the access token we can revisit how we request the token, or fix the error flow of the token.

Steps to Reproduce (for bugs)

  1. Run derek
  2. Start sending requests by opening PRs and adding commits with and without signature
  3. Check that sometimes this error is present and commits cannot be fetched leading to the dco label and checks not being applied properly

Context

This can potentially lead to inconsistency when checking for DCO as if the error is present and derek will fail to list the commits and recognize if there is unsigned one.

Your Environment

  • You're using the hosted Derek service

or

  • You host your own OpenFaaS cluster with Derek installed
  • Docker version docker version (e.g. Docker 17.0.05 ):
    N/A
  • Are you using Docker Swarm or Kubernetes (FaaS-netes)?
    N/A
  • Operating System and version (e.g. Linux, Windows, MacOS):
    N/A
@alexellis
Copy link
Owner

We didn't have this issue prior to merging the status change for the DCO and the change @Waterdrips made to use the new endpoint for installation tokens.

I would expect one of the above to be related to the regression, as Derek has never shown this error before - neither in local testing or deployed for users.

Can one of you raise a support issue with GitHub please?

https://support.github.com

@alexellis
Copy link
Owner

Check rate limits as per description https://docs.github.com/en/rest/reference/rate-limit#understanding-your-rate-limit-status since the DCO feature increases the number of API calls.

You have 5000 (up from 50) per hour for properly authenticated requests, this appears to be a misconfiguration? Are there new limits on how the access tokens can be used?

@martindekov
Copy link
Sponsor Contributor Author

You have 5000 (up from 50) per hour for properly authenticated requests, this appears to be a misconfiguration? Are there new limits on how the access tokens can be used?

I marked this ^ as not a problem, at least from my testing. We generate new token for every request which has those limits refreshed. I opened a ticket here: https://support.github.com/ticket/personal/0/796320

@martindekov
Copy link
Sponsor Contributor Author

martindekov commented Aug 23, 2020

martindekov/push2#48
image

Red is check_suite which is not supported event.

Can't seem to replicate the issue now with alexellis/derek:0.10.0 image

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