From 0abb7bacfe545893d88b3e6140874b7f7276bb67 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Thu, 20 Aug 2020 13:01:49 +0200 Subject: [PATCH] Annotate getBranch with event id This is not yet annotated so those requests cannot be tracked by the event id. Change-Id: I22bf3cc03927efe3ca05374843e2495148ed6034 --- zuul/driver/github/githubconnection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py index 6f4d1f4fe1..135db15acf 100644 --- a/zuul/driver/github/githubconnection.py +++ b/zuul/driver/github/githubconnection.py @@ -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