From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80059.outbound.protection.outlook.com [40.107.8.59]) by dpdk.org (Postfix) with ESMTP id 890D31B3EC for ; Sun, 17 Feb 2019 09:09:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hMo3e3+X8jxc01CC5Hb6p+jl2l1nt6No0pjkKJygwsg=; b=OOJD3pBCSQZiQahCI+OsK4YB4viDEe0JH4qCJN01DLItevQGMmCVYxZ9A7OHQlAnLXk+pDJc6D4DQy5ilHrzuhDgFL+d58ruhuKKpJbpIx04Dp1v5jIerGOhohW83ubXq+aDoaFAek7cod+8ZW7iEhoGrfu8//26LLrXyAVqYWs= Received: from VI1PR05MB4269.eurprd05.prod.outlook.com (52.133.12.22) by VI1PR05MB5805.eurprd05.prod.outlook.com (20.178.122.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Sun, 17 Feb 2019 08:09:18 +0000 Received: from VI1PR05MB4269.eurprd05.prod.outlook.com ([fe80::64cb:93f8:918:f1a1]) by VI1PR05MB4269.eurprd05.prod.outlook.com ([fe80::64cb:93f8:918:f1a1%7]) with mapi id 15.20.1622.018; Sun, 17 Feb 2019 08:09:18 +0000 From: Ali Alnubani To: Thomas Monjalon , Jeremy Plsek CC: "ci@dpdk.org" , "ferruh.yigit@intel.com" , Ori Kam Thread-Topic: [PATCH v2] add script to decide best tree match for patches Thread-Index: AQHUwuIO4Vflct6tfE+fy/SC26xbcqXhZQeAgAAb6YCAAhrcsA== Date: Sun, 17 Feb 2019 08:09:17 +0000 Message-ID: References: <20190212144828.18122-1-alialnu@mellanox.com> <5917852.0VcOUA9y90@xps> In-Reply-To: <5917852.0VcOUA9y90@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=alialnu@mellanox.com; x-originating-ip: [82.213.2.186] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 54c5e24f-0ca7-4f26-5d74-08d694af36eb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB5805; x-ms-traffictypediagnostic: VI1PR05MB5805: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; VI1PR05MB5805; 23:VR7JazdVauys5PTJv9EJH/nwyZBDe+wSQ9UpwveLz?= =?us-ascii?Q?VjXPVwf/QcjqTXfI82IRuxGbLH55qrZzPUvd6efEvSIjB1bEDCfy8K8fWy7b?= =?us-ascii?Q?1wstZo7MgTEdom/k+w/66Yqjk1/XnjFRzOpvUdOrR2ta7O/imQod21H8psZh?= =?us-ascii?Q?XVWC9Jj/kMjvFwimHyrVNbt7tIuTrtImiyC2nxi9ZkZsY62QW2gzmziNn+E7?= =?us-ascii?Q?r8pwjGo9CXlKB+k2KeJy07hJwB5YMRKJ+sB98URHEGPV2ny/9PyOqIHb92h8?= =?us-ascii?Q?DchVRVjw/foPdX7EZ7gcP6FcV1Iipd/GuPFhgBwp82kmA8f5kWW2LZBtLT1X?= =?us-ascii?Q?elBzQgMlvomHBJzohSiamjMX1NZNRuxV+PnwNaQRak/5SIClgsG+fv1yx+oa?= =?us-ascii?Q?T/j/phuLk25J+pfqU0qjPOLd6edz5imi4X2jQY6zYzBSA9PQ6BQsxgA5/udw?= =?us-ascii?Q?56gU/X1ehxqba56L82W1SaAl92p3Nh8Y5dBbMgFKUtK7kyOlhZvBqt7jsyO4?= =?us-ascii?Q?h0ftYhK7h+SCPg4ZHr0sEAY8EAR/htIXMQW1Euiuedk6LuFjnx/l/TAWBbEB?= =?us-ascii?Q?Txpjpoqg/cIiecie15zmXSqMQAJ6CzVY0RENtXj6TLs0oKrG3MDZaKqkYZQW?= =?us-ascii?Q?oyZhaNJTei7hFP6KHRODCYNKnEH/WLi3XWuMFlrVTS4IV+jaBXkYHx5aHKlZ?= =?us-ascii?Q?1s4/ujo4ALGeRoD7ID5V5dmGtqiQ+xQVT+8oDqMQa0GYB/+sWmD0fx8qFU9X?= =?us-ascii?Q?a1ZB0yfymMlZboqdQ0e3Wga06T42V1tfI8cB+QDySdAFTxD7omnmUYBgRMU/?= =?us-ascii?Q?XBKTBBIi3sv2tkzYDPsxpX7U6yft0KkjBqDCLjl7O1asISH2OuHPfv0bR8d/?= =?us-ascii?Q?1NwgnYHEcn3UU4pVdiwYd4ByRpshnWm0sQQPpUeIE6BnEYLxcjO7HTkx9Jya?= =?us-ascii?Q?I5RWe7cfFaomVwuC/7/clpRPT2a2wGgUx/lmAChmGzV44TSBUovZ6IsMzaSf?= =?us-ascii?Q?DPoPsoiHyIRBQuIelylCIk1pzRhy5DG2/lASR2bHwGykEWL2bpv32ymfV4lt?= =?us-ascii?Q?GA/BGWRL2jP2eaHQXqOcW86DOdlwdKQSubCg4hVWTj+BSRV8YFPlkU49JwJ3?= =?us-ascii?Q?Ltx1qSlak/TFsB5AoaPX3LvPZfjkBC2gqZl10tAKyhtkJzUb+4OD/J1JBtgL?= =?us-ascii?Q?880PGgZSwokjWAs7dAcYLwfsMGTptBUQUeZCN2kLcsL7Cs3DcRPjSHrniY2z?= =?us-ascii?Q?vM6EjbFJe9O0SXp+aVVfaUx6Zsv/3UVEYAXs444wheumHWhCOxmI3StI7S6D?= =?us-ascii?B?QT09?= x-microsoft-antispam-prvs: x-forefront-prvs: 0951AB0A30 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(346002)(376002)(396003)(39860400002)(13464003)(51914003)(189003)(199004)(486006)(86362001)(2906002)(25786009)(316002)(110136005)(8936002)(11346002)(97736004)(446003)(476003)(229853002)(256004)(26005)(305945005)(6116002)(74316002)(186003)(14454004)(5660300002)(6436002)(7736002)(53936002)(3846002)(68736007)(81166006)(2171002)(8676002)(6506007)(71200400001)(53546011)(9686003)(107886003)(76176011)(99286004)(102836004)(7696005)(71190400001)(6246003)(55016002)(66066001)(105586002)(81156014)(106356001)(54906003)(33656002)(478600001)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5805; H:VI1PR05MB4269.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: sRB6r3tenkyhSZJi5xiks9oSd9HxpuauaJD4XmnYCcUUel7ZVjrppOv8+v4gZIDX/hFesjYsgnuGtqWbFrSq4UhALowPRz+00f6TIdni2vyBQSb7Zq224vqkeeM3/TJvGbftGq2hbAmSpmH2SZ8AdaAevC28LH4sVjHRv6GpGaOGYSMz/WmfkhaEmvAtfsU7aDK9KV2PoBFmabC2zBlzomHhQ5cxCzoUN5ji7vtoYx23WeRSEBcc97+ij5v8S9AMTOooru0Esoi/2vOMt2q9FhjQdn+u3WYuHsy0fPUqsyjHsIWPzd4XEr4FFMjG2MynfCW1WBY6Zv6Aq3/aIg9/2JMldPvJ0A+j9fgM1kPFtiHyunGwaEZkvOAVcsrGh68/aJ8T5qRjUwe24en3EK5hRriEuqAVfq8mbgSuKvJRNwQ= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54c5e24f-0ca7-4f26-5d74-08d694af36eb X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Feb 2019 08:09:17.9204 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5805 Subject: Re: [dpdk-ci] [PATCH v2] add script to decide best tree match for patches X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 08:09:19 -0000 Hi, Thanks for the feedback. I sent v3. Other comments are inline. > -----Original Message----- > From: Thomas Monjalon > Sent: Saturday, February 16, 2019 1:08 AM > To: Jeremy Plsek > Cc: Ali Alnubani ; ci@dpdk.org; > ferruh.yigit@intel.com; Ori Kam > Subject: Re: [PATCH v2] add script to decide best tree match for patches >=20 > Hi Jeremy, > Thanks for reviewing. > Some comments below: >=20 > 15/02/2019 22:28, Jeremy Plsek: > > We have a python script that we use to apply patches. With this > > current script, it's a little bit awkward to use inside our apply > > script. > > Right now it would look something like this inside of our apply script: > > (ggt =3D guess-git-tree) > > ggt.configure_git_pw(args) > > ggt.RULES =3D construct_rules() > > series =3D ggt.api_get('series', id) > > tree_list =3D list_trees_for_series(series) tree_list =3D > > get_ordered_matches(tree_list) # now attempt to apply patch to each > > tree until successful >=20 > I think you should call this script as a black box. Yes, the script was meant to be run as a black box. >=20 > > I'd rather see this implemented in a class, so that things like the > > construct_rules() and configure_git_pw() happens in the constructor, > > then I'd like to call something like get_ordered_tree_for_series(id) > > to get the list. >=20 > The idea behind dpdk-ci.git is to allow building a CI infrastructure by > assembling a collection of scripts. > If possible, we should keep each script independent and simple to use, in= the > Unix spirit. >=20 > > The constructor arguments would probably contain the server address > > and project. (Or you could make the server address also an environment > > variable like PATCHWORK_API_URL =3D os.getenv("PATCHWORK_API_URL", > > > > which is what we do in our scripts.) >=20 > The URL is not going to change anytime soon. > What is the benefit of reading it from an environment variable? > I see one benefit: allow to test with a test server. > I would be in favor of providing a default URL and allow to override with= an > environment variable. >=20 The script follows the git-pw configuration style, You can either set the environment variable PW_SERVER, or add the git confi= guration pw.server. Regards, Ali