zuul/zuul/driver/github
Paul Belanger 46ac8a6ad2 Improve retry handling for github driver
It seems that a 1 second sleep for our 'retry' logic for github events
might not be long enough. This was raising an abuse expection from
github:

  2019-06-13 15:55:34,132 ERROR zuul.GithubEventProcessor: [e: ad668d74-8df3-11e9-93ab-4ff1818b4f8e] Exception when handling event:
  Traceback (most recent call last):
    File "/usr/local/lib/python3.5/dist-packages/zuul/driver/github/githubconnection.py", line 265, in _process_event
      event = method()
    File "/usr/local/lib/python3.5/dist-packages/zuul/driver/github/githubconnection.py", line 427, in _event_status
      self.body['sha'], project, self.zuul_event_id)
    File "/usr/local/lib/python3.5/dist-packages/zuul/driver/github/githubconnection.py", line 1312, in getPullBySha
      repo = github.repository(owner, repository)
    File "/usr/local/lib/python3.5/dist-packages/github3/github.py", line 1981, in repository
      json = self._json(self._get(url), 200)
    File "/usr/local/lib/python3.5/dist-packages/github3/models.py", line 156, in _json
      raise exceptions.error_for(response)
  github3.exceptions.ForbiddenError: 403 You have triggered an abuse detection mechanism. Please wait a few minutes before you try again.

Read documentation, github _should_ return the 'Retry-After' headers but
to be safe, we now default to 60 seconds if missing. 60 seconds was a
best guess on a default value for github, based on manual testing.

Change-Id: Ie1da348291b48e9f68336b20510830351402a343
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-06-13 13:07:04 -07:00
..
__init__.py Status branch protection checking for github 2018-06-04 15:47:01 +02:00
githubconnection.py Improve retry handling for github driver 2019-06-13 13:07:04 -07:00
githubmodel.py Merge "github: add event filter debug" 2019-05-16 18:02:16 +00:00
githubreporter.py Annotate logs around reporting 2019-05-30 19:18:01 +02:00
githubsource.py Re-use the github PR object when fetching reviews 2019-02-15 07:49:13 +01:00
githubtrigger.py Use util functions to make lists of things 2017-05-30 14:53:46 -07:00