From 84112d3cdddfe11f8532b1923f8754fa5ad72750 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 8 Jan 2018 13:16:47 -0800 Subject: Remove updateChange history from github driver This is not necessary because updateChange in this driver is no longer recursive. Change-Id: If0322a5938b17000e9ef4106fa4b0ffcbfa80c89 --- zuul/driver/github/githubconnection.py | 19 +++---------------- 1 file 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 -- cgit v1.2.1