summaryrefslogtreecommitdiff
path: root/zuul/driver/gerrit/gerritsource.py
diff options
context:
space:
mode:
authorSimon Westphahl <simon.westphahl@bmw.de>2021-04-09 15:16:29 +0200
committerSimon Westphahl <simon.westphahl@bmw.de>2021-09-16 10:49:17 +0200
commit961eb5eafc538a362e041784405515a661b826b6 (patch)
tree8b4ff9987d3bf90994c3baeb5f70f9b696778d04 /zuul/driver/gerrit/gerritsource.py
parenteb6cef65d82fe51794d62c8778c5c18ad5f2cb6f (diff)
downloadzuul-961eb5eafc538a362e041784405515a661b826b6.tar.gz
Cache Gerrit refs in Zookeeper
The Gerrit change cache is no longer nested (previously by change number and patchset) and will use the flat cache structure provided by the Zookeeper change cache. Change-Id: I3fa7e8f2b865765d8f6c8fee35c1ad16b70eb45b
Diffstat (limited to 'zuul/driver/gerrit/gerritsource.py')
-rw-r--r--zuul/driver/gerrit/gerritsource.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/zuul/driver/gerrit/gerritsource.py b/zuul/driver/gerrit/gerritsource.py
index 7c18ef871..d9ee93219 100644
--- a/zuul/driver/gerrit/gerritsource.py
+++ b/zuul/driver/gerrit/gerritsource.py
@@ -113,9 +113,7 @@ class GerritSource(BaseSource):
return changes
def getCachedChanges(self):
- for x in list(self.connection._change_cache.values()):
- for y in list(x.values()):
- yield y
+ yield from self.connection._change_cache
def getProject(self, name):
p = self.connection.getProject(name)
@@ -157,6 +155,9 @@ class GerritSource(BaseSource):
partial = str(change).zfill(2)[-2:]
return "refs/changes/%s/%s/.*" % (partial, change)
+ def setChangeAttributes(self, change, **attrs):
+ return self.connection.updateChangeAttributes(change, **attrs)
+
approval = vs.Schema({'username': str,
'email': str,