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 67B6CA0C54; Fri, 3 Sep 2021 15:32:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF6AD410E0; Fri, 3 Sep 2021 15:32:45 +0200 (CEST) Received: from mail-108-mta69.mxroute.com (mail-108-mta69.mxroute.com [136.175.108.69]) by mails.dpdk.org (Postfix) with ESMTP id 2D50740E78 for ; Fri, 3 Sep 2021 15:32:44 +0200 (CEST) Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta69.mxroute.com (ZoneMTA) with ESMTPSA id 17babdc7e4800074ba.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Fri, 03 Sep 2021 13:32:39 +0000 X-Zone-Loop: 863555bc1fbfe684e9de1690db20a71245d4fe18550e X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1UYSg7+Ems9DaWaxuNRYgjYutpRB4tHS6QvXHsYJKmc=; b=YIlsn6yhW7u1vOeHj8UtAAwGHE ECPTLXqYEqRogZRZS94AUYxawbUTxUQPtz8/SQG4mSr8+FYIpFLjRdk75e4otSdF31Dcczc9+Ymlc iKkERyVqeQjlE1pqKNQC7BeNK7aRSruczuOQ7mp8JNx6vKqxHxdVPwQbPvC/rTXHSi/K6VuCNXw9x lArWrmIAZ9vRY0YOmVl4VF5BjoJHrCGpiyAbRRUoyN+iUMH6b5BRQXrGoEv2iZZPlTfcpEwlOFOi1 IV3f5n9rvN7VBPzY6eVIpjpuBu3PQyRgG55bvKC+DoOd4khkGwnhbcUFiOzzQyP3ysowch4PJfIIb XwUePMvg==; To: Aaron Conole Cc: dev@dpdk.org, bruce.richardson@intel.com, stephen@networkplumber.org, ferruh.yigit@intel.com, thomas@monjalon.net, ktraynor@redhat.com References: <20210618163659.85933-1-mdr@ashroe.eu> <20210831145017.856776-1-mdr@ashroe.eu> <20210831145017.856776-3-mdr@ashroe.eu> From: "Kinsella, Ray" Message-ID: <7caa2c75-2d65-bf1e-c153-3db1e4664aea@ashroe.eu> Date: Fri, 3 Sep 2021 14:32:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu Subject: Re: [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 01/09/2021 13:46, Aaron Conole wrote: > Ray Kinsella writes: > >> Use this script with the output of the DPDK symbol tool, to notify >> maintainers of expired symbols by email. You need to define the environment >> variable DPDK_GETMAINTAINER_PATH for this tool to work. >> >> Use terminal output to review the emails before sending. >> e.g. >> $ devtools/symbol-tool.py list-expired --format-output csv \ >> | DPDK_GETMAINTAINER_PATH=/get_maintainer.pl \ >> devtools/notify_expired_symbols.py --format-output terminal >> >> Then use email output to send the emails to the maintainers. >> e.g. >> $ devtools/symbol-tool.py list-expired --format-output csv \ >> | DPDK_GETMAINTAINER_PATH=/get_maintainer.pl \ >> devtools/notify_expired_symbols.py --format-output email \ >> --smtp-server --sender \ >> --password --cc >> >> Signed-off-by: Ray Kinsella >> --- >> devtools/notify-symbol-maintainers.py | 256 ++++++++++++++++++++++++++ >> 1 file changed, 256 insertions(+) >> create mode 100755 devtools/notify-symbol-maintainers.py >> >> diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py >> new file mode 100755 >> index 0000000000..ee554687ff >> --- /dev/null >> +++ b/devtools/notify-symbol-maintainers.py >> @@ -0,0 +1,256 @@ >> +#!/usr/bin/env python3 >> +# SPDX-License-Identifier: BSD-3-Clause >> +# Copyright(c) 2021 Intel Corporation >> +# pylint: disable=invalid-name >> +'''Tool to notify maintainers of expired symbols''' >> +import smtplib >> +import ssl >> +import sys >> +import subprocess >> +import argparse >> +from argparse import RawTextHelpFormatter >> +import time >> +from email.message import EmailMessage >> + >> +DESCRIPTION = ''' >> +Use this script with the output of the DPDK symbol tool, to notify maintainers >> +and contributors of expired symbols by email. You need to define the environment >> +variable DPDK_GETMAINTAINER_PATH for this tool to work. >> + >> +Use terminal output to review the emails before sending. >> +e.g. >> +$ devtools/symbol-tool.py list-expired --format-output csv \\ >> +| DPDK_GETMAINTAINER_PATH=/get_maintainer.pl \\ >> +{s} --format-output terminal >> + >> +Then use email output to send the emails to the maintainers. >> +e.g. >> +$ devtools/symbol-tool.py list-expired --format-output csv \\ >> +| DPDK_GETMAINTAINER_PATH=/get_maintainer.pl \\ >> +{s} --format-output email \\ >> +--smtp-server --sender --password \\ >> +--cc >> +''' >> + >> +EMAIL_TEMPLATE = '''Hi there, >> + >> +Please note the symbols listed below have expired. In line with the DPDK ABI >> +policy, they should be scheduled for removal, in the next DPDK release. >> + >> +For more information, please see the DPDK ABI Policy, section 3.5.3. >> +https://doc.dpdk.org/guides/contributing/abi_policy.html >> + >> +Thanks, >> + >> +The DPDK Symbol Bot >> + >> +''' >> + >> +ABI_POLICY = 'doc/guides/contributing/abi_policy.rst' >> +MAINTAINERS = 'MAINTAINERS' >> +get_maintainer = ['devtools/get-maintainer.sh', \ >> + '--email', '-f'] > > Maybe it's best to make this something that can be overridden. There's > a series to change the .sh files to .py files. Perhaps an environment > variable or argument? > >> +def _get_maintainers(libpath): >> + '''Get the maintainers for given library''' >> + try: >> + cmd = get_maintainer + [libpath] >> + result = subprocess.run(cmd, \ >> + stdout=subprocess.PIPE, \ >> + stderr=subprocess.PIPE, >> + check=True) >> + except subprocess.CalledProcessError: >> + return None > > You might consider handling > > except FileNotFoundError: > .... > > With a graceful exit and error message. In case the get_maintainers > path changes. > So FYI - this get's into the weed a bit. As there is already a DPDK_GETMAINTAINER_PATH environment variable, what would you call a new variable. So instead I added logic for the script to sanity check that _everything_ is defined and where it expects it to be, and then complain loudly and die when it is not. The devtools scripts already cross-reference either each, so I'd expect any changes changing to get-maintainers.sh to get-maintainers.py to take care of cross-references. Ray K