diff options
author | Simon Westphahl <simon.westphahl@bmw.de> | 2021-04-09 15:16:29 +0200 |
---|---|---|
committer | Simon Westphahl <simon.westphahl@bmw.de> | 2021-09-16 10:49:17 +0200 |
commit | 961eb5eafc538a362e041784405515a661b826b6 (patch) | |
tree | 8b4ff9987d3bf90994c3baeb5f70f9b696778d04 /zuul/driver/gerrit/gerritsource.py | |
parent | eb6cef65d82fe51794d62c8778c5c18ad5f2cb6f (diff) | |
download | zuul-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.py | 7 |
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, |