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 45334740041 for ; Fri, 10 Nov 2023 16:34:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nqVoW3jXnHq8XnhEsnU3A+UiUQy/tqRTTFfvRvInDOI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699634053; v=1; b=ENx75vYPbVPpihKOTzee8ib4MZrcsLRWPQZGVpKVdPuzJZKxtzJ49wn7JFwHwCx2ObSKoAo0 +YY6nYDkgyd26q18IXiaoPxpxJG8X+VkU8UNTjMrNwRGBEkmS+sf+hpchhmUPZlDfVajajppxHk waEWoNrIk+TytocPP+XKJGdc= X-Received: by 127.0.0.2 with SMTP id UyVRYY7687511xuiSAT9TOuI; Fri, 10 Nov 2023 08:34:13 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.31952.1699634053115020913 for ; Fri, 10 Nov 2023 08:34:13 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10890"; a="421297055" X-IronPort-AV: E=Sophos;i="6.03,291,1694761200"; d="scan'208";a="421297055" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2023 08:34:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10890"; a="798648756" X-IronPort-AV: E=Sophos;i="6.03,291,1694761200"; d="scan'208";a="798648756" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Nov 2023 08:34:12 -0800 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 10 Nov 2023 08:34:11 -0800 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 10 Nov 2023 08:34:11 -0800 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Fri, 10 Nov 2023 08:34:11 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Fri, 10 Nov 2023 08:34:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TZRbSqe0PI4iWCeMZkEv2tqwhDWvVY3zNFupFdRS8wJltGgBXivnJhZ1/Yr+RPZAkR24NrVTZFWV5ddseOpZHGg46bfUJsftc0hdkn8fTaYwoOajvtzt1nV6a4aYtm2vr+nkLph0aXFY1PerzmtGg/aCpf8VuKuh6k85KXKe83lvFKWn2jw7b/Mr036AYwiWlNIjOhAo1tL6ZwZQ+8279HGN7iog6efU+mLOu7dn1Ix7Lb/waFqI6UKHAP1FIG48DutNQskSeVLmeUydsbiaXcuvG/raq3D0SVHMH8hkWJgMfLtmZabNAI1F3eYWjthAFAML4hl2AoG+4oFWC3xr1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9fAma2SEFEh9gaCNisH01YISYwkjzNiI9Zrxd8ZRAwE=; b=FNNH8u5Q0TRcu5IRgAl64IoEBYoqAOHYSB5d8G2Usuoib4hUmQin09PVqa28mke0xKkPLGm+Iila00j1oMjz/rpNA58qIvaIcnpGNGqgeVpi+PSzk/L/Gs8yrwQNUGoQpD45FxRyEBHS8eTnLw9CJie2XgMl1hTew/vtZfkuyrYkfl/PDgzWxejj92VnjQUkb0OD7Fz3cU3oVB5eQlLPW6asapTPaJMw+V2v2mtiL+Ez3HUPIEYwUI4zWQWOYMjOFCYUf4bcdFETkLApCbT+/20EzfZyP+2KW6dRYflgAS/DaXNUppUAoHyGLCagMM4kTWEyuON5FdLIHjgYf46unQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by LV3PR11MB8603.namprd11.prod.outlook.com (2603:10b6:408:1b6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19; Fri, 10 Nov 2023 16:34:08 +0000 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::ac67:8c2e:235d:db4f]) by CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::ac67:8c2e:235d:db4f%4]) with mapi id 15.20.6977.018; Fri, 10 Nov 2023 16:34:08 +0000 From: "Michael D Kinney" To: "devel@edk2.groups.io" , "quic_llindhol@quicinc.com" CC: Rebecca Cran , "Gao, Liming" , "Feng, Bob C" , "Chen, Christine" , "Kinney, Michael D" Subject: Re: [edk2-devel] [edk2-stable202311][Patch 1/1] BaseTools/Scripts: Handle reviewer only case in GetMaintainer.py Thread-Topic: [edk2-devel] [edk2-stable202311][Patch 1/1] BaseTools/Scripts: Handle reviewer only case in GetMaintainer.py Thread-Index: AQHaEoS209SVxXw3jkOPI7Z0INDP/7BzghGAgAA/mkA= Date: Fri, 10 Nov 2023 16:34:08 +0000 Message-ID: References: <20231108204323.1292-1-michael.d.kinney@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB4929:EE_|LV3PR11MB8603:EE_ x-ms-office365-filtering-correlation-id: a4a8288f-3742-4e3c-743d-08dbe20adcce x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: hnkq+Tk7eP9i7mUjIm6WZ4D04xzS0uSepbe+tHw/Ftbaxudxxq4vK8AEOP1fjHM5m064pE1Y1BAkTeLyVcAkl3bf43f8LZPvAAZaUDFAJt9uxD1Ace8Sa5OlkgNKy4QrunGMxxvcazh+aSXCW2VxmAR9wJ528W+j6H7bt2GLWBzYKv3Wh7z/9tHobyLHjKTeVNQp8flFTvwMcXPW4/ecb5bmyb4SUYVex4hw1cd7h9fERUpTEt+iIcZ1G/Y/YYt2c6Z+AgExlhG7ARGkDGSwxJjt7++r/Rl/L11aAGQzdJM3e8waVwtVn3pB12XkmITvcoc1N/VX4s93VjKad0FSx73uxUzXG3JN+eNSx9O6cjD037wlVC17jXEomdS5NTv+K7jksPIMb85feAV4BWYVqg79dR0go0SBOspQAxAopI9nZG/wNXV5VaaObtDxrwJyHHaiGffg/mLs/pyNkK89WpDs5BfLPs+hF/UUiQG9ihe0LCWheICjebfl9e00UbF9O05j5Gt3Ll5F25Rvm7uQBggYiM+zebIsy/vJ384PSO53mjtjZLtSyRwGcltQgsSgFBKJtaTNbx/7bUDI5TR2CPiG4y9OycmvTjus5v1MrFqeNJMy6MkjEgmQP1nwlLJhOcJbIYdCA0G+QbsqdzIQ/TqP9JXvMrjFWEyyFQKPkMVXRU0ODn2vK/x52TVkT1dV x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8qMDfI36iRNXLTEKHldRttqPYPwKdRnLbq57vf+vsldCShnIc+EMTWeBt/Hw?= =?us-ascii?Q?YO2NOabu10+0udPpu1CQlaC02fElyUYvrLgWXUbyvZNiINB67eH8nzZTfFU+?= =?us-ascii?Q?cvM7TreieWhpnAtBC2KJLj5QZGG/aFlf7Bdvvrh7yZtgbMPeRDVOLllaU2kd?= =?us-ascii?Q?AOc6WV/P7Cjk1B5qx8QdVO1WE7HXkX1V84g0/rBHJwrsdPxJflhhqHCT1+Vo?= =?us-ascii?Q?JW/0i77RczZ+IB6/uci87oD6Ysayto36hj1ewb7FmDaq5knDOYk8KylTd10U?= =?us-ascii?Q?+rv/wwTgULUTDrgdP8FFDfhQh6VqyXYMBQNM5h40CCYunQdI/VpQyiHAHh32?= =?us-ascii?Q?Me4KMlS5Ou4S1uHN7w5xZA81YMhwh6zDYVxXSPb86eaOk3QQQPMeuY9WXNsQ?= =?us-ascii?Q?PJj24Vu6gMMaZo8Q3b942AG1Rv+E0bWGOtnkHgsGIhaaMCBCiVuSGbpD1xZB?= =?us-ascii?Q?MvszvzIHyGjmRQVMAhpmXRyjYTj+qMDIKgsfxMcLY9ZvJuqzLBwO5rs8fIyp?= =?us-ascii?Q?FI5IdR6tcfDibeHWqY4zHu6lVriTcR0FdMNpfg+rxJoAuoZ/2rqgQnk9HBom?= =?us-ascii?Q?a103PmBt5iOWv/O0AB0sVyUMkiuK7gsnfEq6jXfRLOf0wyOWaKvQ8p6QaPT9?= =?us-ascii?Q?dHHA28thmqda9o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COcb0?= =?us-ascii?Q?lnVcUIVY91NPd97Uz7ZcXLtFdLo/O4AZv2/M2W+0pijMIpwwS/8nLYT2+3mB?= =?us-ascii?Q?iQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4929.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4a8288f-3742-4e3c-743d-08dbe20adcce X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2023 16:34:08.4817 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: b8dYJgMfWw/Xu1JQusU94qT/tfVmUJACJRfl/Ax5EfxCC/RsQTAgq0l0+sN4MdtwbV9vDpwpfQ2RcX0Jkwk/qCpqScI/EoIKEW/ILuiHW6o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR11MB8603 X-OriginatorOrg: intel.com 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,michael.d.kinney@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: f1Qv2CusQoA2p40bBRmNXOUYx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ENx75vYP; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.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; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Hi Leif, Agree with your points. I was trying to make minimal changes to address the reviewers with no maintainers case. Returning a dictionary would make more sense. A couple questions: 1) Do you want to see this patch broken up into a series, with the logic fix, reviewers with no maintainers feature, and code clean up in separate patches? 2) Is this change approved for edk2-stable202311? Thanks, Mike > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Leif > Lindholm > Sent: Friday, November 10, 2023 4:44 AM > To: Kinney, Michael D > Cc: devel@edk2.groups.io; Rebecca Cran ; Gao, > Liming ; Feng, Bob C ; > Chen, Christine > Subject: Re: [edk2-devel] [edk2-stable202311][Patch 1/1] > BaseTools/Scripts: Handle reviewer only case in GetMaintainer.py >=20 > On Wed, Nov 08, 2023 at 12:43:23 -0800, Michael D Kinney wrote: > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4593 > > > > If a package only has reviewers and no maintainers, then also > > return the maintainers. > > > > Update get_maintainers() to return maintainers, reviews, and > > lists separately instead of a single merged list to allow this > > module to be used by other scripts and distinguish types. > > > > Sort the list of output addresses alphabetically. > > > > Fix logic bug where maintainers was incorrectly added to 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 | 42 ++++++++++++++++++--------- > --- > > 1 file changed, 26 insertions(+), 16 deletions(-) > > > > diff --git a/BaseTools/Scripts/GetMaintainer.py > b/BaseTools/Scripts/GetMaintainer.py > > index d1e042c0afe4..b33546b10f21 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 =3D [] > > + reviewers =3D [] > > lists =3D [] > > nowarn_status =3D ['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 +=3D address > > else: > > - lists +=3D [address] > > + maintainers +=3D [address] >=20 > That's a bugfix. Ought to be separate. > (Cleverly hidden by concatentaing the results when we didn't care > about keeping them separate other than for seeing if we'd found any > humans.) >=20 > > + for address in section['reviewer']: > > + # Convert to list if necessary > > + if isinstance(address, list): > > + reviewers +=3D address > > + else: > > + reviewers +=3D [address] > > for address in section['list']: > > # Convert to list if necessary > > if isinstance(address, list): > > @@ -96,32 +103,34 @@ def get_section_maintainers(path, section): > > else: > > lists +=3D [address] > > > > - return maintainers, lists > > + return maintainers, reviewers, lists > > > > def get_maintainers(path, sections, level=3D0): > > """For 'path', iterates over all sections, returning > maintainers > > for matching ones.""" > > maintainers =3D [] > > + reviewers =3D [] > > lists =3D [] > > for section in sections: > > - tmp_maint, tmp_lists =3D get_section_maintainers(path, > section) > > - if tmp_maint: > > - maintainers +=3D tmp_maint > > - if tmp_lists: > > - lists +=3D tmp_lists > > + tmp_maint, tmp_review, tmp_lists =3D > get_section_maintainers(path, section) > > + maintainers +=3D tmp_maint > > + reviewers +=3D tmp_review > > + lists +=3D tmp_lists >=20 > Minor niggle at coding style cleanup as part of functional rework. >=20 > > > > if not maintainers: > > # If no match found, look for match for (nonexistent) file > > # REPO.working_dir/ > > print('"%s": no maintainers found, looking for default' % > path) > > if level =3D=3D 0: > > - maintainers =3D get_maintainers('', sections, > level=3Dlevel + 1) > > + maintainers, tmp_review, tmp_lists =3D > get_maintainers('', sections, level=3Dlevel + 1) > > + reviewers +=3D tmp_review > > + lists +=3D tmp_lists > > else: > > print("No maintainers set for project.") > > if not maintainers: > > return None > > > > - return maintainers + lists >=20 > Apart from the niggles mentioned above, I agree that this is a > reasonable way of adding the required functionality without completely > rewriting the existing code. (It does make me feel there must be a > better way of writing it than I did, though.) >=20 > > + return maintainers, reviewers, lists > > > > def parse_maintainers_line(line): > > """Parse one line of Maintainers.txt, returning any match group > and its key.""" > > @@ -182,15 +191,16 @@ if __name__ =3D=3D '__main__': > > else: > > FILES =3D get_modified_files(REPO, ARGS) > > > > - ADDRESSES =3D [] > > - > > + # Accumulate a sorted list of addresses > > + ADDRESSES =3D set([]) > > for file in FILES: > > print(file) > > - addresslist =3D get_maintainers(file, SECTIONS) > > - if addresslist: > > - ADDRESSES +=3D addresslist > > + maintainers, reviewers, lists =3D get_maintainers(file, > SECTIONS) > > + ADDRESSES |=3D set(maintainers + reviewers + lists) > > + ADDRESSES =3D list(ADDRESSES) > > + ADDRESSES.sort() > > > > - for address in list(OrderedDict.fromkeys(ADDRESSES)): > > + for address in ADDRESSES: >=20 > But the above doesn't seem to have any impact on the generated output > at all. So I guess this is to enable the github work to utilise > get_maintainers() directly while maintaining the separation of > maintainer/reviewer/list? >=20 > It feels to me like that change would be more clear as a separate > commit from the one that breaks out reviewers from maintainers. > I don't have a strong preference for the ordering. >=20 > And it would probably also be less fragile (w.r.t. future edits) if > the end result returned a dict instead of three lists. >=20 > / > Leif >=20 > > if '<' in address and '>' in address: > > address =3D address.split('>', 1)[0] + '>' > > print(' %s' % address) > > -- > > 2.40.1.windows.1 > > >=20 >=20 >=20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111040): https://edk2.groups.io/g/devel/message/111040 Mute This Topic: https://groups.io/mt/102472591/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-