From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id AC86C1B4CF for ; Sat, 16 Feb 2019 00:08:28 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 315C821E71; Fri, 15 Feb 2019 18:08:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 15 Feb 2019 18:08:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=HsntXiz3HdbuGVwM9j3qG9iaYkNhz54W2OCe3c9HzWM=; b=brodJA+QkQfJ KugnSJ3LzImpVydR4VYNE0gmY9xusnEPeeaV+Uqwmb1BngvFqJAKpr6XTuOEIZNs CdFtJ2vZ3yYL1AvzKw8b+2HKRgayQDCeF9NbQ3/nD7MbAYBBr3yN9op6bhBoD+6f q0QmcEzci1MTLO3iWH6UvKPnk0ZSGDw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=HsntXiz3HdbuGVwM9j3qG9iaYkNhz54W2OCe3c9Hz WM=; b=Qic2Sncf6XQCkUh3oCYDv7D5Bl/Uy7+Mw0P8/yxIC5IxImw/NG3+HLygq iS6tikyR/DeqMtYx85peGNc3nJVLkqRG45kHFFBq3nO8flc/XSaUBPE5CJOteHqK wAYGHmSrka7OiFw1ow6ImuWWO3kzI3MHPmHKr9yhANA5NhrRHtjN/clpp/pX7YVm eeZVDjuUij5Nvc1PKO+5xamzMPpF19jjvxn7vF57jgDgrK2qiYqygzlDcfGLWYsL FMPyVlKf2lbLvmBW6fheN6PZ8uL0s4LSkWdhLCGTr/qbWY2jAd8mpDe/2IB1iPvM XnAt4P7TGOD6X8WqhL+YmyjYw/HTw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtkedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjg hfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcu oehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffohhmrghinhepughpughkrd horhhgnecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhf rhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiii gvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id EA2F5100E5; Fri, 15 Feb 2019 18:08:26 -0500 (EST) From: Thomas Monjalon To: Jeremy Plsek Cc: Ali Alnubani , "ci@dpdk.org" , "ferruh.yigit@intel.com" , Ori Kam Date: Sat, 16 Feb 2019 00:08:25 +0100 Message-ID: <5917852.0VcOUA9y90@xps> In-Reply-To: References: <20190212144828.18122-1-alialnu@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Fri, 15 Feb 2019 23:08:29 -0000 Hi Jeremy, Thanks for reviewing. Some comments below: 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 = guess-git-tree) > ggt.configure_git_pw(args) > ggt.RULES = construct_rules() > series = ggt.api_get('series', id) > tree_list = list_trees_for_series(series) > tree_list = get_ordered_matches(tree_list) > # now attempt to apply patch to each tree until successful I think you should call this script as a black box. > 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. 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. > 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 = > os.getenv("PATCHWORK_API_URL", "http://patches.dpdk.org/api/1.0/"), > which is what we do in our scripts.) 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.