diff options
Diffstat (limited to 'zuul/driver/github')
-rw-r--r-- | zuul/driver/github/githubconnection.py | 8 | ||||
-rw-r--r-- | zuul/driver/github/githubsource.py | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py index 1957cc247..a7aefe0cd 100644 --- a/zuul/driver/github/githubconnection.py +++ b/zuul/driver/github/githubconnection.py @@ -646,9 +646,12 @@ class GithubConnection(BaseConnection): return self._github def maintainCache(self, relevant): + remove = set() for key, change in self._change_cache.items(): if change not in relevant: - del self._change_cache[key] + remove.add(key) + for key in remove: + del self._change_cache[key] def getChange(self, event, refresh=False): """Get the change representing an event.""" @@ -661,7 +664,6 @@ class GithubConnection(BaseConnection): change.uris = [ '%s/%s/pull/%s' % (self.server, project, change.number), ] - change.updated_at = self._ghTimestampToDate(event.updated_at) change.source_event = event change.is_current_patchset = (change.pr.get('head').get('sha') == event.patch_number) @@ -789,6 +791,8 @@ class GithubConnection(BaseConnection): change.labels = change.pr.get('labels') # ensure message is at least an empty string change.message = change.pr.get('body') or '' + change.updated_at = self._ghTimestampToDate( + change.pr.get('updated_at')) if history is None: history = [] diff --git a/zuul/driver/github/githubsource.py b/zuul/driver/github/githubsource.py index 9834727d7..33f8f7cae 100644 --- a/zuul/driver/github/githubsource.py +++ b/zuul/driver/github/githubsource.py @@ -46,6 +46,8 @@ class GithubSource(BaseSource): if not change.number: # Not a pull request, considering merged. return True + # We don't need to perform another query because the API call + # to perform the merge will ensure this is updated. return change.is_merged def canMerge(self, change, allow_needs): |