summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2018-01-08 13:16:47 -0800
committerJames E. Blair <jeblair@redhat.com>2018-01-16 12:44:26 -0800
commit84112d3cdddfe11f8532b1923f8754fa5ad72750 (patch)
treef66ac465b9dc34e5a574abca6af78501227cffd1
parentc84736eae48d26165e89ab86a567e3021d607598 (diff)
downloadzuul-84112d3cdddfe11f8532b1923f8754fa5ad72750.tar.gz
Remove updateChange history from github driver
This is not necessary because updateChange in this driver is no longer recursive. Change-Id: If0322a5938b17000e9ef4106fa4b0ffcbfa80c89
-rw-r--r--zuul/driver/github/githubconnection.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py
index a7aefe0cd..b766c6f55 100644
--- a/zuul/driver/github/githubconnection.py
+++ b/zuul/driver/github/githubconnection.py
@@ -684,8 +684,7 @@ class GithubConnection(BaseConnection):
change.files = self.getPushedFileNames(event)
return change
- def _getChange(self, project, number, patchset=None, refresh=False,
- history=None):
+ def _getChange(self, project, number, patchset=None, refresh=False):
key = (project.name, number, patchset)
change = self._change_cache.get(key)
if change and not refresh:
@@ -697,7 +696,7 @@ class GithubConnection(BaseConnection):
change.patchset = patchset
self._change_cache[key] = change
try:
- self._updateChange(change, history)
+ self._updateChange(change)
except Exception:
if key in self._change_cache:
del self._change_cache[key]
@@ -769,13 +768,7 @@ class GithubConnection(BaseConnection):
return changes
- def _updateChange(self, change, history=None):
- # If this change is already in the history, we have a cyclic
- # dependency loop and we do not need to update again, since it
- # was done in a previous frame.
- if history and (change.project.name, change.number) in history:
- return change
-
+ def _updateChange(self, change):
self.log.info("Updating %s" % (change,))
change.pr = self.getPull(change.project.name, change.number)
change.ref = "refs/pull/%s/head" % change.number
@@ -794,12 +787,6 @@ class GithubConnection(BaseConnection):
change.updated_at = self._ghTimestampToDate(
change.pr.get('updated_at'))
- if history is None:
- history = []
- else:
- history = history[:]
- history.append((change.project.name, change.number))
-
self.sched.onChangeUpdated(change)
return change