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 E14D1A0C54 for ; Mon, 6 Sep 2021 17:46:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCD83410ED; Mon, 6 Sep 2021 17:46:59 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id AEB40410E9 for ; Mon, 6 Sep 2021 17:46:58 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by mxs.oss.nvidia.com (10.13.234.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Mon, 6 Sep 2021 08:46:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N6WxmU5DgCgWVGmyhyMd2Tbz9B3j8ReZEzeZSD8uxVO8DqYyj5/2jwvBmmsLae3F4EixHkiGupue/b1zRWz45rKPoB1FYH07rp3YrR8Fgxob81fu/caRJwxJ7vSlAAUVLkYplEXBn6FkePE5CJ5sQkiHwq8evBU1vw2707GWyDS9clmSTzvoG6/ffgns58SbPDfB7erxxxHPmncboFXprRAKEwrIcKQXjHxNtmA3FQ01U3f/6xIIF9p/9XhioGyY+a0Tz0eZDi+InPfX+OAKiP4s3YlX9zYGsn5LnsyBWsE/ADIGNp6KacpyoHi+jxr42cNliUv36Gsir7uep8oFiA== 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; bh=A8WeWgKjfxzisxYujKNUsZXS6uYLxk2vzt4O0HVouBo=; b=D1ySCnr98TlEVS3Qd4HE5u41zK6PFi7axmvFSDKni9Xyb/5TQrrBQD0D7Gg0cEZARHP/WrOpsn9EqMc3KQbneVaJO6OfYfa6elT/vbtCS12INodBGYAhqKipPWLlqqZRTmjkIOCtN1xrDYX005P1XCS2u0V0xWpXaORMpu4CHgKzgm6Kq3dJCCBzxT68w0llgPKLdxP7/M2OCX0a3kg2kSbC/WD05/945AR9193rjEKvzRfoDo1SGhAmXUfH951Ad1l5RryrWbkTuQl0lQ7UUBzZblhZfPRzLERIrp9hSF68SPxoe/3cdH4+gg8dlHef/yexVF/ErY3QD4XBpcgCKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A8WeWgKjfxzisxYujKNUsZXS6uYLxk2vzt4O0HVouBo=; b=rsLSnM541Rk4YsCi7NYJBkUwlnVUcOoXfmZuGir+BVrDMcC2ed1UcMsvY8R2CqE3XfEGdzQf+/58TovrrTteHC2mqYEfGUUiODsU6MubK0sYuo85DwhhOeUscu9cSY0UqujxSPKPh7krmwNKuLfhinbB7oiVYGPM92QNkeI/AtNha119fUqYFIpemBU23ANCXIe+N+xfPNZ7Oy2km/c1xSAe85yb5NjzfrMGc/pnb3TmsHm/8Tc4DhGefPbSpQ2L6JsxkL9ZDx6FLHRUMi0vIfvVCYuQdOIgjmGb5TomqVh0tAl/rCJVR/PHlEOE0RgP5fsmrzGlMlmaT1Q6jyaXZw== Received: from BN9P223CA0016.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::21) by MWHPR12MB1216.namprd12.prod.outlook.com (2603:10b6:300:10::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17; Mon, 6 Sep 2021 15:46:55 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::72) by BN9P223CA0016.outlook.office365.com (2603:10b6:408:10b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Mon, 6 Sep 2021 15:46:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4478.19 via Frontend Transport; Mon, 6 Sep 2021 15:46:55 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 6 Sep 2021 15:46:54 +0000 Received: from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 6 Sep 2021 15:46:52 +0000 From: Ali Alnubani To: CC: , , , Date: Mon, 6 Sep 2021 18:45:37 +0300 Message-ID: <20210906154537.1299-10-alialnu@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210906154537.1299-1-alialnu@nvidia.com> References: <20210906154537.1299-1-alialnu@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 345026a1-387b-414b-7322-08d9714d8dc2 X-MS-TrafficTypeDiagnostic: MWHPR12MB1216: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-Transport-Forked: True X-MS-Oob-TLC-OOBClassifiers: OLM:309; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QPs9aTk3iEyI9Hm2XmmfvApHHh3p0rKI5r21s3aX7Lq7Bus/dpXa848C0MucSRiQrpi2WlZOTbr+bGXlQg/tN9Ld5Ic1awX8FwvaLqME9Wm/gQc8/66vOf8CHdYkUibcX3yRZsBlhx1WL+CgpiJQCYDd/dP1JAoN2PV3AQBN86C/USrRgFheMXthWNdxE3XABUZi3CBUt+V7wGs/G+Wqao6jd3zmYD6Farg0wbIBHoybrbXTZgaKvSafM/5NUjq2cP7ZOHymkbtX62imKSrKMmrIFMfCHzaYIRphxWM1cjdOmGWU1ne1rPro7nNnozQCd97iemyZu0qQzA+JBIQuAenaWw/cBfIpH/Qch1D2j5cEg0HlUmmaUmy7wD5laIEt+t4AWCxBD2H1pUgg6fI5zgA3wNpyC3EXILkElYzg4Ga0YlwtDK1aYTAFc9DQkplRG4NNHLslWZo0OoLyMvn3sBhywZGPuZRHfXvP2SakKDF4wAxVQHyklzsDpJSUzWSV95fKK1nAaqNOZRpOjbI+mWes3acumAivZwZ+2blZMx/s2iOV30fRRpbeKBLNt36VnVE+mUdqtKv5cq8Ja44027xQW5kt/ExXfZIT6/29kGzDW1lJ0QLqd1gPev7ZmrbfZ80FjfjhVoLRhOXx3z/sIzG9iFh9cwFFtT4ifaIOp9Y80xq/tgB6KGhpNbclFHEZEY9Gk+73snpS95Y9F1Ww6w== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(8676002)(36756003)(83380400001)(6666004)(8936002)(86362001)(2906002)(47076005)(6916009)(5660300002)(7696005)(82310400003)(6286002)(2616005)(508600001)(336012)(54906003)(107886003)(356005)(36906005)(316002)(4326008)(55016002)(7636003)(186003)(16526019)(70586007)(36860700001)(70206006)(1076003)(426003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2021 15:46:55.2118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 345026a1-387b-414b-7322-08d9714d8dc2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1216 Subject: [dpdk-ci] [PATCH 9/9] tools: filter new patchwork IDs by project name 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" Different projects require different checks usually, this patch modifies the script so that it requires a project's name which it passes as a parameter with the API end point. Example usage: $ export TZ="Europe/Paris" $ export MAINTAINERS_FILE_PATH=/path/to/dpdk/MAINTAINERS $ ./tools/poll-pw series DPDK /path/to/last.txt \ '/path/to/maintainers.py --command set_pw_delegate --type series $1' Signed-off-by: Ali Alnubani --- tools/poll-pw | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/poll-pw b/tools/poll-pw index 6017146..67251cc 100755 --- a/tools/poll-pw +++ b/tools/poll-pw @@ -9,7 +9,7 @@ PAUSE_SECONDS=100 print_usage () { cat <<- END_OF_HELP - usage: $(basename $0) [OPTIONS] + usage: $(basename $0) [OPTIONS] Poll patchwork and call a command for each new patch/series id. The first date to filter with is read from the specified file. @@ -31,15 +31,16 @@ while getopts h arg ; do esac done -if [ $# -lt 3 ] ; then +if [ $# -lt 4 ] ; then printf 'missing argument(s)\n\n' >&2 print_usage >&2 exit 1 fi shift $(($OPTIND - 1)) resource_type=$1 -since_file=$2 -shift 2 +project=$2 +since_file=$3 +shift 3 cmd=$* if ! curl -sfIo /dev/null $URL/$resource_type ; then @@ -47,6 +48,12 @@ if ! curl -sfIo /dev/null $URL/$resource_type ; then exit 1 fi +curl -s $URL/projects/ | jq '.[].name' | grep -qi "^\"${project}\"$" +if [ ! $? -eq 0 ] ; then + echo "The project '$project' doesn't exist." + exit 1 +fi + if [ ! -f "$since_file" ] ; then echo "The file '$since_file' doesn't exist." exit 1 @@ -58,7 +65,7 @@ if [ ! $? -eq 0 ] ; then exit 1 fi -URL="${URL}/${resource_type}/?" +URL="${URL}/${resource_type}/?project=${project}&" callcmd () # { -- 2.25.1