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 EC5EEA0C4C for ; Tue, 21 Sep 2021 16:36:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7DE341152; Tue, 21 Sep 2021 16:36:56 +0200 (CEST) Received: from AZHDRRW-EX01.nvidia.com (azhdrrw-ex01.nvidia.com [20.51.104.162]) by mails.dpdk.org (Postfix) with ESMTP id 9FB8641140 for ; Tue, 21 Sep 2021 16:36:55 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.176) by mxs.oss.nvidia.com (10.13.234.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Tue, 21 Sep 2021 07:36:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eLrrZTzQc4+k6d6RaqQ+HSqNhnsDUrMtPoUm9YpRLcvXsIZ/IEy1pB0CJ5X4GlmB27mktEGJY1GuiB2Q9ubLYOcmTuGO1BvRcpzu0uDD6KKZv+6dReYiBYVWpXmd5dniN8wMCV7pc3tHO+/5nXLI9Pe6q2bks1Ss5OlcB6tISOHLxa+8/Il8GtxnmIipCokGuzvKVQtqg9ei79m1XESmYtnlaUdq7A3g8RncgPXbJ3ZdzQJKHwr5afUhRsfneY8CRLjqxu3k+RcrlGTgM3nxjesCYUDbLGRyz/96pADFhGH0A7pEQplUmVMyB2XRXhZY5q5Y0jS/BJjT69o7aFP55A== 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=ksFknLx9qHlszDKFILZ6jLgDO8d/s097b2JNj68xUDU=; b=B5d8sfs3y8W6wNP/abmMLC5MMhQeM0ge7rimMt44q3oj2muKirAz4AmeJCJ/8e1NNjfewqKhbQQP/breSGs2QuWR2iulF23YWA0us1ogjVM1wG7dSqGu4btJmkX4nO6+oqp0TAYW7lF3KsBDR8XYK8u7ypFGv1J2DHS0NMW3mL1vEx/g3Yu6X79EpHImAY4AFTSrRU3qyegCRuiEbpKoEUpqXQ6rhKRsuiSelqy7epIM7CB/yb2GPIwJHbqxXtZ/iwOBdGrDZ0RwxJFCaGS1gGqj0NSBTMjO30SkXl1HYtfX2Xq01zEpvYCMag+v1vTVCEpIQhxrqFGnViIuecK8tQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) 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=ksFknLx9qHlszDKFILZ6jLgDO8d/s097b2JNj68xUDU=; b=EckKxSBhdjtpzZiHuEZtacq1r0juCk0lLVmqV0xN6K/c5TYB5yREzHope940Kx9tQzXSpT9+T7Z3dKw/J9TkZr9QVcRpBtjoZSC6vSwqiRS6pQIyWZ/AiT0SktuLG0h/31S41h2fa8OLW64KJB/zsnkvsmSg3RlXjsW4rR45YS/tIYv62mFFEhATxbq6cHNPvFWmH8wQQv+qb2gEqexUvfzTeVnXMmOY7qqgavARFC4s4Ca9jEAaI8dAvw2U0vS3IEQVoGiapwIMJ9wl8UYvQiIaT/SezP9Ls4RkTqFi4aer1W4XsCn1qa6kA2E8Hns8MrRyj+fUkocIOa2EmR5F6w== Received: from BN6PR13CA0061.namprd13.prod.outlook.com (2603:10b6:404:11::23) by DM6PR12MB3418.namprd12.prod.outlook.com (2603:10b6:5:116::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Tue, 21 Sep 2021 14:36:52 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:404:11:cafe::3d) by BN6PR13CA0061.outlook.office365.com (2603:10b6:404:11::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.5 via Frontend Transport; Tue, 21 Sep 2021 14:36:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) 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.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4523.14 via Frontend Transport; Tue, 21 Sep 2021 14:36:51 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 21 Sep 2021 14:36:51 +0000 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 21 Sep 2021 14:36:48 +0000 From: To: CC: , , , , Date: Tue, 21 Sep 2021 17:35:41 +0300 Message-ID: <20210921143542.4412-10-alialnu@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210921143542.4412-1-alialnu@nvidia.com> References: <20210906154537.1299-1-alialnu@nvidia.com> <20210921143542.4412-1-alialnu@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] 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: cb39abb4-6700-45f6-15cb-08d97d0d4082 X-MS-TrafficTypeDiagnostic: DM6PR12MB3418: 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: fuEVSuBB44ysmK/D4YhHpFlP9smE1sk3NwbwuUYlOFaz1/eBiMEkJ/OSJXB5pZxaDkfhOZUsXaYw8va0xFh/ObRoTdPcZRP4oVsy3JhyVqLjwXF4U5jXvCsd5vUnIVw5DUwY4lxPH+H5yfqLvebolkuQ7CRbu6wjvia388lIZHjKT4+Gc+yJJ2ldsfSHjmoUB5dXWRurDlOH+70N3xtWyh1tknrENRq6VUWyp+ns57wtoO1cNYsC+koN8XCqQ1nc7lLiVm2OgkbgrEZgZ+J7JHmPgUh5bzaRHZi3reRzZgh1D13mNX5OGBQYFsqT1il4hZ3CWxBrA8pzE2OBwt1MnugAXTMMRvVrHGuMBeLrsxwngq6lqftkBX3T/FGGEfNPnEurEVqYg+UVFJ1+885LcnlxiFrpb1Db5yd7ZMgFgFN1djCfInvgAIIM99h7ItWoSyZFPpx27Z36EDv3nL7SSPbPoaF9VoTggdfLOGAkJPmHVkin/EMxlrRUZwW6lDr5hDClpT5LsxcwLsoZX/3WrVDNf01dv2+25txlCj70LYRX+l5RCkCuZ0lWORZN5Pt26Z3acfISD+HnOPnDIE+jlTnpgnNeNixYefJu+R39G1DDHtLI0DNT/xAYY6A+p8gHWq0jZiz9kSgU3SbGmZAeIRWBcQbwYbUaMGtnWQgyOrohUIC+lZhU/3oDcobvsOjnAAZfQzwTmYFrfE/Q2mA6sA== X-Forefront-Antispam-Report: CIP:216.228.112.36; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid05.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(1076003)(55016002)(82310400003)(8676002)(4326008)(6286002)(7636003)(86362001)(6666004)(2906002)(47076005)(36860700001)(6916009)(16526019)(26005)(70206006)(7696005)(54906003)(316002)(336012)(8936002)(186003)(5660300002)(83380400001)(2876002)(2616005)(36906005)(36756003)(508600001)(356005)(426003)(107886003)(70586007); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2021 14:36:51.8340 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb39abb4-6700-45f6-15cb-08d97d0d4082 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.36]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3418 Subject: [dpdk-ci] [PATCH v2 09/10] 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" From: Ali Alnubani 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/pw_maintainers_cli.py --type series set_pw_delegate $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 bf1af70..e197a91 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