Gerrit: Add gerrit version check for HTTP review tag

Review tags were added in gerrit starting from 2.13

https://gerrit-review.googlesource.com/c/gerrit/+/75803

On gerrit repository https://gerrit.googlesource.com/gerrit/
"git tag --contains c70e8625963297c6cee06c2c33e01af82b63d331"
starts with tag 2.13 (no message in 2.13 release changelog)

Change-Id: I685ecd71186ddacfb71ed6bf2db254540fa2abb4
This commit is contained in:
Guillaume Chauvel 2021-02-10 23:43:53 +01:00
parent 8d48f1b3ae
commit 3974eaf987
1 changed files with 2 additions and 1 deletions

View File

@ -1126,7 +1126,8 @@ class GerritConnection(BaseConnection):
data['robot_comments'] = file_comments
else:
data['comments'] = file_comments
data['tag'] = 'autogenerated:zuul:%s' % (item.pipeline.name)
if self.version >= (2, 13, 0):
data['tag'] = 'autogenerated:zuul:%s' % (item.pipeline.name)
changeid = "%s~%s~%s" % (
urllib.parse.quote(str(change.project), safe=''),
urllib.parse.quote(str(change.branch), safe=''),