diff options
Diffstat (limited to 'zuul/driver/gerrit/gerritmodel.py')
-rw-r--r-- | zuul/driver/gerrit/gerritmodel.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/zuul/driver/gerrit/gerritmodel.py b/zuul/driver/gerrit/gerritmodel.py index e9043119f..b1ad85898 100644 --- a/zuul/driver/gerrit/gerritmodel.py +++ b/zuul/driver/gerrit/gerritmodel.py @@ -31,6 +31,7 @@ EMPTY_GIT_REF = '0' * 40 # git sha of all zeros, used during creates/deletes class GerritChange(Change): def __init__(self, project): super(GerritChange, self).__init__(project) + self.status = None self.approvals = [] def update(self, data, connection): @@ -45,7 +46,7 @@ class GerritChange(Change): if 'project' not in data: raise exceptions.ChangeNotFound(self.number, self.patchset) self.project = connection.source.getProject(data['project']) - self.id = data['id'] + self.commit_id = str(data['currentPatchSet']['revision']) self.branch = data['branch'] self.url = data['url'] urlparse = urllib.parse.urlparse(connection.baseurl) @@ -73,12 +74,12 @@ class GerritChange(Change): else: self.is_current_patchset = False self.files = files - + self.id = data['id'] self.is_merged = data.get('status', '') == 'MERGED' self.approvals = data['currentPatchSet'].get('approvals', []) self.open = data['open'] self.status = data['status'] - self.owner = data['owner'] + self.owner = data['owner'].get('username') self.message = data['commitMessage'] self.missing_labels = set() @@ -99,6 +100,7 @@ class GerritChange(Change): if self.patchset is None: self.patchset = str(current_revision['_number']) self.project = connection.source.getProject(data['project']) + self.commit_id = str(data['current_revision']) self.id = data['change_id'] self.branch = data['branch'] self.url = '%s/%s' % (baseurl, self.number) @@ -147,7 +149,7 @@ class GerritChange(Change): self.missing_labels.add(label_name) self.open = data['status'] == 'NEW' self.status = data['status'] - self.owner = data['owner'] + self.owner = data['owner'].get('username') self.message = current_revision['commit']['message'] |