Annotate getBranch with event id

This is not yet annotated so those requests cannot be tracked by the
event id.

Change-Id: I22bf3cc03927efe3ca05374843e2495148ed6034
This commit is contained in:
Tobias Henkel 2020-08-20 13:01:49 +02:00
parent 2d46288a25
commit 0abb7bacfe
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
1 changed files with 5 additions and 3 deletions

View File

@ -429,7 +429,8 @@ class GithubEventProcessor(object):
# unprotected branches, we might need to check whether the
# branch is now protected.
if hasattr(event, "branch") and event.branch:
b = self.connection.getBranch(project.name, event.branch)
b = self.connection.getBranch(
project.name, event.branch, zuul_event_id=event)
if b is not None:
branch_protected = b.get('protected')
self.connection.checkBranchCache(
@ -1549,8 +1550,9 @@ class GithubConnection(BaseConnection):
cache[project.name] = branches
return branches
def getBranch(self, project_name, branch):
github = self.getGithubClient(project_name)
def getBranch(self, project_name, branch, zuul_event_id=None):
github = self.getGithubClient(
project_name, zuul_event_id=zuul_event_id)
# Note that we directly use a web request here because if we use the
# github3.py api directly we need a repository object which needs