All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] toaster: importlayer Update property names for importlayer api calls
@ 2015-09-28 18:13 Michael Wood
  2015-09-29  9:56 ` Barros Pena, Belen
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Wood @ 2015-09-28 18:13 UTC (permalink / raw)
  To: toaster

Update the property names used in checking for existing layers. The
server side API changed but not all references were updated.

[YOCTO #8300]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
 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 = $("#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);
 
     $(".fields-apart-from-layer-name").fadeOut(function(){
 
@@ -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 == 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 == name) {
+                layerExistsError(layer.results[i]);
               }
             }
           }
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: importlayer Update property names for importlayer api calls
  2015-09-28 18:13 [PATCH] toaster: importlayer Update property names for importlayer api calls Michael Wood
@ 2015-09-29  9:56 ` Barros Pena, Belen
  2015-09-29 10:28   ` Barros Pena, Belen
  0 siblings, 1 reply; 6+ messages in thread
From: Barros Pena, Belen @ 2015-09-29  9:56 UTC (permalink / raw)
  To: Wood, Michael G, toaster@yoctoproject.org



On 28/09/2015 19:13, "toaster-bounces@yoctoproject.org on behalf of
Michael Wood" <toaster-bounces@yoctoproject.org on behalf of
michael.g.wood@intel.com> 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: 

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. 

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én

>
>Signed-off-by: Michael Wood <michael.g.wood@intel.com>
>---
> 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 = $("#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);
> 
>     $(".fields-apart-from-layer-name").fadeOut(function(){
> 
>@@ -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 == 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 == name) {
>+                layerExistsError(layer.results[i]);
>               }
>             }
>           }
>-- 
>2.1.4
>
>-- 
>_______________________________________________
>toaster mailing list
>toaster@yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: importlayer Update property names for importlayer api calls
  2015-09-29  9:56 ` Barros Pena, Belen
@ 2015-09-29 10:28   ` Barros Pena, Belen
  2015-10-14 10:28     ` Michael Wood
  0 siblings, 1 reply; 6+ messages in thread
From: Barros Pena, Belen @ 2015-09-29 10:28 UTC (permalink / raw)
  To: Wood, Michael G, toaster@yoctoproject.org



On 29/09/2015 10:56, "Barros Pena, Belen" <belen.barros.pena@intel.com>
wrote:

>
>
>On 28/09/2015 19:13, "toaster-bounces@yoctoproject.org on behalf of
>Michael Wood" <toaster-bounces@yoctoproject.org on behalf of
>michael.g.wood@intel.com> 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: 
>
>importlayer.js:151 hint-layer-exists-with-different-url

My bad: it turns out we have a separate issue open for this

https://bugzilla.yoctoproject.org/show_bug.cgi?id=8051

Cheers,

Belén

>
>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. 
>
>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én
>
>>
>>Signed-off-by: Michael Wood <michael.g.wood@intel.com>
>>---
>> 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 = $("#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);
>> 
>>     $(".fields-apart-from-layer-name").fadeOut(function(){
>> 
>>@@ -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 == 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 == name) {
>>+                layerExistsError(layer.results[i]);
>>               }
>>             }
>>           }
>>-- 
>>2.1.4
>>
>>-- 
>>_______________________________________________
>>toaster mailing list
>>toaster@yoctoproject.org
>>https://lists.yoctoproject.org/listinfo/toaster
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: importlayer Update property names for importlayer api calls
  2015-09-29 10:28   ` Barros Pena, Belen
@ 2015-10-14 10:28     ` Michael Wood
  2015-10-14 11:12       ` Ed Bartosh
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Wood @ 2015-10-14 10:28 UTC (permalink / raw)
  To: Barros Pena, Belen, toaster@yoctoproject.org

Ping on submission/review of this patch.

On 29/09/15 11:28, Barros Pena, Belen wrote:
>
> On 29/09/2015 10:56, "Barros Pena, Belen" <belen.barros.pena@intel.com>
> wrote:
>
>>
>> On 28/09/2015 19:13, "toaster-bounces@yoctoproject.org on behalf of
>> Michael Wood" <toaster-bounces@yoctoproject.org on behalf of
>> michael.g.wood@intel.com> 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:
>>
>> importlayer.js:151 hint-layer-exists-with-different-url
> My bad: it turns out we have a separate issue open for this
>
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=8051
>
> Cheers,
>
> Belén
>
>> 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.
>>
>> 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én
>>
>>> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
>>> ---
>>> 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 = $("#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);
>>>
>>>      $(".fields-apart-from-layer-name").fadeOut(function(){
>>>
>>> @@ -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 == 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 == name) {
>>> +                layerExistsError(layer.results[i]);
>>>                }
>>>              }
>>>            }
>>> -- 
>>> 2.1.4
>>>
>>> -- 
>>> _______________________________________________
>>> toaster mailing list
>>> toaster@yoctoproject.org
>>> https://lists.yoctoproject.org/listinfo/toaster



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] toaster: importlayer Update property names for importlayer api calls
@ 2015-10-14 11:10 Ed Bartosh
  0 siblings, 0 replies; 6+ messages in thread
From: Ed Bartosh @ 2015-10-14 11:10 UTC (permalink / raw)
  To: bitbake-devel

Update the property names used in checking for existing layers. The
server side API changed but not all references were updated.

[YOCTO #8300]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 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 = $("#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);
 
     $(".fields-apart-from-layer-name").fadeOut(function(){
 
@@ -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 == 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 == name) {
+                layerExistsError(layer.results[i]);
               }
             }
           }
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: importlayer Update property names for importlayer api calls
  2015-10-14 10:28     ` Michael Wood
@ 2015-10-14 11:12       ` Ed Bartosh
  0 siblings, 0 replies; 6+ messages in thread
From: Ed Bartosh @ 2015-10-14 11:12 UTC (permalink / raw)
  To: Michael Wood; +Cc: toaster@yoctoproject.org

upstreamed and pushed to toaster-next

On Wed, Oct 14, 2015 at 11:28:17AM +0100, Michael Wood wrote:
> Ping on submission/review of this patch.
> 
> On 29/09/15 11:28, Barros Pena, Belen wrote:
> >
> >On 29/09/2015 10:56, "Barros Pena, Belen" <belen.barros.pena@intel.com>
> >wrote:
> >
> >>
> >>On 28/09/2015 19:13, "toaster-bounces@yoctoproject.org on behalf of
> >>Michael Wood" <toaster-bounces@yoctoproject.org on behalf of
> >>michael.g.wood@intel.com> 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:
> >>
> >>importlayer.js:151 hint-layer-exists-with-different-url
> >My bad: it turns out we have a separate issue open for this
> >
> >https://bugzilla.yoctoproject.org/show_bug.cgi?id=8051
> >
> >Cheers,
> >
> >Belén
> >
> >>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.
> >>
> >>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én
> >>
> >>>Signed-off-by: Michael Wood <michael.g.wood@intel.com>
> >>>---
> >>>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 = $("#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);
> >>>
> >>>     $(".fields-apart-from-layer-name").fadeOut(function(){
> >>>
> >>>@@ -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 == 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 == name) {
> >>>+                layerExistsError(layer.results[i]);
> >>>               }
> >>>             }
> >>>           }
> >>>-- 
> >>>2.1.4
> >>>
> >>>-- 
> >>>_______________________________________________
> >>>toaster mailing list
> >>>toaster@yoctoproject.org
> >>>https://lists.yoctoproject.org/listinfo/toaster
> 
> -- 
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster

-- 
--
Regards,
Ed


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-14 11:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28 18:13 [PATCH] toaster: importlayer Update property names for importlayer api calls Michael Wood
2015-09-29  9:56 ` Barros Pena, Belen
2015-09-29 10:28   ` Barros Pena, Belen
2015-10-14 10:28     ` Michael Wood
2015-10-14 11:12       ` Ed Bartosh
  -- strict thread matches above, loose matches on Subject: below --
2015-10-14 11:10 Ed Bartosh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.