From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F554A0C41 for ; Thu, 30 Sep 2021 10:29:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A81C410FF; Thu, 30 Sep 2021 10:29:58 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 454FF410EE for ; Thu, 30 Sep 2021 10:29:57 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id EB6875C01BB; Thu, 30 Sep 2021 04:29:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 30 Sep 2021 04:29:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= RPHCcDgEn7UFMWj6MwN+4Ild6+wGyn2DB5YL+UFzwCk=; b=ox9IDD0Rtz/krckn LCKXP4DJiw6PK9+jVgbihfnL9dVLBNLLOR+KRCiHP7GrdEKCcMEZkCi8vR8ytpJL h1/2VKwhy6l7SzFY/AeKxt3cHGdby/LqkeFUS6CMZNQm9A1UYCx++eciJ0CVgVNE Y8uwpF8JHq5/CnDs+amAte7ESGoRcFhI92Pv/woNDud4L2TTkfzZOSereBNLDgy5 mZzGFwXJXkHY2qbzGwHL09UF8nws/DFx8t9UXbRbrSpiuQvGcaoFuPnlhUnUNk2I j1srzSBNbIRFKb6LIQJVKwa2l0n8XiVVSuR8/drC2Sp+U10BFvQnEtsQxMqE9QxM B/xtOQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=RPHCcDgEn7UFMWj6MwN+4Ild6+wGyn2DB5YL+UFzw Ck=; b=V2ptTD+s++GTpRgYhgiS5wY32HpFAhh5MsRXEwkkY+VZOiwyBSA4zWQdC 4ZDlsqg2W8ZWg8peL82YklnSQoTc9DGMqXafQnq2N55OJ7V/TS14xB+KBPN09coN 9gkudWMj85V5tVUE3VO2tbIlpIrac812Kqmnh705pk7hgzCAqmhpv7I0vrGMNRMU jr/XHXuOIxJg+/kU3Ic/o1M/r+ajZgmjMtu3heYAvyXkGgBFz0SweAXar4rbxdXX VwCJiHL5Uv9MY9HuVq34kx67NaMG/RJaAyVWe1TO+mdYQ+uW3MYhuQ3097+KuaZe oGyi9AtPG2VL/JF0swN8JC0bHTxwg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkjghfggfgtgesthfure dttddtvdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpeffvdffjeeuteelfeeile duudeugfetjeelveefkeejfeeigeehteffvdekfeegudenucffohhmrghinhepughpughk rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Sep 2021 04:29:55 -0400 (EDT) From: Thomas Monjalon To: alialnu@nvidia.com Cc: ci@dpdk.org, jerinj@marvell.com, ferruh.yigit@intel.com, david.marchand@redhat.com, juraj.linkes@pantheon.tech Date: Thu, 30 Sep 2021 10:29:54 +0200 Message-ID: <6750166.sAAn6ldZEP@thomas> In-Reply-To: <20210921143542.4412-5-alialnu@nvidia.com> References: <20210906154537.1299-1-alialnu@nvidia.com> <20210921143542.4412-1-alialnu@nvidia.com> <20210921143542.4412-5-alialnu@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-ci] [PATCH v2 04/10] tools: add functionality for detecting tree maintainers X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org Sender: "ci" 21/09/2021 16:35, alialnu@nvidia.com: > From: Ali Alnubani > > Detecting a maintainer works by searching the > 'General Project Administration' section for subsections > containing the provided tree, and then returning the maintainers > specified in that subsection. > > Signed-off-by: Ali Alnubani > --- > @@ -118,6 +120,7 @@ class Maintainers(object): > > file_regex = r'F:\s(.*)' > tree_regex = r'T: (?Pgit:\/\/dpdk\.org(?:\/next)*\/(?P.*))' > + maintainer_regex = r'M:\s(.*)' > section_regex = r'([^\n]*)\n-+.*?(?=([^\n]*\n-+)|\Z)' > subsection_regex = r'[^\n](?:(?!\n{{2}}).)*?^{}: {}$(?:(?!\n{{2}}).)*' > > @@ -141,6 +144,26 @@ class Maintainers(object): > # Save already matched patterns. > self.matched = {} > > + def get_maintainers(self, tree): > + """ > + Return a list of a tree's maintainers.""" > + maintainers = [] > + for section in self.sections: > + if section.group(1) == 'General Project Administration': Should this constant string be declared above with other regex? > + # Find the block containing the tree. > + regex = self.subsection_regex.format('T', re.escape(tree)) > + subsection_match = re.findall( > + regex, > + section.group(0), > + re.DOTALL | re.MULTILINE) > + if len(subsection_match): > + subsection = subsection_match[-1] > + # Look for maintainers > + maintainers = re.findall( > + self.maintainer_regex, subsection) > + return maintainers > + break