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 19228A0C4B for ; Mon, 8 Nov 2021 07:29:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14F77410FE; Mon, 8 Nov 2021 07:29:39 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) by mails.dpdk.org (Postfix) with ESMTP id 7B18540151 for ; Mon, 8 Nov 2021 07:29:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=COom0EXLMUtOhRM8TVm3OsV1MN6a1I0L6VRwCSv10MbsjqEseq8lLPn4gEe+5Kos7Fi/On+Khj61ACOBJKKxMe2+6YQUvVA04TriXqr8N3LPUsep53sx+0DYuzLBwgnmO6GK8rTkuh094fm4eDOn6fZZNtb0bFO4MBY5F/fzf91Qe7/IF7KbJHOBe3ytbIIxaWeVqSwDjckWn4KaIDCQI6TYslBUZNkB9JAGfJJD4nQLU3a5aE90hmHkvOXqDPMXY7Wqkf9gKBmdCHErbiw4j6uTEHzYP3EmIjRWd3ybzJ7mJCniQZiNQkIpQRy2IFrIZWwXgGaY5lS9BMMQKHS9Bw== 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=XzQ/NNz3KVlw9mRrdgpqyK6VKB9O4muzdMdU51dRMsI=; b=f4k4WUOQs3y2ONKlvJBYbtOINMOU8xFNf+DiwLg+IMyGkf4EpX7ie45I5cLj4ao2Ud88UvAkP1mUpzmKoNpZBp+FbcVF4Xd5gFgBeacXDn05MFXSPLWMxg++dbUKZwQIzCJlqWA2MDjNEjwN3R+ZHMQngUZLnFLZeFwvlOOWFyI/t7bPMeBghErfe3BR9eELtxuvQUfedLH2HFFRcDs0/cuGIdn/+sGxVF6ohXrtDG7cCtT37rC4nwauPHJ9YzZbYatfp4dWuxVlYzVo+X0KROmMKGbNRskAHe0qN1ZBAG0SE7smhazVC/P5W97xZrEjFFbMKbnt4t7WgE+yKQ9CpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=XzQ/NNz3KVlw9mRrdgpqyK6VKB9O4muzdMdU51dRMsI=; b=snvJEPrJHktTViJH/CoRwTDHTF4gWSlswX0tvprTE+1V/TJwMNLjt+OpfLoSgl1E9g9RtJIdjb9lK55Y2XOu5iINHxMU0EFqst2QiOsPo58vnIHpC5Qg2MRwXWzJ+MvBVezqJzpOpYg0ay/bd+tjGf3OhZYIyyAslcHRYXSNLtg0bGG0hZg9mBOVhPJT51OmWZ3nBxeWbDQAzNrp43vfcgrRb+Y2A+mpNwctT3BzUsmsj3ifR7INcVdKIGylkwLmnL9N4Oepl6bjpRS/zC4n0dYezz0XhSPpzrzf5vlGawgBjp+bbdZikako/cvcsfCm9gf7GON/r/IWYic5MYgOIA== Received: from DM6PR12CA0010.namprd12.prod.outlook.com (2603:10b6:5:1c0::23) by DM5PR12MB1802.namprd12.prod.outlook.com (2603:10b6:3:109::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Mon, 8 Nov 2021 06:29:35 +0000 Received: from DM6NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1c0:cafe::1) by DM6PR12CA0010.outlook.office365.com (2603:10b6:5:1c0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Mon, 8 Nov 2021 06:29:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; 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 DM6NAM11FT051.mail.protection.outlook.com (10.13.172.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Mon, 8 Nov 2021 06:29:34 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 8 Nov 2021 06:29:31 +0000 From: Ali Alnubani To: CC: , , , , Date: Mon, 8 Nov 2021 08:28:13 +0200 Message-ID: <20211108062815.7614-9-alialnu@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211108062815.7614-1-alialnu@nvidia.com> References: <20210906154537.1299-1-alialnu@nvidia.com> <20211108062815.7614-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: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbaa04e3-d60b-409a-96bc-08d9a2812191 X-MS-TrafficTypeDiagnostic: DM5PR12MB1802: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:619; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G2GFMXIxrMt443itAqdG0HayxqN0m8FwHaPiv0RS/YctAWiEhvonPWgtbgMBumQIF3qkODZCxKzGsHSO269c0wWeNA/1BbGnW5w5mLqCXaqz7zL0kZ4qCgstezeUXkgV9oXHqCubUgsIdAsqPJ+4Pl9D+HzTm7gKTxxYMawMy07z2qpHMp65ylSscHOVad5I7gTNcBLJ4T5Lp8a9NBHO2qspY0CSPIMY9ENUCwlmsHNGu8AM5Vfk7UR7z3jYgH3fdDdOboaykDAq2Nk37x1tval95IxlFSK+HrnohOZc+IlC7CUEwlXWGP+yRvQ1TDk8FAnDTV7DEcPm8K+qKqvIKkKAHBgmDlFXUw2uNeRW+G5tRyYP1gXjqFgaTygCzlEWTXJhjJ9dBlS25zlojA/ajE3wnpQA9OtSfHMnn3hEi3ci4Ol00D54n6teohIoxdX68wolg9K+xj7jIAjth0jaDZz5w9EqxeE8dAdB4fJ8xIkgg5n4XcHUnwx0EKKJNB0FmQVqvEjwy/Cvg2FO1e/CbCbQp/MDFsBZ4GzZIntQoosKo4WsVsVt0SEm5mZOrXXDL5Q87ec3PXaRZzdrk1KXLUNoYBwAFhB7WcvcUsPwwYI97dWmDKbSJM8TLSvrFRKHnK2jrYTl2LquoWTg1fniuy53LFVABxv6QUt45elt8JMbPJOSiGnn4UXVA8XuBYmzKMPw6+YhjZTvQuUERN7sLA== 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)(46966006)(36840700001)(316002)(6916009)(7636003)(7696005)(55016002)(356005)(82310400003)(508600001)(47076005)(70206006)(966005)(4326008)(36860700001)(8676002)(70586007)(8936002)(1076003)(336012)(6286002)(2906002)(83380400001)(2616005)(36756003)(86362001)(426003)(16526019)(6666004)(5660300002)(26005)(186003)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 06:29:34.6156 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbaa04e3-d60b-409a-96bc-08d9a2812191 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: DM6NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1802 Subject: [dpdk-ci] [PATCH v4 08/10] tools: support fetching series 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" The script can now fetch new series IDs by filtering the events API with category 'series-completed'. See: https://patchwork.readthedocs.io/en/latest/usage/overview/#series-completed Example usage: $ export MAINTAINERS_FILE_PATH=/path/to/dpdk/MAINTAINERS $ ./tools/poll-pw series /path/to/last.txt \ '/path/to/pw_maintainers_cli.py --type series set-pw-delegate $1' Signed-off-by: Ali Alnubani --- Changes in v3: - Fetch new series IDs by filtering the events API with category "series-completed". - Updated usage (renamed 'patches' arg to 'patch') so that it feeds directly into the 'patch-completed' category. tools/poll-pw | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tools/poll-pw b/tools/poll-pw index ccc58f0..48c9fd0 100755 --- a/tools/poll-pw +++ b/tools/poll-pw @@ -9,11 +9,11 @@ PAUSE_SECONDS=100 print_usage () { cat <<- END_OF_HELP - usage: $(basename $0) [OPTIONS] + usage: $(basename $0) [OPTIONS] - Poll patchwork and call command for each patch. + Poll patchwork and call a command for each new patch/series id. The first date to filter with is read from the specified file. - The command should use '$1' to be evaluated as the patch id. + The command should use '$1' to be evaluated as the patch/series id. The date in the specified file is updated after each pull. END_OF_HELP } @@ -31,14 +31,15 @@ while getopts h arg ; do esac done -if [ $# -lt 2 ] ; then +if [ $# -lt 3 ] ; then printf 'missing argument(s)\n\n' >&2 print_usage >&2 exit 1 fi shift $(($OPTIND - 1)) -since_file=$1 -shift +resource_type=$1 +since_file=$2 +shift 2 cmd=$* if [ ! -f "$since_file" ] ; then @@ -52,7 +53,13 @@ if [ ! $? -eq 0 ] ; then exit 1 fi -URL="${URL}/events/?category=patch-completed" +if [ "$resource_type" != "patch" ] & [ "$resource_type" != "series" ] ; then + printf "Unknown resource type '$resource_type'.\n\n" >&2 + print_usage >&2 + exit 1 +fi + +URL="${URL}/events/?category=${resource_type}-completed" callcmd () # { @@ -66,7 +73,7 @@ while true ; do page=1 while true ; do ids=$(curl -s "${URL}&page=${page}&since=${since}" \ - | jq 'try ( .[].payload.patch.id )') + | jq "try ( .[].payload.${resource_type}.id )") [ -z "$(echo $ids | tr -d '\n')" ] && break for id in $ids ; do callcmd $id -- 2.25.1