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 2918DA0C54 for ; Mon, 6 Sep 2021 17:46:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23EFA410ED; Mon, 6 Sep 2021 17:46:44 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id 04489410E9 for ; Mon, 6 Sep 2021 17:46:43 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) 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:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nVHHiIPBiD6NoKMB+uISf5GDizFoX7vmS2WkycJDFVVrhcn8eOTtFFLkwb6ItEH1Tn1MgyTeP6d8nmPqcOJ8Ez7TWJNFCXq6KwO7I2xnnSXkPHBgesJXn52wIsawiUuToz4xpHaB4UBItYzGIdXxEuo6/gITBhJad5K1T8/wYA7eFQiYQNGSNi5DUeOGRkl7lvfYE14XnnBMnSeYUnDcoKesDBYEU3ryWBUQPxPA260E+spE7Jf5uYGWPr/ghJUzep5mS/+xuMTezH88yLDRS41QRGbRNmaMszvGhsolE5TjWz3UqCABiYoy8bktp6sBViIDcqOLLG54WeIsiPzOqw== 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=7+HwkCYGrzjwLk5DqEAMGBm/ujh39oLEr2em7WfZMVE=; b=WH9gDxYG1EyrvQ9jxmXMxxRXDDXCBggwUCNohVAJhMLvYT2s8Urr9VIJDNh3bm/6uXHKAWsTHlN87MymF53goOq/uTddH3VIG3gvRYKX/iLgIoJJkvgZTfUwWqBZYymndCTfEchqQUenBldKReDXRE3IIfN0HLL21TOF7IcyvJglAKwKX2xqf6Tm6K0fQosmF5Up1m3Ra56oYEfvKC4/2EMBhgECmBaAvv4GTKh5kivwfiH5SSU7/tpX3sQdrlZR0fquMOfDhkxloBvIfVqOc6H+3MdK9QY2MLkTYdeMtfeTBZUsEdGBvpAYBbvnvqrbLWXBEAqLbMrhD8AobzX4sA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) 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=7+HwkCYGrzjwLk5DqEAMGBm/ujh39oLEr2em7WfZMVE=; b=dkPrnHmIlhmMixyWfT9h6hHsQH98xugMfCY1kYyxN1xu75Xpcz3J6ovSFXSPFqu7u4FKmlJ6kCc6U92cMOMiV/k2o+Qz/dAiFnqKrkJ35m28ffAHh3zZ3iItOE+87ET3Ypj5pDLEZ8IgXXv0JUrjqk6h7V+AhejXo/1ICKFlBtPFhkeMJURv7HQTjzYVnHBdB+RPkhMASblhABiCOTwFW/Py2y1C7VlUulFggu2j/JzYs1+8emYMby7ZgY/NYLoZDcvmx2VXx4nrwGMNSvlssWlqAnbv9lZH+dnDMl5txGlqIzIMJGPhJIY1dUKZNKXJmK3ubkub/iM8+II99AmVmg== Received: from DM5PR10CA0018.namprd10.prod.outlook.com (2603:10b6:4:2::28) by BN6PR1201MB2483.namprd12.prod.outlook.com (2603:10b6:404:a6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.21; Mon, 6 Sep 2021 15:46:40 +0000 Received: from DM6NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:4:2:cafe::70) by DM5PR10CA0018.outlook.office365.com (2603:10b6:4:2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17 via Frontend Transport; Mon, 6 Sep 2021 15:46:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) 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.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) 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.4478.19 via Frontend Transport; Mon, 6 Sep 2021 15:46:39 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 6 Sep 2021 15:46:39 +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:36 +0000 From: Ali Alnubani To: CC: , , , Date: Mon, 6 Sep 2021 18:45:31 +0300 Message-ID: <20210906154537.1299-4-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: 97afc58a-ed20-46f1-240c-08d9714d8477 X-MS-TrafficTypeDiagnostic: BN6PR1201MB2483: 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:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FQBwpN2yy9RPibt0KeVTqWBgRzao+PmJenlBB8lYquTNnnEH2zm/M01dcI9wxDPji5f4Lzjn0Jh8JPnqykoK2kmXZ5XO0GTzDIswoZas0tfZ9APV/ul8NtToWkcpkFWPWAg4OR7QVTmH5IEZx9QGij66EQuDz1NsbwIDAWLZE8I2N3gYlWqXY8/qQRFS9akyy9fyreX3ShokFs+r3N7HTScjZziesavm0V65cy9vbWObMot3S1IBJ1X5FIKBsfnoQoKBhRmugGmBd5mkvUj1MsHmCkMVmW20TBXQwajWK8Y/0/JYPstgga4/Bojq7TLehGFpOrgcZS+pklPx2LVSSbmonHWBE2GYgteHtUxE4TINQ4hIz7kESONC9fzGYaAXqd+cDLWB55WtTHjqSJbWToAsjPNSMhsyPLga3DUI7EDlRJuRe/kL3fEEQz2lMNKuaB12+DFBklcuX4WdQaoHVvZDmY+k18utcCd9hJomO3ztKBU4cAH+LMOc87mi60kW4UiSMBiWPt8a/DfSQGByGJzHfXvEQVYLnY0Pc6LLn594N4SKMWAvdPtrzpcdbvhScCBkq6NDzZXcEbO0lvJ4x2Y8oO6uHShj0gVncvnyy3FT9sEnK70uTwUq61Y4Fd6hEwJcivZnIE/I6vgXP3cZFIz+fk2X7qT4+8EpvbUap8xbpXdqIY9CnDVVcItNdg7H9u0wflI4/2Tdr0LhgoXPrg== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid04.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(396003)(346002)(39860400002)(136003)(46966006)(36840700001)(1076003)(426003)(8936002)(83380400001)(70586007)(6666004)(8676002)(356005)(2616005)(5660300002)(26005)(2906002)(82310400003)(7636003)(16526019)(186003)(7696005)(316002)(36756003)(6916009)(36860700001)(70206006)(86362001)(55016002)(336012)(107886003)(36906005)(47076005)(4326008)(478600001)(54906003)(6286002)(82740400003); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2021 15:46:39.7437 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97afc58a-ed20-46f1-240c-08d9714d8477 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.35]; 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: BN6PR1201MB2483 Subject: [dpdk-ci] [PATCH 3/9] tools: update script usage 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 resource type (whether it's a patch or a series) is now specified by the new argument --type. Both commands: list_trees_for_patch & list_trees_for_series are replaced by the command: list_trees, and the type must be always set. This makes adding more operations require less arguments and easier. Signed-off-by: Ali Alnubani --- tools/maintainers.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/maintainers.py b/tools/maintainers.py index 22933d5..e4ea317 100755 --- a/tools/maintainers.py +++ b/tools/maintainers.py @@ -31,8 +31,8 @@ variables PW_{SERVER,PROJECT,TOKEN} should be set. If not, the script will try to load the git configurations pw.{server,project,token}. Example usage: - ./maintainers.py --command list_trees_for_series 2054 - ./maintainers.py --command list_trees_for_patch 2054 + ./maintainers.py --command list_trees --type series 2054 + ./maintainers.py --command list_trees --type patch 2054 Or if you want to use inside other scripts: @@ -243,9 +243,14 @@ if __name__ == '__main__': options_parser.add_argument( '--command', choices=( - 'list_trees_for_patch', - 'list_trees_for_series'), + 'list_trees'), required=True, help='Command to perform') + options_parser.add_argument( + '--type', + choices=( + 'patch', + 'series'), + required=True, help='Resource type.') git_pw_conf_parser.add_argument( '--pw_server', type=str, @@ -268,6 +273,7 @@ if __name__ == '__main__': args = parser.parse_args() command = args.command + resource_type = args.type _id = args.id # Pass the needed configurations to git-pw. @@ -279,9 +285,9 @@ if __name__ == '__main__': maintainers = Maintainers() patch_list = [] - if command == 'list_trees_for_patch': + if resource_type == 'patch': patch_list.append(_git_pw.api_get('patches', _id)) - elif command == 'list_trees_for_series': + else: series = _git_pw.api_get('series', _id) patch_list = [ _git_pw.api_get('patches', patch['id']) @@ -290,4 +296,8 @@ if __name__ == '__main__': files = [] for patch in patch_list: files += Diff.find_filenames(patch['diff']) - print(maintainers.get_tree(files).split('/')[-1]) + + tree = maintainers.get_tree(files) + + if command == 'list_trees': + print(tree.split('/')[-1]) -- 2.25.1