Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id D7AA1E00EB8; Tue, 29 Sep 2015 02:56:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.65 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 40595E00A81 for ; Tue, 29 Sep 2015 02:56:55 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 29 Sep 2015 02:56:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,607,1437462000"; d="scan'208";a="570405953" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by FMSMGA003.fm.intel.com with ESMTP; 29 Sep 2015 02:56:50 -0700 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.164]) by IRSMSX106.ger.corp.intel.com ([169.254.8.110]) with mapi id 14.03.0248.002; Tue, 29 Sep 2015 10:56:47 +0100 From: "Barros Pena, Belen" To: "Wood, Michael G" , "toaster@yoctoproject.org" Thread-Topic: [Toaster] [PATCH] toaster: importlayer Update property names for importlayer api calls Thread-Index: AQHQ+p0mQnFmoZ/Cz0CFC2fO3bc/PQ== Date: Tue, 29 Sep 2015 09:56:46 +0000 Message-ID: References: <1443463980-9832-1-git-send-email-michael.g.wood@intel.com> In-Reply-To: <1443463980-9832-1-git-send-email-michael.g.wood@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.5.5.150821 x-originating-ip: [10.237.224.32] MIME-Version: 1.0 Subject: Re: [PATCH] toaster: importlayer Update property names for importlayer api calls X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2015 09:56:56 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-ID: <266D9383BA8E204CB0DC190CB0BABDD8@intel.com> Content-Transfer-Encoding: quoted-printable On 28/09/2015 19:13, "toaster-bounces@yoctoproject.org on behalf of Michael Wood" wrote: >Update the property names used in checking for existing layers. The >server side API changed but not all references were updated. > >[YOCTO #8300] If I try to import a layer with the same name as a layer listed in the all layers table for the project, I get the correct behaviour: the import layer form disappears and I get the notification telling me that a layer with that name already exists. However, if I try to import a layer with a name I know exists in the database, but the layer is not listed in the all layers table for the project, and I provide a different Git URL to the one in the database for the layer with that name, I am allowed to continue filling the form, but when I click the import layer button nothing happens. The browser console shows:=20 importlayer.js:151 hint-layer-exists-with-different-url To reproduce, create a project with the local release, go to the import layer page, type meta-oe as the layer name, then some gibberish as the git url.=20 Ideally, if no layer with the name I've typed exists in the project, I should be allowed to import it. If the name and the git url match the entry in the database, maybe we create a new layer version. If the git url is different, we create a different layer entry. If this is too complicated, we can come up with a message explaining the issue and handle the problem in the same way we handle the layer name. Cheers Bel=E9n > >Signed-off-by: Michael Wood >--- > bitbake/lib/toaster/toastergui/static/js/importlayer.js | 13 >++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > >diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js >b/bitbake/lib/toaster/toastergui/static/js/importlayer.js >index 2fadbc0..c68f366 100644 >--- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js >+++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js >@@ -195,8 +195,8 @@ function importLayerPageInit (ctx) { > var dupLayerInfo =3D $("#duplicate-layer-info"); > dupLayerInfo.find(".dup-layer-name").text(layer.name); > dupLayerInfo.find(".dup-layer-link").attr("href", >layer.layerdetailurl); >- dupLayerInfo.find("#dup-layer-vcs-url").text(layer.layer__vcs_url); >- dupLayerInfo.find("#dup-layer-revision").text(layer.revision.commit); >+ dupLayerInfo.find("#dup-layer-vcs-url").text(layer.vcs_url); >+ dupLayerInfo.find("#dup-layer-revision").text(layer.vcs_reference); >=20 > $(".fields-apart-from-layer-name").fadeOut(function(){ >=20 >@@ -214,11 +214,10 @@ function importLayerPageInit (ctx) { > $.getJSON(libtoaster.ctx.layersTypeAheadUrl, > { include_added: "true" , search: name, format: "json" }, > function(layer) { >- if (layer.rows.length > 0) { >- for (var i in layer.rows){ >- if (layer.rows[i].name =3D=3D name) { >- console.log(layer.rows[i]) >- layerExistsError(layer.rows[i]); >+ if (layer.results.length > 0) { >+ for (var i in layer.results){ >+ if (layer.results[i].name =3D=3D name) { >+ layerExistsError(layer.results[i]); > } > } > } >--=20 >2.1.4 > >--=20 >_______________________________________________ >toaster mailing list >toaster@yoctoproject.org >https://lists.yoctoproject.org/listinfo/toaster