From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id CA7E7941AF7 for ; Fri, 10 Nov 2023 19:31:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=OSTsZrHSwZH2sAhuy80QYnwqN49ZeQA+3QSkYVseg6k=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1699644683; v=1; b=Di9Ys6wwsblksm4vUmPPRPAnyjbUp5StgOp4NMTvf8sqhL8SL3xT0Qal+CUROfr/bYlZ568E +W2tkj8z2KbCm/H1MOoHsSD9yX7yQNrqwqLX+DqaPNanKOrYfxF1ckEG3fI2jAchtCEuJbszj56 ngLi/eJPzhMF7VjpUokWWYdw= X-Received: by 127.0.0.2 with SMTP id Z6EZYY7687511xIJpr2IsDo9; Fri, 10 Nov 2023 11:31:23 -0800 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.37046.1699644683001619100 for ; Fri, 10 Nov 2023 11:31:23 -0800 X-Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAHQOC0026784; Fri, 10 Nov 2023 19:31:15 GMT X-Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3u9dx1hw1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 19:31:14 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AAJVE1T011040 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2023 19:31:14 GMT X-Received: from qc-i7.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Fri, 10 Nov 2023 11:31:10 -0800 From: "Leif Lindholm" To: CC: Michael D Kinney , Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen Subject: [edk2-devel] [PATCH v3 4/5] BaseTools/Scripts/GetMaintainer: Handle reviewer only case Date: Fri, 10 Nov 2023 19:30:52 +0000 Message-ID: <20231110193053.673595-5-quic_llindhol@quicinc.com> In-Reply-To: <20231110193053.673595-1-quic_llindhol@quicinc.com> References: <20231110193053.673595-1-quic_llindhol@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-ORIG-GUID: I4V1nS9g5X8_gn6GGqK6cf5hABgyrtjj X-Proofpoint-GUID: I4V1nS9g5X8_gn6GGqK6cf5hABgyrtjj Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: QNo5Z7mrgSwDLKWWeqp12PmSx7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Di9Ys6ww; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Michael D Kinney REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593 If a package only has reviewers and no maintainers, then also return the maintainers. In order to detect this case, get_maintainers() is updated to return maintainers, reviews, and lists separately instead of a single merged list. This also allows this module to be used by other scripts that need to distinguish between maintainers, reviewers, and lists. Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Cc: Leif Lindholm Signed-off-by: Michael D Kinney --- BaseTools/Scripts/GetMaintainer.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/BaseTools/Scripts/GetMaintainer.py b/BaseTools/Scripts/GetMaintainer.py index cb3aadbbefb1..1361fb6c0e30 100644 --- a/BaseTools/Scripts/GetMaintainer.py +++ b/BaseTools/Scripts/GetMaintainer.py @@ -76,6 +76,7 @@ def get_section_maintainers(path, section): """Returns a list with email addresses to any M: and R: entries matching the provided path in the provided section.""" maintainers = [] + reviewers = [] lists = [] nowarn_status = ['Supported', 'Maintained'] @@ -83,12 +84,18 @@ def get_section_maintainers(path, section): for status in section['status']: if status not in nowarn_status: print('WARNING: Maintained status for "%s" is \'%s\'!' % (path, status)) - for address in section['maintainer'], section['reviewer']: + for address in section['maintainer']: # Convert to list if necessary if isinstance(address, list): maintainers += address else: maintainers += [address] + for address in section['reviewer']: + # Convert to list if necessary + if isinstance(address, list): + reviewers += address + else: + reviewers += [address] for address in section['list']: # Convert to list if necessary if isinstance(address, list): @@ -96,16 +103,18 @@ def get_section_maintainers(path, section): else: lists += [address] - return {'maintainers': maintainers, 'lists': lists} + return {'maintainers': maintainers, 'reviewers': reviewers, 'lists': lists} def get_maintainers(path, sections, level=0): """For 'path', iterates over all sections, returning maintainers for matching ones.""" maintainers = [] + reviewers = [] lists = [] for section in sections: recipients = get_section_maintainers(path, section) maintainers += recipients['maintainers'] + reviewers += recipients['reviewers'] lists += recipients['lists'] if not maintainers: @@ -115,13 +124,14 @@ def get_maintainers(path, sections, level=0): if level == 0: recipients = get_maintainers('', sections, level=level + 1) maintainers += recipients['maintainers'] + reviewers += recipients['reviewers'] lists += recipients['lists'] else: print("No maintainers set for project.") if not maintainers: return None - return {'maintainers': maintainers, 'lists': lists} + return {'maintainers': maintainers, 'reviewers': reviewers, 'lists': lists} def parse_maintainers_line(line): """Parse one line of Maintainers.txt, returning any match group and its key.""" @@ -187,7 +197,7 @@ if __name__ == '__main__': for file in FILES: print(file) recipients = get_maintainers(file, SECTIONS) - ADDRESSES += recipients['maintainers'] + recipients['lists'] + ADDRESSES += recipients['maintainers'] + recipients['reviewers'] + recipients['lists'] for address in list(OrderedDict.fromkeys(ADDRESSES)): if '<' in address and '>' in address: -- 2.39.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111067): https://edk2.groups.io/g/devel/message/111067 Mute This Topic: https://groups.io/mt/102513772/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-