From a02a82305777f64e6f229280d1a5e52c3fc1c1ca Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Fri, 10 Apr 2020 14:32:02 +0200 Subject: [PATCH] [check-approval] Use committer instead of owner The check-release-approval job currently considers a change being approved if a release liaison is the change owner, or if a release liaison approves it in a subsequent vote. This means that if a release liaison pushes the original change (and is therefore the change owner), any patchset pushed above the original one will retain the owner and therefore the approval. Instead of the change owner, use the committer of the last revision. Change-Id: I2f7730626a8785b63f88fdf5d507fbd97717b8f3 --- roles/check-release-approval/files/check_approval.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/check-release-approval/files/check_approval.py b/roles/check-release-approval/files/check_approval.py index cb45306926..f38b7a07d3 100755 --- a/roles/check-release-approval/files/check_approval.py +++ b/roles/check-release-approval/files/check_approval.py @@ -87,10 +87,11 @@ class GerritChange(object): raw, raw.url, trimmed) raise - # Extract approvers from JSON data. Approvers include change owner + # Extract approvers from JSON data. Approvers include last committer # and anyone who voted Code-Review+1. NB: Gerrit does not fill # labels.CodeReview.all unless there is a vote already - self.approvers = [decoded['owner']['email']] + last_revision = decoded['revisions'][decoded['current_revision']] + self.approvers = [last_revision['uploader']['email']] if 'all' in decoded['labels']['Code-Review']: self.approvers.extend([ i['email']