From 88208ffa0d9fe86206ee54af17be278014c877d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C5=91d=20Ill=C3=A9s?= Date: Thu, 28 Sep 2023 13:51:44 +0200 Subject: [PATCH] [check-release-approval] Fix distributed leadership handling Teams with distributed leadership type have release liaisons listed in governance repository's projects.yaml file instead of a single PTL. This was not handled in the check_approval.py script so far. Fixing this by synchronizing the script with releases repository's tool/check_approval.py script's relevant part. Change-Id: I2433113e1168b10ba03831b30b82e46f3ec1c72f --- .../check-release-approval/files/check_approval.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/roles/check-release-approval/files/check_approval.py b/roles/check-release-approval/files/check_approval.py index fdb0ae093e..c7e1174c79 100755 --- a/roles/check-release-approval/files/check_approval.py +++ b/roles/check-release-approval/files/check_approval.py @@ -125,9 +125,19 @@ class GerritChange(object): approved = False break - # Fetch PTL and release liaisons + # Fetch release liaisons from data/release_liaisons.yaml liaisons = get_liaisons(self.workspace, team) - # Some teams may be PTL-less, so don't assume we have PTL info + + # Some teams follow the "distributed project lead" governance + # model so they are PTL-less but they have release liaisons + # defined. Fetch those liaisons. + if govteam.get('leadership_type') == 'distributed': + distributed_release_liaisons = govteam['liaisons']['release'] + for liaison in distributed_release_liaisons: + liaisons.append(liaison['email']) + + # Fetch PTL's email address (note: some teams may be PTL-less, + # so don't assume we have PTL info) if 'email' in govteam.get('ptl', {}): liaisons.append(govteam['ptl']['email']) LOG.debug('%s needs %s' % (deliv_file, liaisons))