diff options
author | James E. Blair <jim@acmegating.com> | 2021-09-28 15:15:37 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2021-09-28 17:21:32 -0700 |
commit | 659ba07f63dcc79bbfe62788d951a004ea4582f8 (patch) | |
tree | 9a0a97ad7848c649e2dddf4d927dd967499c7247 /zuul/driver/gerrit/gerritconnection.py | |
parent | 29d0534696b3b541701b863bef626f7c804b90f2 (diff) | |
download | zuul-659ba07f63dcc79bbfe62788d951a004ea4582f8.tar.gz |
Include project name in gerrit branch cache
The structured cache data change updated the keys for the gerrit
branch cache, but it omitted the project from non-change items.
Gerrit change items omit the project because when we fetch gerrit
changes from the cache, we often only know the number. However,
all other types of items (branches, tags, etc) are project specific,
and so their cache keys must contain the branch name. Without it,
we may fetch the wrong change from the cache for timer pipelines.
The other drivers all require the project name for every change
type, including changes (since PR numbers are not unique), so they
were not affected by this copypasta error.
Change-Id: I399330cdf9880072580d3e70d97b63cb74d95a23
Diffstat (limited to 'zuul/driver/gerrit/gerritconnection.py')
-rw-r--r-- | zuul/driver/gerrit/gerritconnection.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zuul/driver/gerrit/gerritconnection.py b/zuul/driver/gerrit/gerritconnection.py index 6d5529975..ef0b9c39f 100644 --- a/zuul/driver/gerrit/gerritconnection.py +++ b/zuul/driver/gerrit/gerritconnection.py @@ -779,7 +779,7 @@ class GerritConnection(ZKChangeCacheMixin, BaseConnection): def _getTag(self, event): tag = event.ref[len('refs/tags/'):] - key = ChangeKey(self.connection_name, None, + key = ChangeKey(self.connection_name, event.project_name, 'Tag', tag, event.newrev) change = self._change_cache.get(key) if change: @@ -798,7 +798,7 @@ class GerritConnection(ZKChangeCacheMixin, BaseConnection): return change def _getBranch(self, event, branch, ref): - key = ChangeKey(self.connection_name, None, + key = ChangeKey(self.connection_name, event.project_name, 'Branch', branch, event.newrev) change = self._change_cache.get(key) if change: @@ -817,7 +817,7 @@ class GerritConnection(ZKChangeCacheMixin, BaseConnection): return change def _getRef(self, event): - key = ChangeKey(self.connection_name, None, + key = ChangeKey(self.connection_name, event.project_name, 'Ref', event.ref, event.newrev) change = self._change_cache.get(key) if change: |