All of lore.kernel.org
 help / color / mirror / Atom feed
* Usage of already cloned layers in toaster
@ 2015-07-23  6:14 Haridasan, Sujith
  0 siblings, 0 replies; 20+ messages in thread
From: Haridasan, Sujith @ 2015-07-23  6:14 UTC (permalink / raw)
  To: toaster@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

Hi all,

My query in yesterday's meeting was, let's say I have locally cloned layer for example: meta-qt5 and its dependencies like meta-ruby and meta-oe.
Then would it be possible to use it with toaster (rather than toaster cloning layers by itself) ? If so what would be the extra efforts that needs to be put.
Let me know if more inputs are needed from me so that I can help team understand the requirement.

Thanks,
Sujith H

[-- Attachment #2: Type: text/html, Size: 2560 bytes --]

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

* Re: Usage of already cloned layers in toaster
@ 2015-07-24  9:37 Haridasan, Sujith
  0 siblings, 0 replies; 20+ messages in thread
From: Haridasan, Sujith @ 2015-07-24  9:37 UTC (permalink / raw)
  To: toaster@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

Hi All,

Gentle ping . Any hint regarding my query?

Thanks,
Sujith H

From: Haridasan, Sujith
Sent: 23 July 2015 11:44
To: toaster@yoctoproject.org
Subject: Usage of already cloned layers in toaster

Hi all,

My query in yesterday's meeting was, let's say I have locally cloned layer for example: meta-qt5 and its dependencies like meta-ruby and meta-oe.
Then would it be possible to use it with toaster (rather than toaster cloning layers by itself) ? If so what would be the extra efforts that needs to be put.
Let me know if more inputs are needed from me so that I can help team understand the requirement.

Thanks,
Sujith H

[-- Attachment #2: Type: text/html, Size: 3904 bytes --]

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

* Re: Usage of already cloned layers in toaster
@ 2015-07-24  9:56 Barros Pena, Belen
  2015-07-24 10:21 ` Damian, Alexandru
  2015-07-24 12:57 ` sujith h
  0 siblings, 2 replies; 20+ messages in thread
From: Barros Pena, Belen @ 2015-07-24  9:56 UTC (permalink / raw)
  To: Haridasan, Sujith, toaster@yoctoproject.org



On 24/07/2015 10:37, "toaster-bounces@yoctoproject.org on behalf of
Haridasan, Sujith" <toaster-bounces@yoctoproject.org on behalf of
Sujith_Haridasan@mentor.com> wrote:

>Hi All,
> 
>Gentle ping . 

Hi Sujith: sorry for the delay in getting back to you. We don't deserve a
gentle ping: we need a hard poke! ;)

Answer below. 


>Any hint regarding my query?
>
> 
>Thanks,
>Sujith H
> 
>From: Haridasan,
> Sujith 
>Sent: 23 July 2015 11:44
>To: toaster@yoctoproject.org
>Subject: Usage of already cloned layers in toaster
>
>
> 
>Hi all,
> 
>My query in yesterday¹s meeting was, let¹s say I have locally cloned
>layer for example: meta-qt5 and its dependencies like meta-ruby and
>meta-oe.
>Then would it be possible to use it with toaster (rather than toaster
>cloning layers by itself) ?

You have 2 ways of doing this:

1. Use the import layer functionality. This is how:

* In the project page, click the "import layer" link you will find below
the add layers text field.
* Provide the required information for meta-qt5, meta-ruby and meta-oe.
Note that:

1. Toaster will force you to rename the layers (for example to
meta-qt5-local or something like that) since Toaster requires layer names
to be unique. 
2. In the Git repository URL field, enter the full path to the local layer
you have cloned
3. In the Revision field, enter the branch, tag or commit of the local
layers you want to use. You should also be able to set the revision to
HEAD here, and I believe that should use the tip of the current local
branch. Alex, please correct me if I am wrong

If you import your own versions of meta-oe and meta-ruby before meta-qt5
you can also set the layer dependencies for your meta-qt5-local to your
imported layers using the Layer dependencies at the bottom of the import
layer page. 

2. The second way involves creating your own release by editing the
toasterconf.json file that you will find inside the meta-yocto layer, in
the /conf directory. In the releases section, create your own release,
following the format of the release called 'local', and setting the branch
and the default layers as you need them. Alex or Michael should be able to
give you more information on how to use this second option.

Let us know how you get on, and if you need anything else.

Cheers

Belén


>If so what would be the extra efforts that needs to be put.
>Let me know if more inputs are needed from me so that I can help team
>understand the requirement.
> 
>Thanks,
>Sujith H
>



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

* Re: Usage of already cloned layers in toaster
  2015-07-24  9:56 Usage of already cloned layers in toaster Barros Pena, Belen
@ 2015-07-24 10:21 ` Damian, Alexandru
  2015-07-24 12:57 ` sujith h
  1 sibling, 0 replies; 20+ messages in thread
From: Damian, Alexandru @ 2015-07-24 10:21 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 3517 bytes --]

Hi,

An important highlight below, regarding the use of toasterconf.json files.

Cheers,
Alex

On Fri, Jul 24, 2015 at 10:56 AM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 24/07/2015 10:37, "toaster-bounces@yoctoproject.org on behalf of
> Haridasan, Sujith" <toaster-bounces@yoctoproject.org on behalf of
> Sujith_Haridasan@mentor.com> wrote:
>
> >Hi All,
> >
> >Gentle ping .
>
> Hi Sujith: sorry for the delay in getting back to you. We don't deserve a
> gentle ping: we need a hard poke! ;)
>
> Answer below.
>
>
> >Any hint regarding my query?
> >
> >
> >Thanks,
> >Sujith H
> >
> >From: Haridasan,
> > Sujith
> >Sent: 23 July 2015 11:44
> >To: toaster@yoctoproject.org
> >Subject: Usage of already cloned layers in toaster
> >
> >
> >
> >Hi all,
> >
> >My query in yesterday¹s meeting was, let¹s say I have locally cloned
> >layer for example: meta-qt5 and its dependencies like meta-ruby and
> >meta-oe.
> >Then would it be possible to use it with toaster (rather than toaster
> >cloning layers by itself) ?
>
> You have 2 ways of doing this:
>
> 1. Use the import layer functionality. This is how:
>
> * In the project page, click the "import layer" link you will find below
> the add layers text field.
> * Provide the required information for meta-qt5, meta-ruby and meta-oe.
> Note that:
>
> 1. Toaster will force you to rename the layers (for example to
> meta-qt5-local or something like that) since Toaster requires layer names
> to be unique.
> 2. In the Git repository URL field, enter the full path to the local layer
> you have cloned
> 3. In the Revision field, enter the branch, tag or commit of the local
> layers you want to use. You should also be able to set the revision to
> HEAD here, and I believe that should use the tip of the current local
> branch. Alex, please correct me if I am wrong
>
> If you import your own versions of meta-oe and meta-ruby before meta-qt5
> you can also set the layer dependencies for your meta-qt5-local to your
> imported layers using the Layer dependencies at the bottom of the import
> layer page.
>
> 2. The second way involves creating your own release by editing the
> toasterconf.json file that you will find inside the meta-yocto layer, in
> the /conf directory. In the releases section, create your own release,
> following the format of the release called 'local', and setting the branch
> and the default layers as you need them. Alex or Michael should be able to
> give you more information on how to use this second option.
>

​The important part here is to recognize that the toasterconf.json file is
a *layer* configuration file, not a *toaster* configuration file. This
means that if you have your own custom layer, you should create a
toasterconf.​json file for your layer, and import that into Toaster (using
the *manage.py loadconf* command), rather than modifying other's layer
configuration file.




>
> Let us know how you get on, and if you need anything else.
>
> Cheers
>
> Belén
>
>
> >If so what would be the extra efforts that needs to be put.
> >Let me know if more inputs are needed from me so that I can help team
> >understand the requirement.
> >
> >Thanks,
> >Sujith H
> >
>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>



-- 
Alex Damian
Yocto Project
SSG / OTC

[-- Attachment #2: Type: text/html, Size: 5429 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-24  9:56 Usage of already cloned layers in toaster Barros Pena, Belen
  2015-07-24 10:21 ` Damian, Alexandru
@ 2015-07-24 12:57 ` sujith h
  2015-07-24 13:06   ` Barros Pena, Belen
  1 sibling, 1 reply; 20+ messages in thread
From: sujith h @ 2015-07-24 12:57 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster@yoctoproject.org


[-- Attachment #1.1: Type: text/plain, Size: 3412 bytes --]

On Fri, Jul 24, 2015 at 3:26 PM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 24/07/2015 10:37, "toaster-bounces@yoctoproject.org on behalf of
> Haridasan, Sujith" <toaster-bounces@yoctoproject.org on behalf of
> Sujith_Haridasan@mentor.com> wrote:
>
> >Hi All,
> >
> >Gentle ping .
>
> Hi Sujith: sorry for the delay in getting back to you. We don't deserve a
> gentle ping: we need a hard poke! ;)
>
> Answer below.
>
>
> >Any hint regarding my query?
> >
> >
> >Thanks,
> >Sujith H
> >
> >From: Haridasan,
> > Sujith
> >Sent: 23 July 2015 11:44
> >To: toaster@yoctoproject.org
> >Subject: Usage of already cloned layers in toaster
> >
> >
> >
> >Hi all,
> >
> >My query in yesterday¹s meeting was, let¹s say I have locally cloned
> >layer for example: meta-qt5 and its dependencies like meta-ruby and
> >meta-oe.
> >Then would it be possible to use it with toaster (rather than toaster
> >cloning layers by itself) ?
>
> You have 2 ways of doing this:
>
> 1. Use the import layer functionality. This is how:
>
> * In the project page, click the "import layer" link you will find below
> the add layers text field.
> * Provide the required information for meta-qt5, meta-ruby and meta-oe.
> Note that:
>
> 1. Toaster will force you to rename the layers (for example to
> meta-qt5-local or something like that) since Toaster requires layer names
> to be unique.
> 2. In the Git repository URL field, enter the full path to the local layer
> you have cloned
> 3. In the Revision field, enter the branch, tag or commit of the local
> layers you want to use. You should also be able to set the revision to
> HEAD here, and I believe that should use the tip of the current local
> branch. Alex, please correct me if I am wrong
>
> If you import your own versions of meta-oe and meta-ruby before meta-qt5
> you can also set the layer dependencies for your meta-qt5-local to your
> imported layers using the Layer dependencies at the bottom of the import
> layer page.
>

When I try to add a locally cloned meta-openembedded in my machine and then
click on "Import and add to project", nothing happens. The intention is to
add meta-oe layer from meta-openembedded. The webpage remains as it is.
Attaching the screenshot for the same.


> 2. The second way involves creating your own release by editing the
> toasterconf.json file that you will find inside the meta-yocto layer, in
> the /conf directory. In the releases section, create your own release,
> following the format of the release called 'local', and setting the branch
> and the default layers as you need them. Alex or Michael should be able to
> give you more information on how to use this second option.
>
> Let us know how you get on, and if you need anything else.
>
> Cheers
>
> Belén
>
>
> >If so what would be the extra efforts that needs to be put.
> >Let me know if more inputs are needed from me so that I can help team
> >understand the requirement.
> >
> >Thanks,
> >Sujith H
> >
>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #1.2: Type: text/html, Size: 4936 bytes --]

[-- Attachment #2: Import_Layer.png --]
[-- Type: image/png, Size: 120955 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-24 12:57 ` sujith h
@ 2015-07-24 13:06   ` Barros Pena, Belen
  2015-07-27  6:54     ` sujith h
  0 siblings, 1 reply; 20+ messages in thread
From: Barros Pena, Belen @ 2015-07-24 13:06 UTC (permalink / raw)
  To: sujith h; +Cc: toaster@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]



On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com> wrote:

>
>If you import your own versions of meta-oe and meta-ruby before meta-qt5
>you can also set the layer dependencies for your meta-qt5-local to your
>imported layers using the Layer dependencies at the bottom of the import
>layer page. 
>
>
>
>When I try to add a locally cloned meta-openembedded in my machine and
>then
>
>click on "Import and add to project", nothing happens. The intention is
>to add meta-oe layer from meta-openembedded. The webpage remains as it is.
>
>Attaching the screenshot for the same.

That looks like a bug: when I type meta-oe on the layer name field,
Toaster stops me from continuing because a layer with that name already
exists (see screenshot attached). That mechanism should be also triggered
in your case, unless you are using the Yocto Project Local release. Can
you give me some extra details, so I can try to reproduce?

* Which version of Yocto Project you are using (fido or master)?
* Which release you have selected for your project?
* If you click the "view all compatible layers" link and in that page you
search for meta-oe, do you get any results?

Thanks!!

Belén

>


[-- Attachment #2: meta-oe-already-exists.png --]
[-- Type: image/png, Size: 104907 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-24 13:06   ` Barros Pena, Belen
@ 2015-07-27  6:54     ` sujith h
  2015-07-27 10:09       ` Barros Pena, Belen
  0 siblings, 1 reply; 20+ messages in thread
From: sujith h @ 2015-07-27  6:54 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster@yoctoproject.org


[-- Attachment #1.1: Type: text/plain, Size: 2520 bytes --]

On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com> wrote:
>
> >
> >If you import your own versions of meta-oe and meta-ruby before meta-qt5
> >you can also set the layer dependencies for your meta-qt5-local to your
> >imported layers using the Layer dependencies at the bottom of the import
> >layer page.
> >
> >
> >
> >When I try to add a locally cloned meta-openembedded in my machine and
> >then
> >
> >click on "Import and add to project", nothing happens. The intention is
> >to add meta-oe layer from meta-openembedded. The webpage remains as it is.
> >
> >Attaching the screenshot for the same.
>
> That looks like a bug: when I type meta-oe on the layer name field,
> Toaster stops me from continuing because a layer with that name already
> exists (see screenshot attached). That mechanism should be also triggered
> in your case, unless you are using the Yocto Project Local release. Can
> you give me some extra details, so I can try to reproduce?
>
> * Which version of Yocto Project you are using (fido or master)?
>

I am using fido branch.

> * Which release you have selected for your project?
>
In the release I have selected "Local Yocto Project"

> * If you click the "view all compatible layers" link and in that page you
> search for meta-oe, do you get any results?
>

I can see only "meta-yocto-bsp", "meta-yocto" and "openembedded-core".
Attached screenshot of the same.

Also attaching screenshot of page where I try to import meta-oe from my
locally cloned location.

Below is the file structure I have:

sujith@kdekid:~/MEL/homework$ pwd
/home/sujith/MEL/homework
sujith@kdekid:~/MEL/homework$ ls -l
total 5180
drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40 meta-oe-local
drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04 meta-openembedded-local
drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02 meta-qt5-local
drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08 toaster_build_artifacts
-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19 toaster.sqlite
drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
sujith@kdekid:~/MEL/homework$


Let me know if more details are required.


Thanks,
Sujith H


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #1.2: Type: text/html, Size: 3645 bytes --]

[-- Attachment #2: ViewAllCompatibleLayers.png --]
[-- Type: image/png, Size: 129816 bytes --]

[-- Attachment #3: ImportLayer_NotWorking.png --]
[-- Type: image/png, Size: 127293 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-27  6:54     ` sujith h
@ 2015-07-27 10:09       ` Barros Pena, Belen
  2015-07-27 10:29         ` Barros Pena, Belen
  2015-07-27 10:31         ` sujith h
  0 siblings, 2 replies; 20+ messages in thread
From: Barros Pena, Belen @ 2015-07-27 10:09 UTC (permalink / raw)
  To: sujith h; +Cc: toaster@yoctoproject.org



On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com> wrote:

>
>
>On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
><belen.barros.pena@intel.com> wrote:
>
>
>
>On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com> wrote:
>
>
>* Which version of Yocto Project you are using (fido or master)?
>
>I am using fido branch.
>
>
>* Which release you have selected for your project?
>
>
>In the release I have selected "Local Yocto Project"
>
>
>* If you click the "view all compatible layers" link and in that page you
>search for meta-oe, do you get any results?
>
>I can see only "meta-yocto-bsp", "meta-yocto" and "openembedded-core".
>Attached screenshot of the same.
>
>
>Also attaching screenshot of page where I try to import meta-oe from my
>locally cloned location.
>
>
>Below is the file structure I have:
>
>sujith@kdekid:~/MEL/homework$ pwd
>/home/sujith/MEL/homework
>sujith@kdekid:~/MEL/homework$ ls -l
>total 5180
>drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40 meta-oe-local
>drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04 meta-openembedded-local
>drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02 meta-qt5-local
>drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
>drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08 toaster_build_artifacts
>-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19 toaster.sqlite
>drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
>sujith@kdekid:~/MEL/homework$
>

Right, I've managed to reproduce this. Looking at the browser console, it
might be a problem with the javascript doing the layer name validation. If
you change the layer name to something completely random that does not
exist in the Toaster database (something like meta-xyz), can you import
the layer?

Cheers

Belén

>
>
>Let me know if more details are required.
>
>
>
>Thanks,
>
>Sujith H
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>


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

* Re: Usage of already cloned layers in toaster
  2015-07-27 10:09       ` Barros Pena, Belen
@ 2015-07-27 10:29         ` Barros Pena, Belen
  2015-07-27 10:38           ` sujith h
  2015-07-27 10:31         ` sujith h
  1 sibling, 1 reply; 20+ messages in thread
From: Barros Pena, Belen @ 2015-07-27 10:29 UTC (permalink / raw)
  To: Barros Pena, Belen, sujith h; +Cc: toaster@yoctoproject.org

I've opened https://bugzilla.yoctoproject.org/show_bug.cgi?id=8051 to
track this.

Belén

On 27/07/2015 11:09, "toaster-bounces@yoctoproject.org on behalf of Barros
Pena, Belen" <toaster-bounces@yoctoproject.org on behalf of
belen.barros.pena@intel.com> wrote:

>
>
>On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com> wrote:
>
>>
>>
>>On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
>><belen.barros.pena@intel.com> wrote:
>>
>>
>>
>>On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com> wrote:
>>
>>
>>* Which version of Yocto Project you are using (fido or master)?
>>
>>I am using fido branch.
>>
>>
>>* Which release you have selected for your project?
>>
>>
>>In the release I have selected "Local Yocto Project"
>>
>>
>>* If you click the "view all compatible layers" link and in that page you
>>search for meta-oe, do you get any results?
>>
>>I can see only "meta-yocto-bsp", "meta-yocto" and "openembedded-core".
>>Attached screenshot of the same.
>>
>>
>>Also attaching screenshot of page where I try to import meta-oe from my
>>locally cloned location.
>>
>>
>>Below is the file structure I have:
>>
>>sujith@kdekid:~/MEL/homework$ pwd
>>/home/sujith/MEL/homework
>>sujith@kdekid:~/MEL/homework$ ls -l
>>total 5180
>>drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40 meta-oe-local
>>drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04 meta-openembedded-local
>>drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02 meta-qt5-local
>>drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
>>drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08 toaster_build_artifacts
>>-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19 toaster.sqlite
>>drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
>>sujith@kdekid:~/MEL/homework$
>>
>
>Right, I've managed to reproduce this. Looking at the browser console, it
>might be a problem with the javascript doing the layer name validation. If
>you change the layer name to something completely random that does not
>exist in the Toaster database (something like meta-xyz), can you import
>the layer?
>
>Cheers
>
>Belén
>
>>
>>
>>Let me know if more details are required.
>>
>>
>>
>>Thanks,
>>
>>Sujith H
>>
>>
>>
>>
>>-- 
>>സുജിത് ഹരിദാസന്
>>Bangalore
>><Project>Contributor to KDE project
>>http://fci.wikia.com/wiki/Anti-DRM-Campaign
>><Blog> http://sujithh.info
>>
>>
>>
>
>-- 
>_______________________________________________
>toaster mailing list
>toaster@yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster


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

* Re: Usage of already cloned layers in toaster
  2015-07-27 10:09       ` Barros Pena, Belen
  2015-07-27 10:29         ` Barros Pena, Belen
@ 2015-07-27 10:31         ` sujith h
  2015-07-27 13:25           ` Michael Wood
  1 sibling, 1 reply; 20+ messages in thread
From: sujith h @ 2015-07-27 10:31 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster@yoctoproject.org


[-- Attachment #1.1: Type: text/plain, Size: 3097 bytes --]

On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com> wrote:
>
> >
> >
> >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
> ><belen.barros.pena@intel.com> wrote:
> >
> >
> >
> >On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com> wrote:
> >
> >
> >* Which version of Yocto Project you are using (fido or master)?
> >
> >I am using fido branch.
> >
> >
> >* Which release you have selected for your project?
> >
> >
> >In the release I have selected "Local Yocto Project"
> >
> >
> >* If you click the "view all compatible layers" link and in that page you
> >search for meta-oe, do you get any results?
> >
> >I can see only "meta-yocto-bsp", "meta-yocto" and "openembedded-core".
> >Attached screenshot of the same.
> >
> >
> >Also attaching screenshot of page where I try to import meta-oe from my
> >locally cloned location.
> >
> >
> >Below is the file structure I have:
> >
> >sujith@kdekid:~/MEL/homework$ pwd
> >/home/sujith/MEL/homework
> >sujith@kdekid:~/MEL/homework$ ls -l
> >total 5180
> >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40 meta-oe-local
> >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04 meta-openembedded-local
> >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02 meta-qt5-local
> >drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
> >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08 toaster_build_artifacts
> >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19 toaster.sqlite
> >drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
> >sujith@kdekid:~/MEL/homework$
> >
>
> Right, I've managed to reproduce this. Looking at the browser console, it
> might be a problem with the javascript doing the layer name validation. If
> you change the layer name to something completely random that does not
> exist in the Toaster database (something like meta-xyz), can you import
> the layer?
>

Am bit new to the web world. So I gave a try with firebug to debug which
script ( Javascript or any ) call happens
when I click "Import  and add to project" button. Even after changing
meta-oe repo to meta-xyz as per suggestion,
the result remains same. But this is the output I see in the firebug
console:

{"current_id": 5, "current_url":
"git://git.openembedded.org/meta-openembedded", "error":
"hint-layer-exists-with-different-url"}

hint-layer-exists-with-different-url

Also attaching the screenshot of the same ( to get more clarity ).

Thanks,
Sujith H



> Cheers
>
> Belén
>
> >
> >
> >Let me know if more details are required.
> >
> >
> >
> >Thanks,
> >
> >Sujith H
> >
> >
> >
> >
> >--
> >സുജിത് ഹരിദാസന്
> >Bangalore
> ><Project>Contributor to KDE project
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><Blog> http://sujithh.info
> >
> >
> >
>
>


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #1.2: Type: text/html, Size: 5217 bytes --]

[-- Attachment #2: Toaster_Browser_console.png --]
[-- Type: image/png, Size: 176773 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-27 10:29         ` Barros Pena, Belen
@ 2015-07-27 10:38           ` sujith h
  2015-07-27 10:59             ` Barros Pena, Belen
  0 siblings, 1 reply; 20+ messages in thread
From: sujith h @ 2015-07-27 10:38 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 3395 bytes --]

On Mon, Jul 27, 2015 at 3:59 PM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

> I've opened https://bugzilla.yoctoproject.org/show_bug.cgi?id=8051 to
> track this.
>

Thank you Belen. If some guidance can be given then may be I can also debug
on this ( Since I am in learning phase ). A small thought though:
If repos are provided locally then name shouldn't matter, as far as layer
name is unique or consistent throughout,
right? Pardon me if I am completely wrong :)

Thanks,
Sujith H


>
> Belén
>
> On 27/07/2015 11:09, "toaster-bounces@yoctoproject.org on behalf of Barros
> Pena, Belen" <toaster-bounces@yoctoproject.org on behalf of
> belen.barros.pena@intel.com> wrote:
>
> >
> >
> >On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com> wrote:
> >
> >>
> >>
> >>On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
> >><belen.barros.pena@intel.com> wrote:
> >>
> >>
> >>
> >>On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com> wrote:
> >>
> >>
> >>* Which version of Yocto Project you are using (fido or master)?
> >>
> >>I am using fido branch.
> >>
> >>
> >>* Which release you have selected for your project?
> >>
> >>
> >>In the release I have selected "Local Yocto Project"
> >>
> >>
> >>* If you click the "view all compatible layers" link and in that page you
> >>search for meta-oe, do you get any results?
> >>
> >>I can see only "meta-yocto-bsp", "meta-yocto" and "openembedded-core".
> >>Attached screenshot of the same.
> >>
> >>
> >>Also attaching screenshot of page where I try to import meta-oe from my
> >>locally cloned location.
> >>
> >>
> >>Below is the file structure I have:
> >>
> >>sujith@kdekid:~/MEL/homework$ pwd
> >>/home/sujith/MEL/homework
> >>sujith@kdekid:~/MEL/homework$ ls -l
> >>total 5180
> >>drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40 meta-oe-local
> >>drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04 meta-openembedded-local
> >>drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02 meta-qt5-local
> >>drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
> >>drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08 toaster_build_artifacts
> >>-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19 toaster.sqlite
> >>drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
> >>sujith@kdekid:~/MEL/homework$
> >>
> >
> >Right, I've managed to reproduce this. Looking at the browser console, it
> >might be a problem with the javascript doing the layer name validation. If
> >you change the layer name to something completely random that does not
> >exist in the Toaster database (something like meta-xyz), can you import
> >the layer?
> >
> >Cheers
> >
> >Belén
> >
> >>
> >>
> >>Let me know if more details are required.
> >>
> >>
> >>
> >>Thanks,
> >>
> >>Sujith H
> >>
> >>
> >>
> >>
> >>--
> >>സുജിത് ഹരിദാസന്
> >>Bangalore
> >><Project>Contributor to KDE project
> >>http://fci.wikia.com/wiki/Anti-DRM-Campaign
> >><Blog> http://sujithh.info
> >>
> >>
> >>
> >
> >--
> >_______________________________________________
> >toaster mailing list
> >toaster@yoctoproject.org
> >https://lists.yoctoproject.org/listinfo/toaster
>
>


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 5667 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-27 10:38           ` sujith h
@ 2015-07-27 10:59             ` Barros Pena, Belen
  0 siblings, 0 replies; 20+ messages in thread
From: Barros Pena, Belen @ 2015-07-27 10:59 UTC (permalink / raw)
  To: sujith h; +Cc: toaster@yoctoproject.org



On 27/07/2015 11:38, "sujith h" <sujith.h@gmail.com> wrote:

>
>
>On Mon, Jul 27, 2015 at 3:59 PM, Barros Pena, Belen
><belen.barros.pena@intel.com> wrote:
>
>I've opened 
>https://bugzilla.yoctoproject.org/show_bug.cgi?id=8051
><https://bugzilla.yoctoproject.org/show_bug.cgi?id=8051> to
>track this.
>
>
>
>
>Thank you Belen. If some guidance can be given then may be I can also
>debug on this ( Since I am in learning phase ).

Sure. I've assigned the issue to Michael because he normally works on this
kind of thing, but feel free to take it or work with him :)

> A small thought though:
>
>If repos are provided locally then name shouldn't matter, as far as layer
>name is unique or consistent throughout,
>
>right? Pardon me if I am completely wrong :)

You are not wrong at all! :) We had lots of discussions as to how this
should work. If I remember correctly, the combination of layer name + git
url should be unique. You could in theory have two layers with the same
name as long as they point to different git repos; and even two layers
pointing to the same git repo as long as they have different names. But we
were having trouble implementing this, so to simplify things a little bit,
we set a rule saying that layer names within a certain project should be
unique. The bug you found seems connected to this, since it looks like
Toaster might be complaining about layer names existing in other projects.

This doesn't mean this is the right thing to do though: we should probably
think about this again at some point. If you have any ideas, let us know :)

Belén


>
>
>Thanks,
>
>Sujith H
>
> 
>
>
>
>Belén
>
>On 27/07/2015 11:09, "toaster-bounces@yoctoproject.org on behalf of Barros
>Pena, Belen" <toaster-bounces@yoctoproject.org on behalf of
>belen.barros.pena@intel.com> wrote:
>
>>
>>
>>On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com> wrote:
>>
>>>
>>>
>>>On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
>>><belen.barros.pena@intel.com> wrote:
>>>
>>>
>>>
>>>On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com> wrote:
>>>
>>>
>>>* Which version of Yocto Project you are using (fido or master)?
>>>
>>>I am using fido branch.
>>>
>>>
>>>* Which release you have selected for your project?
>>>
>>>
>>>In the release I have selected "Local Yocto Project"
>>>
>>>
>>>* If you click the "view all compatible layers" link and in that page
>>>you
>>>search for meta-oe, do you get any results?
>>>
>>>I can see only "meta-yocto-bsp", "meta-yocto" and "openembedded-core".
>>>Attached screenshot of the same.
>>>
>>>
>>>Also attaching screenshot of page where I try to import meta-oe from my
>>>locally cloned location.
>>>
>>>
>>>Below is the file structure I have:
>>>
>>>sujith@kdekid:~/MEL/homework$ pwd
>>>/home/sujith/MEL/homework
>>>sujith@kdekid:~/MEL/homework$ ls -l
>>>total 5180
>>>drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40 meta-oe-local
>>>drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04 meta-openembedded-local
>>>drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02 meta-qt5-local
>>>drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
>>>drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08 toaster_build_artifacts
>>>-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19 toaster.sqlite
>>>drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
>>>sujith@kdekid:~/MEL/homework$
>>>
>>
>>Right, I've managed to reproduce this. Looking at the browser console, it
>>might be a problem with the javascript doing the layer name validation.
>>If
>>you change the layer name to something completely random that does not
>>exist in the Toaster database (something like meta-xyz), can you import
>>the layer?
>>
>>Cheers
>>
>>Belén
>>
>>>
>>>
>>>Let me know if more details are required.
>>>
>>>
>>>
>>>Thanks,
>>>
>>>Sujith H
>>>
>>>
>>>
>>>
>>>--
>>>സുജിത് ഹരിദാസന്
>>>Bangalore
>>><Project>Contributor to KDE project
>>>http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>><Blog> http://sujithh.info
>>>
>>>
>>>
>>
>
>
>>--
>>_______________________________________________
>>toaster mailing list
>>toaster@yoctoproject.org
>>https://lists.yoctoproject.org/listinfo/toaster
>
>
>
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>


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

* Re: Usage of already cloned layers in toaster
  2015-07-27 10:31         ` sujith h
@ 2015-07-27 13:25           ` Michael Wood
  2015-07-27 15:23             ` sujith h
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Wood @ 2015-07-27 13:25 UTC (permalink / raw)
  To: toaster

On 27/07/15 11:31, sujith h wrote:
>
>
> On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen 
> <belen.barros.pena@intel.com <mailto:belen.barros.pena@intel.com>> wrote:
>
>
>
>     On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com
>     <mailto:sujith.h@gmail.com>> wrote:
>
>     >
>     >
>     >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
>     ><belen.barros.pena@intel.com
>     <mailto:belen.barros.pena@intel.com>> wrote:
>     >
>     >
>     >
>     >On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com
>     <mailto:sujith.h@gmail.com>> wrote:
>     >
>     >
>     >* Which version of Yocto Project you are using (fido or master)?
>     >
>     >I am using fido branch.
>     >
>     >
>     >* Which release you have selected for your project?
>     >
>     >
>     >In the release I have selected "Local Yocto Project"
>     >
>     >
>     >* If you click the "view all compatible layers" link and in that
>     page you
>     >search for meta-oe, do you get any results?
>     >
>     >I can see only "meta-yocto-bsp", "meta-yocto" and
>     "openembedded-core".
>     >Attached screenshot of the same.
>     >
>     >
>     >Also attaching screenshot of page where I try to import meta-oe
>     from my
>     >locally cloned location.
>     >
>     >
>     >Below is the file structure I have:
>     >
>     >sujith@kdekid:~/MEL/homework$ pwd
>     >/home/sujith/MEL/homework
>     >sujith@kdekid:~/MEL/homework$ ls -l
>     >total 5180
>     >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40 meta-oe-local
>     >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04
>     meta-openembedded-local
>     >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02 meta-qt5-local
>     >drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
>     >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08
>     toaster_build_artifacts
>     >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19 toaster.sqlite
>     >drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
>     >sujith@kdekid:~/MEL/homework$
>     >
>
>     Right, I've managed to reproduce this. Looking at the browser
>     console, it
>     might be a problem with the javascript doing the layer name
>     validation. If
>     you change the layer name to something completely random that does not
>     exist in the Toaster database (something like meta-xyz), can you
>     import
>     the layer?
>
>
> Am bit new to the web world. So I gave a try with firebug to debug 
> which script ( Javascript or any ) call happens
> when I click "Import  and add to project" button. Even after changing 
> meta-oe repo to meta-xyz as per suggestion,
> the result remains same. But this is the output I see in the firebug 
> console:
> |{"current_id": 5, "current_url": "git://git.openembedded.org/meta-openembedded  <http://git.openembedded.org/meta-openembedded>", "error": "hint-layer-exists-with-different-url"||}|
> hint-layer-exists-with-different-url
>
> Also attaching the screenshot of the same ( to get more clarity ).

Thanks for this, I noticed this wasn't working properly last week, and 
rolled a couple of patches to fix these regressions.


http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064

and


http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700

I have a few other things to fix on this branch as I have been fixing a 
number of things to allow me to test the new project page, I'm intending 
to roll a separate branch for review on it.

You've highlighted that we need a unit test which does a layer import 
using the back end API calls, which although it wouldn't have caught 
this error would be really good to have, if you're interested in helping 
with that?


>
> Thanks,
> Sujith H
>
>
>
>     Cheers
>
>     Belén
>
>     >
>     >
>     >Let me know if more details are required.
>     >
>     >
>     >
>     >Thanks,
>     >
>     >Sujith H
>     >
>     >
>     >
>     >
>     >--
>     >സുജിത് ഹരിദാസന്
>     >Bangalore
>     ><Project>Contributor to KDE project
>     >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>     ><Blog> http://sujithh.info
>     >
>     >
>     >
>
>
>
>
> -- 
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>
>



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

* Re: Usage of already cloned layers in toaster
  2015-07-27 13:25           ` Michael Wood
@ 2015-07-27 15:23             ` sujith h
  2015-07-28 18:51               ` Michael Wood
  0 siblings, 1 reply; 20+ messages in thread
From: sujith h @ 2015-07-27 15:23 UTC (permalink / raw)
  To: Michael Wood; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 5390 bytes --]

On Mon, Jul 27, 2015 at 6:55 PM, Michael Wood <michael.g.wood@intel.com>
wrote:

> On 27/07/15 11:31, sujith h wrote:
>
>>
>>
>> On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen <
>> belen.barros.pena@intel.com <mailto:belen.barros.pena@intel.com>> wrote:
>>
>>
>>
>>     On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com
>>     <mailto:sujith.h@gmail.com>> wrote:
>>
>>     >
>>     >
>>     >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
>>     ><belen.barros.pena@intel.com
>>     <mailto:belen.barros.pena@intel.com>> wrote:
>>     >
>>     >
>>     >
>>     >On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com
>>     <mailto:sujith.h@gmail.com>> wrote:
>>     >
>>     >
>>     >* Which version of Yocto Project you are using (fido or master)?
>>     >
>>     >I am using fido branch.
>>     >
>>     >
>>     >* Which release you have selected for your project?
>>     >
>>     >
>>     >In the release I have selected "Local Yocto Project"
>>     >
>>     >
>>     >* If you click the "view all compatible layers" link and in that
>>     page you
>>     >search for meta-oe, do you get any results?
>>     >
>>     >I can see only "meta-yocto-bsp", "meta-yocto" and
>>     "openembedded-core".
>>     >Attached screenshot of the same.
>>     >
>>     >
>>     >Also attaching screenshot of page where I try to import meta-oe
>>     from my
>>     >locally cloned location.
>>     >
>>     >
>>     >Below is the file structure I have:
>>     >
>>     >sujith@kdekid:~/MEL/homework$ pwd
>>     >/home/sujith/MEL/homework
>>     >sujith@kdekid:~/MEL/homework$ ls -l
>>     >total 5180
>>     >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40 meta-oe-local
>>     >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04
>>     meta-openembedded-local
>>     >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02 meta-qt5-local
>>     >drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
>>     >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08
>>     toaster_build_artifacts
>>     >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19 toaster.sqlite
>>     >drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
>>     >sujith@kdekid:~/MEL/homework$
>>     >
>>
>>     Right, I've managed to reproduce this. Looking at the browser
>>     console, it
>>     might be a problem with the javascript doing the layer name
>>     validation. If
>>     you change the layer name to something completely random that does not
>>     exist in the Toaster database (something like meta-xyz), can you
>>     import
>>     the layer?
>>
>>
>> Am bit new to the web world. So I gave a try with firebug to debug which
>> script ( Javascript or any ) call happens
>> when I click "Import  and add to project" button. Even after changing
>> meta-oe repo to meta-xyz as per suggestion,
>> the result remains same. But this is the output I see in the firebug
>> console:
>> |{"current_id": 5, "current_url": "git://
>> git.openembedded.org/meta-openembedded  <
>> http://git.openembedded.org/meta-openembedded>", "error":
>> "hint-layer-exists-with-different-url"||}|
>> hint-layer-exists-with-different-url
>>
>> Also attaching the screenshot of the same ( to get more clarity ).
>>
>
> Thanks for this, I noticed this wasn't working properly last week, and
> rolled a couple of patches to fix these regressions.
>
>
>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064
>
> and
>
>
>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700
>
> I have a few other things to fix on this branch as I have been fixing a
> number of things to allow me to test the new project page, I'm intending to
> roll a separate branch for review on it.
>
> You've highlighted that we need a unit test which does a layer import
> using the back end API calls, which although it wouldn't have caught this
> error would be really good to have, if you're interested in helping with
> that?
>

It would be my pleasure to help :) I might need some assistance as I am
learning Django. May be some hint like where to start with or so.


>
>
>> Thanks,
>> Sujith H
>>
>>
>>
>>     Cheers
>>
>>     Belén
>>
>>     >
>>     >
>>     >Let me know if more details are required.
>>     >
>>     >
>>     >
>>     >Thanks,
>>     >
>>     >Sujith H
>>     >
>>     >
>>     >
>>     >
>>     >--
>>     >സുജിത് ഹരിദാസന്
>>     >Bangalore
>>     ><Project>Contributor to KDE project
>>     >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>     ><Blog> http://sujithh.info
>>     >
>>     >
>>     >
>>
>>
>>
>>
>> --
>> സുജിത് ഹരിദാസന്
>> Bangalore
>> <Project>Contributor to KDE project
>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> <Blog> http://sujithh.info
>>
>>
>>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 8827 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-27 15:23             ` sujith h
@ 2015-07-28 18:51               ` Michael Wood
  2015-07-29 14:39                 ` sujith h
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Wood @ 2015-07-28 18:51 UTC (permalink / raw)
  To: sujith h; +Cc: toaster

On 27/07/15 16:23, sujith h wrote:
>
>
> On Mon, Jul 27, 2015 at 6:55 PM, Michael Wood 
> <michael.g.wood@intel.com <mailto:michael.g.wood@intel.com>> wrote:
>
>     On 27/07/15 11:31, sujith h wrote:
>
>
>
>         On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen
>         <belen.barros.pena@intel.com
>         <mailto:belen.barros.pena@intel.com>
>         <mailto:belen.barros.pena@intel.com
>         <mailto:belen.barros.pena@intel.com>>> wrote:
>
>
>
>             On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com
>         <mailto:sujith.h@gmail.com>
>             <mailto:sujith.h@gmail.com <mailto:sujith.h@gmail.com>>>
>         wrote:
>
>             >
>             >
>             >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
>             ><belen.barros.pena@intel.com
>         <mailto:belen.barros.pena@intel.com>
>             <mailto:belen.barros.pena@intel.com
>         <mailto:belen.barros.pena@intel.com>>> wrote:
>             >
>             >
>             >
>             >On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com
>         <mailto:sujith.h@gmail.com>
>             <mailto:sujith.h@gmail.com <mailto:sujith.h@gmail.com>>>
>         wrote:
>             >
>             >
>             >* Which version of Yocto Project you are using (fido or
>         master)?
>             >
>             >I am using fido branch.
>             >
>             >
>             >* Which release you have selected for your project?
>             >
>             >
>             >In the release I have selected "Local Yocto Project"
>             >
>             >
>             >* If you click the "view all compatible layers" link and
>         in that
>             page you
>             >search for meta-oe, do you get any results?
>             >
>             >I can see only "meta-yocto-bsp", "meta-yocto" and
>             "openembedded-core".
>             >Attached screenshot of the same.
>             >
>             >
>             >Also attaching screenshot of page where I try to import
>         meta-oe
>             from my
>             >locally cloned location.
>             >
>             >
>             >Below is the file structure I have:
>             >
>             >sujith@kdekid:~/MEL/homework$ pwd
>             >/home/sujith/MEL/homework
>             >sujith@kdekid:~/MEL/homework$ ls -l
>             >total 5180
>             >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40
>         meta-oe-local
>             >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04
>             meta-openembedded-local
>             >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02
>         meta-qt5-local
>             >drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
>             >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08
>             toaster_build_artifacts
>             >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19
>         toaster.sqlite
>             >drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
>             >sujith@kdekid:~/MEL/homework$
>             >
>
>             Right, I've managed to reproduce this. Looking at the browser
>             console, it
>             might be a problem with the javascript doing the layer name
>             validation. If
>             you change the layer name to something completely random
>         that does not
>             exist in the Toaster database (something like meta-xyz),
>         can you
>             import
>             the layer?
>
>
>         Am bit new to the web world. So I gave a try with firebug to
>         debug which script ( Javascript or any ) call happens
>         when I click "Import  and add to project" button. Even after
>         changing meta-oe repo to meta-xyz as per suggestion,
>         the result remains same. But this is the output I see in the
>         firebug console:
>         |{"current_id": 5, "current_url":
>         "git://git.openembedded.org/meta-openembedded
>         <http://git.openembedded.org/meta-openembedded>
>         <http://git.openembedded.org/meta-openembedded>", "error":
>         "hint-layer-exists-with-different-url"||}|
>         hint-layer-exists-with-different-url
>
>         Also attaching the screenshot of the same ( to get more clarity ).
>
>
>     Thanks for this, I noticed this wasn't working properly last week,
>     and rolled a couple of patches to fix these regressions.
>
>
>     http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064
>
>     and
>
>
>     http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700
>
>     I have a few other things to fix on this branch as I have been
>     fixing a number of things to allow me to test the new project
>     page, I'm intending to roll a separate branch for review on it.
>
>     You've highlighted that we need a unit test which does a layer
>     import using the back end API calls, which although it wouldn't
>     have caught this error would be really good to have, if you're
>     interested in helping with that?
>
>
> It would be my pleasure to help :) I might need some assistance as I 
> am learning Django. May be some hint like where to start with or so.
>

This is the best place to start
https://docs.djangoproject.com/en/1.6/topics/testing/overview/

In ./bitbake 
<https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake>/lib 
<https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib>/toaster 
<https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster>/toastergui 
<https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui>/tests.py 
<https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui/tests.py>

We can add something like

class ImportLayerTestCase(|ProvisionedLayersProjectTestCase|):
....
...
     def test_import_layer(self):
         client.post(reverse('xhr_importlayer',.....

...

We can then use the JSON response from the client to help validate the 
data coming back as well as checking the import layer actually entered 
the database.

There are a few examples in the yocto error-report-web project too that 
might be useful to look at e.g.
  http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153 <http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153>

You can run the test by doing running ./manage.py test toastergui


Thanks,

Michael


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

* Re: Usage of already cloned layers in toaster
  2015-07-28 18:51               ` Michael Wood
@ 2015-07-29 14:39                 ` sujith h
  2015-07-31 13:06                   ` sujith h
  0 siblings, 1 reply; 20+ messages in thread
From: sujith h @ 2015-07-29 14:39 UTC (permalink / raw)
  To: Michael Wood; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 7405 bytes --]

On Wed, Jul 29, 2015 at 12:21 AM, Michael Wood <michael.g.wood@intel.com>
wrote:

> On 27/07/15 16:23, sujith h wrote:
>
>>
>>
>> On Mon, Jul 27, 2015 at 6:55 PM, Michael Wood <michael.g.wood@intel.com
>> <mailto:michael.g.wood@intel.com>> wrote:
>>
>>     On 27/07/15 11:31, sujith h wrote:
>>
>>
>>
>>         On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen
>>         <belen.barros.pena@intel.com
>>         <mailto:belen.barros.pena@intel.com>
>>         <mailto:belen.barros.pena@intel.com
>>         <mailto:belen.barros.pena@intel.com>>> wrote:
>>
>>
>>
>>             On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com
>>         <mailto:sujith.h@gmail.com>
>>             <mailto:sujith.h@gmail.com <mailto:sujith.h@gmail.com>>>
>>         wrote:
>>
>>             >
>>             >
>>             >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
>>             ><belen.barros.pena@intel.com
>>         <mailto:belen.barros.pena@intel.com>
>>             <mailto:belen.barros.pena@intel.com
>>         <mailto:belen.barros.pena@intel.com>>> wrote:
>>             >
>>             >
>>             >
>>             >On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com
>>         <mailto:sujith.h@gmail.com>
>>             <mailto:sujith.h@gmail.com <mailto:sujith.h@gmail.com>>>
>>
>>         wrote:
>>             >
>>             >
>>             >* Which version of Yocto Project you are using (fido or
>>         master)?
>>             >
>>             >I am using fido branch.
>>             >
>>             >
>>             >* Which release you have selected for your project?
>>             >
>>             >
>>             >In the release I have selected "Local Yocto Project"
>>             >
>>             >
>>             >* If you click the "view all compatible layers" link and
>>         in that
>>             page you
>>             >search for meta-oe, do you get any results?
>>             >
>>             >I can see only "meta-yocto-bsp", "meta-yocto" and
>>             "openembedded-core".
>>             >Attached screenshot of the same.
>>             >
>>             >
>>             >Also attaching screenshot of page where I try to import
>>         meta-oe
>>             from my
>>             >locally cloned location.
>>             >
>>             >
>>             >Below is the file structure I have:
>>             >
>>             >sujith@kdekid:~/MEL/homework$ pwd
>>             >/home/sujith/MEL/homework
>>             >sujith@kdekid:~/MEL/homework$ ls -l
>>             >total 5180
>>             >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40
>>         meta-oe-local
>>             >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04
>>             meta-openembedded-local
>>             >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02
>>         meta-qt5-local
>>             >drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
>>             >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08
>>             toaster_build_artifacts
>>             >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19
>>         toaster.sqlite
>>             >drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
>>             >sujith@kdekid:~/MEL/homework$
>>             >
>>
>>             Right, I've managed to reproduce this. Looking at the browser
>>             console, it
>>             might be a problem with the javascript doing the layer name
>>             validation. If
>>             you change the layer name to something completely random
>>         that does not
>>             exist in the Toaster database (something like meta-xyz),
>>         can you
>>             import
>>             the layer?
>>
>>
>>         Am bit new to the web world. So I gave a try with firebug to
>>         debug which script ( Javascript or any ) call happens
>>         when I click "Import  and add to project" button. Even after
>>         changing meta-oe repo to meta-xyz as per suggestion,
>>         the result remains same. But this is the output I see in the
>>         firebug console:
>>         |{"current_id": 5, "current_url":
>>         "git://git.openembedded.org/meta-openembedded
>>         <http://git.openembedded.org/meta-openembedded>
>>         <http://git.openembedded.org/meta-openembedded>", "error":
>>         "hint-layer-exists-with-different-url"||}|
>>         hint-layer-exists-with-different-url
>>
>>         Also attaching the screenshot of the same ( to get more clarity ).
>>
>>
>>     Thanks for this, I noticed this wasn't working properly last week,
>>     and rolled a couple of patches to fix these regressions.
>>
>>
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064
>>
>>     and
>>
>>
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700
>>
>>     I have a few other things to fix on this branch as I have been
>>     fixing a number of things to allow me to test the new project
>>     page, I'm intending to roll a separate branch for review on it.
>>
>>     You've highlighted that we need a unit test which does a layer
>>     import using the back end API calls, which although it wouldn't
>>     have caught this error would be really good to have, if you're
>>     interested in helping with that?
>>
>>
>> It would be my pleasure to help :) I might need some assistance as I am
>> learning Django. May be some hint like where to start with or so.
>>
>>
> This is the best place to start
> https://docs.djangoproject.com/en/1.6/topics/testing/overview/
>
> In ./bitbake <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake>/lib
> <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib>/toaster
> <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster>/toastergui
> <
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui>/tests.py
> <
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui/tests.py
> >
>
> We can add something like
>
> class ImportLayerTestCase(|ProvisionedLayersProjectTestCase|):
> ....
> ...
>     def test_import_layer(self):
>         client.post(reverse('xhr_importlayer',.....
>
> ...
>
> We can then use the JSON response from the client to help validate the
> data coming back as well as checking the import layer actually entered the
> database.
>
> There are a few examples in the yocto error-report-web project too that
> might be useful to look at e.g.
>
> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
> <
> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
> >
>
> You can run the test by doing running ./manage.py test toastergui
>
>
Thank you Michael for such a detailed step to follow. I have started
reading the docs from django mentioned in the link and the reference
mentioned in the mail.

Thanks,
Sujith H


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 12132 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-29 14:39                 ` sujith h
@ 2015-07-31 13:06                   ` sujith h
  2015-08-03 10:26                     ` Michael Wood
  0 siblings, 1 reply; 20+ messages in thread
From: sujith h @ 2015-07-31 13:06 UTC (permalink / raw)
  To: Michael Wood; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 11820 bytes --]

On Wed, Jul 29, 2015 at 8:09 PM, sujith h <sujith.h@gmail.com> wrote:

>
>
> On Wed, Jul 29, 2015 at 12:21 AM, Michael Wood <michael.g.wood@intel.com>
> wrote:
>
>> On 27/07/15 16:23, sujith h wrote:
>>
>>>
>>>
>>> On Mon, Jul 27, 2015 at 6:55 PM, Michael Wood <michael.g.wood@intel.com
>>> <mailto:michael.g.wood@intel.com>> wrote:
>>>
>>>     On 27/07/15 11:31, sujith h wrote:
>>>
>>>
>>>
>>>         On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen
>>>         <belen.barros.pena@intel.com
>>>         <mailto:belen.barros.pena@intel.com>
>>>         <mailto:belen.barros.pena@intel.com
>>>         <mailto:belen.barros.pena@intel.com>>> wrote:
>>>
>>>
>>>
>>>             On 27/07/2015 07:54, "sujith h" <sujith.h@gmail.com
>>>         <mailto:sujith.h@gmail.com>
>>>             <mailto:sujith.h@gmail.com <mailto:sujith.h@gmail.com>>>
>>>         wrote:
>>>
>>>             >
>>>             >
>>>             >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
>>>             ><belen.barros.pena@intel.com
>>>         <mailto:belen.barros.pena@intel.com>
>>>             <mailto:belen.barros.pena@intel.com
>>>         <mailto:belen.barros.pena@intel.com>>> wrote:
>>>             >
>>>             >
>>>             >
>>>             >On 24/07/2015 13:57, "sujith h" <sujith.h@gmail.com
>>>         <mailto:sujith.h@gmail.com>
>>>             <mailto:sujith.h@gmail.com <mailto:sujith.h@gmail.com>>>
>>>
>>>         wrote:
>>>             >
>>>             >
>>>             >* Which version of Yocto Project you are using (fido or
>>>         master)?
>>>             >
>>>             >I am using fido branch.
>>>             >
>>>             >
>>>             >* Which release you have selected for your project?
>>>             >
>>>             >
>>>             >In the release I have selected "Local Yocto Project"
>>>             >
>>>             >
>>>             >* If you click the "view all compatible layers" link and
>>>         in that
>>>             page you
>>>             >search for meta-oe, do you get any results?
>>>             >
>>>             >I can see only "meta-yocto-bsp", "meta-yocto" and
>>>             "openembedded-core".
>>>             >Attached screenshot of the same.
>>>             >
>>>             >
>>>             >Also attaching screenshot of page where I try to import
>>>         meta-oe
>>>             from my
>>>             >locally cloned location.
>>>             >
>>>             >
>>>             >Below is the file structure I have:
>>>             >
>>>             >sujith@kdekid:~/MEL/homework$ pwd
>>>             >/home/sujith/MEL/homework
>>>             >sujith@kdekid:~/MEL/homework$ ls -l
>>>             >total 5180
>>>             >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40
>>>         meta-oe-local
>>>             >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04
>>>             meta-openembedded-local
>>>             >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02
>>>         meta-qt5-local
>>>             >drwxrwxr-x 11 sujith sujith    4096 Jul 27 12:07 poky
>>>             >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08
>>>             toaster_build_artifacts
>>>             >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19
>>>         toaster.sqlite
>>>             >drwxrwxr-x  6 sujith sujith    4096 Jul 24 16:25 venv
>>>             >sujith@kdekid:~/MEL/homework$
>>>             >
>>>
>>>             Right, I've managed to reproduce this. Looking at the browser
>>>             console, it
>>>             might be a problem with the javascript doing the layer name
>>>             validation. If
>>>             you change the layer name to something completely random
>>>         that does not
>>>             exist in the Toaster database (something like meta-xyz),
>>>         can you
>>>             import
>>>             the layer?
>>>
>>>
>>>         Am bit new to the web world. So I gave a try with firebug to
>>>         debug which script ( Javascript or any ) call happens
>>>         when I click "Import  and add to project" button. Even after
>>>         changing meta-oe repo to meta-xyz as per suggestion,
>>>         the result remains same. But this is the output I see in the
>>>         firebug console:
>>>         |{"current_id": 5, "current_url":
>>>         "git://git.openembedded.org/meta-openembedded
>>>         <http://git.openembedded.org/meta-openembedded>
>>>         <http://git.openembedded.org/meta-openembedded>", "error":
>>>         "hint-layer-exists-with-different-url"||}|
>>>         hint-layer-exists-with-different-url
>>>
>>>         Also attaching the screenshot of the same ( to get more clarity
>>> ).
>>>
>>>
>>>     Thanks for this, I noticed this wasn't working properly last week,
>>>     and rolled a couple of patches to fix these regressions.
>>>
>>>
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064
>>>
>>>     and
>>>
>>>
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700
>>>
>>>     I have a few other things to fix on this branch as I have been
>>>     fixing a number of things to allow me to test the new project
>>>     page, I'm intending to roll a separate branch for review on it.
>>>
>>>     You've highlighted that we need a unit test which does a layer
>>>     import using the back end API calls, which although it wouldn't
>>>     have caught this error would be really good to have, if you're
>>>     interested in helping with that?
>>>
>>>
>>> It would be my pleasure to help :) I might need some assistance as I am
>>> learning Django. May be some hint like where to start with or so.
>>>
>>>
>> This is the best place to start
>> https://docs.djangoproject.com/en/1.6/topics/testing/overview/
>>
>> In ./bitbake <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake>/lib <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib>/toaster
>> <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster>/toastergui
>> <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui>/tests.py
>> <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui/tests.py
>> >
>>
>> We can add something like
>>
>> class ImportLayerTestCase(|ProvisionedLayersProjectTestCase|):
>> ....
>> ...
>>     def test_import_layer(self):
>>         client.post(reverse('xhr_importlayer',.....
>>
>> ...
>>
>> We can then use the JSON response from the client to help validate the
>> data coming back as well as checking the import layer actually entered the
>> database.
>>
>> There are a few examples in the yocto error-report-web project too that
>> might be useful to look at e.g.
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>> <
>> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>> >
>>
>> You can run the test by doing running ./manage.py test toastergui
>>
>>
> Thank you Michael for such a detailed step to follow. I have started
> reading the docs from django mentioned in the link and the reference
> mentioned in the mail.
>

I wrote a small piece of code in bitbake/lib/toaster/toastergui/tests.py.
Below is the code ( since I have written a small code, I thought to share
here. Kindly let me know if there is any problem sharing small code in the
mailing list ):
----------
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
import json


class ImportLayerTestCase(TestCase):
    def test_import_layers(self):
        client = Client()
        json_string = json.dumps({'name':'meta-oe',
                      'vcs-url':'/home/sujith/MEL/homework/meta-xyz',
                      'git_ref':'c12b9596afd236116b25ce26dbe0d793de9dc7ce',

'dir_path':'/home/sujith/MEL/homework/meta-xyz/meta-oe',
                      'project_id':'1', 'layer_deps':'1'})
        response = client.post(reverse('xhr_importlayer'),
                   {'data':json_string},
                   'json',
                   HTTP_X_REQUESTED_WITH='XMLHttpRequest')
-------------

Let me know if I am in the right track. After following your mail and bit
of google, helped me in writing this code. My query here is when I try to
print response, it prints an html as follows:

------------
Content-Type: text/html; charset=utf-8

<!DOCTYPE html>

<html lang="en">
    <head>
        <title>Toaster</title>
<link rel="stylesheet" href="/static/css/bootstrap.min.css"
type="text/css"/>
<link rel="stylesheet" href="/static/css/bootstrap-responsive.min.css"
type='text/css'/>
<link rel="stylesheet" href="/static/css/font-awesome.min.css"
type='text/css'/>
<link rel="stylesheet" href="/static/css/prettify.css" type='text/css'/>
<link rel="stylesheet" href="/static/css/default.css" type='text/css'/>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<script src="/static/js/jquery-2.0.3.min.js">
</script>
<script src="/static/js/jquery.cookie.js">
</script>
<script src="/static/js/bootstrap.min.js">
</script>
<script src="/static/js/prettify.js">
</script>
<script src="/static/js/libtoaster.js">
</script>

<script>
  libtoaster.debug = true;
 </script>

<script src="/static/js/base.js"></script>

<script>

</script>



    </head>

<body style="height: 100%">
<div class="navbar navbar-static-top">
    <div class="navbar-inner">
            <a class="brand logo" href="#"><img src="/static/img/logo.png"
class="" alt="Yocto logo project"/></a>
            <span class="brand">
                <a href="/">Toaster</a>

                    <i class="icon-info-sign" title="<strong>Toaster
version information</strong>" data-content="<dl><dt>Branch</dt><dd>fido
</dd><dt>Revision</dt><dd>08d32590411568e7bf11612ac695a6e9c6df6286
</dd><dt>Mode</dt><dd>Analysis</dd></dl>"></i>

            </span>
            <a class="pull-right manual" target="_blank" href="
http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html">
                <i class="icon-book"></i>
                Toaster manual
            </a>


    </div>
</div>

<div class="container-fluid">


  <div class="container-fluid">
   <div class="row-fluid">
    <!-- Empty - no build module -->
    <div class="page-header top-air">
     <h1>
       This page only works with Toaster in 'Build' mode
     </h1>
    </div>
    <div class="alert alert-info lead">
     <p">
     The 'Build' mode allows you to configure and run your Yocto Project
builds from Toaster.
     <ul>
       <li><a href="
http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#intro-modes
">
       Read about the 'Build' mode
       </a></li>
       <li><a href="/">
       View your builds
       </a></li>
     </ul>
     </p>
    </div>
   </div>


</div>
</body>
</html>
------------

My query here is whether the arguments passed to client.post is correct?
And if so any hint how to use this response to get the error which we were
getting from importlayer.js?
Sorry if my query is really stupid :)

Thanks,
Sujith H


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 18783 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-07-31 13:06                   ` sujith h
@ 2015-08-03 10:26                     ` Michael Wood
  2015-08-04 10:35                       ` sujith h
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Wood @ 2015-08-03 10:26 UTC (permalink / raw)
  To: sujith h; +Cc: toaster

On 31/07/15 14:06, sujith h wrote:
>
>
> On Wed, Jul 29, 2015 at 8:09 PM, sujith h <sujith.h@gmail.com 
> <mailto:sujith.h@gmail.com>> wrote:
>
>
>
>     On Wed, Jul 29, 2015 at 12:21 AM, Michael Wood
>     <michael.g.wood@intel.com <mailto:michael.g.wood@intel.com>> wrote:
>
>         On 27/07/15 16:23, sujith h wrote:
>
>
>
>             On Mon, Jul 27, 2015 at 6:55 PM, Michael Wood
>             <michael.g.wood@intel.com
>             <mailto:michael.g.wood@intel.com>
>             <mailto:michael.g.wood@intel.com
>             <mailto:michael.g.wood@intel.com>>> wrote:
>
>                 On 27/07/15 11:31, sujith h wrote:
>
>
>
>                     On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen
>                     <belen.barros.pena@intel.com
>             <mailto:belen.barros.pena@intel.com>
>                     <mailto:belen.barros.pena@intel.com
>             <mailto:belen.barros.pena@intel.com>>
>                     <mailto:belen.barros.pena@intel.com
>             <mailto:belen.barros.pena@intel.com>
>                     <mailto:belen.barros.pena@intel.com
>             <mailto:belen.barros.pena@intel.com>>>> wrote:
>
>
>
>                         On 27/07/2015 07:54, "sujith h"
>             <sujith.h@gmail.com <mailto:sujith.h@gmail.com>
>                     <mailto:sujith.h@gmail.com
>             <mailto:sujith.h@gmail.com>>
>                         <mailto:sujith.h@gmail.com
>             <mailto:sujith.h@gmail.com> <mailto:sujith.h@gmail.com
>             <mailto:sujith.h@gmail.com>>>>
>                     wrote:
>
>                         >
>                         >
>                         >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena,
>             Belen
>                         ><belen.barros.pena@intel.com
>             <mailto:belen.barros.pena@intel.com>
>                     <mailto:belen.barros.pena@intel.com
>             <mailto:belen.barros.pena@intel.com>>
>                         <mailto:belen.barros.pena@intel.com
>             <mailto:belen.barros.pena@intel.com>
>                     <mailto:belen.barros.pena@intel.com
>             <mailto:belen.barros.pena@intel.com>>>> wrote:
>                         >
>                         >
>                         >
>                         >On 24/07/2015 13:57, "sujith h"
>             <sujith.h@gmail.com <mailto:sujith.h@gmail.com>
>                     <mailto:sujith.h@gmail.com
>             <mailto:sujith.h@gmail.com>>
>                         <mailto:sujith.h@gmail.com
>             <mailto:sujith.h@gmail.com> <mailto:sujith.h@gmail.com
>             <mailto:sujith.h@gmail.com>>>>
>
>                     wrote:
>                         >
>                         >
>                         >* Which version of Yocto Project you are
>             using (fido or
>                     master)?
>                         >
>                         >I am using fido branch.
>                         >
>                         >
>                         >* Which release you have selected for your
>             project?
>                         >
>                         >
>                         >In the release I have selected "Local Yocto
>             Project"
>                         >
>                         >
>                         >* If you click the "view all compatible
>             layers" link and
>                     in that
>                         page you
>                         >search for meta-oe, do you get any results?
>                         >
>                         >I can see only "meta-yocto-bsp", "meta-yocto" and
>                         "openembedded-core".
>                         >Attached screenshot of the same.
>                         >
>                         >
>                         >Also attaching screenshot of page where I try
>             to import
>                     meta-oe
>                         from my
>                         >locally cloned location.
>                         >
>                         >
>                         >Below is the file structure I have:
>                         >
>             >sujith@kdekid:~/MEL/homework$ pwd
>             >/home/sujith/MEL/homework
>             >sujith@kdekid:~/MEL/homework$ ls -l
>                         >total 5180
>                         >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40
>                     meta-oe-local
>                         >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04
>                         meta-openembedded-local
>                         >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02
>                     meta-qt5-local
>                         >drwxrwxr-x 11 sujith sujith    4096 Jul 27
>             12:07 poky
>                         >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08
>                         toaster_build_artifacts
>                         >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19
>                     toaster.sqlite
>                         >drwxrwxr-x  6 sujith sujith    4096 Jul 24
>             16:25 venv
>             >sujith@kdekid:~/MEL/homework$
>                         >
>
>                         Right, I've managed to reproduce this. Looking
>             at the browser
>                         console, it
>                         might be a problem with the javascript doing
>             the layer name
>                         validation. If
>                         you change the layer name to something
>             completely random
>                     that does not
>                         exist in the Toaster database (something like
>             meta-xyz),
>                     can you
>                         import
>                         the layer?
>
>
>                     Am bit new to the web world. So I gave a try with
>             firebug to
>                     debug which script ( Javascript or any ) call happens
>                     when I click "Import  and add to project" button.
>             Even after
>                     changing meta-oe repo to meta-xyz as per suggestion,
>                     the result remains same. But this is the output I
>             see in the
>                     firebug console:
>                     |{"current_id": 5, "current_url":
>                     "git://git.openembedded.org/meta-openembedded
>             <http://git.openembedded.org/meta-openembedded>
>                     <http://git.openembedded.org/meta-openembedded>
>                     <http://git.openembedded.org/meta-openembedded>",
>             "error":
>             "hint-layer-exists-with-different-url"||}|
>             hint-layer-exists-with-different-url
>
>                     Also attaching the screenshot of the same ( to get
>             more clarity ).
>
>
>                 Thanks for this, I noticed this wasn't working
>             properly last week,
>                 and rolled a couple of patches to fix these regressions.
>
>
>             http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064
>
>                 and
>
>
>             http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700
>
>                 I have a few other things to fix on this branch as I
>             have been
>                 fixing a number of things to allow me to test the new
>             project
>                 page, I'm intending to roll a separate branch for
>             review on it.
>
>                 You've highlighted that we need a unit test which does
>             a layer
>                 import using the back end API calls, which although it
>             wouldn't
>                 have caught this error would be really good to have,
>             if you're
>                 interested in helping with that?
>
>
>             It would be my pleasure to help :) I might need some
>             assistance as I am learning Django. May be some hint like
>             where to start with or so.
>
>
>         This is the best place to start
>         https://docs.djangoproject.com/en/1.6/topics/testing/overview/
>
>         In ./bitbake
>         <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake>/lib
>         <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib>/toaster
>         <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster>/toastergui
>         <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui>/tests.py
>         <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui/tests.py>
>
>         We can add something like
>
>         class ImportLayerTestCase(|ProvisionedLayersProjectTestCase|):
>         ....
>         ...
>             def test_import_layer(self):
>         client.post(reverse('xhr_importlayer',.....
>
>         ...
>
>         We can then use the JSON response from the client to help
>         validate the data coming back as well as checking the import
>         layer actually entered the database.
>
>         There are a few examples in the yocto error-report-web project
>         too that might be useful to look at e.g.
>         http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>         <http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153>
>
>         You can run the test by doing running ./manage.py test toastergui
>
>
>     Thank you Michael for such a detailed step to follow. I have
>     started reading the docs from django mentioned in the link and the
>     reference mentioned in the mail.
>
>
> I wrote a small piece of code in 
> bitbake/lib/toaster/toastergui/tests.py. Below is the code ( since I 
> have written a small code, I thought to share here. Kindly let me know 
> if there is any problem sharing small code in the mailing list ):
> ----------
> from django.test import TestCase
> from django.test.client import Client
> from django.core.urlresolvers import reverse
> import json
>
>
> class ImportLayerTestCase(TestCase):
>     def test_import_layers(self):
>         client = Client()
>         json_string = json.dumps({'name':'meta-oe',
> 'vcs-url':'/home/sujith/MEL/homework/meta-xyz',
> 'git_ref':'c12b9596afd236116b25ce26dbe0d793de9dc7ce',
> 'dir_path':'/home/sujith/MEL/homework/meta-xyz/meta-oe',
>                       'project_id':'1', 'layer_deps':'1'})
>         response = client.post(reverse('xhr_importlayer'),
>                    {'data':json_string},
>                    'json',
>                    HTTP_X_REQUESTED_WITH='XMLHttpRequest')
> -------------
>
> Let me know if I am in the right track. After following your mail and 
> bit of google, helped me in writing this code. My query here is when I 
> try to print response, it prints an html as follows:
--8<--

Yep that's a good start, we currently don't actually pass IN a JSON 
document for the import layers call, it's just a bunch of parameters in 
the POST request.
So instead of

>         json_string = json.dumps({'name':'meta-oe',

you can do:

         data = {'name':'meta-oe',


and then:

        response = client.post(reverse('xhr_importlayer', args(1,)),
                    data,

etc

Looking at that response I'm wondering if you are you using current 
master branch? It seems to be showing the old response to that request 
where you haven't enabled build mode (which is enabled by default in 
current master). The response should be a JSON response where you have 
the returned state in it e.g. { "error" : "hint-layer-exists" } We can 
then parse this and test the various conditions are correct based on the 
data we sent it.

Thanks,

Michael








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

* Re: Usage of already cloned layers in toaster
  2015-08-03 10:26                     ` Michael Wood
@ 2015-08-04 10:35                       ` sujith h
  2015-08-04 13:16                         ` sujith h
  0 siblings, 1 reply; 20+ messages in thread
From: sujith h @ 2015-08-04 10:35 UTC (permalink / raw)
  To: Michael Wood; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 14240 bytes --]

On Mon, Aug 3, 2015 at 3:56 PM, Michael Wood <michael.g.wood@intel.com>
wrote:

> On 31/07/15 14:06, sujith h wrote:
>
>>
>>
>> On Wed, Jul 29, 2015 at 8:09 PM, sujith h <sujith.h@gmail.com <mailto:
>> sujith.h@gmail.com>> wrote:
>>
>>
>>
>>     On Wed, Jul 29, 2015 at 12:21 AM, Michael Wood
>>     <michael.g.wood@intel.com <mailto:michael.g.wood@intel.com>> wrote:
>>
>>         On 27/07/15 16:23, sujith h wrote:
>>
>>
>>
>>             On Mon, Jul 27, 2015 at 6:55 PM, Michael Wood
>>             <michael.g.wood@intel.com
>>             <mailto:michael.g.wood@intel.com>
>>             <mailto:michael.g.wood@intel.com
>>
>>             <mailto:michael.g.wood@intel.com>>> wrote:
>>
>>                 On 27/07/15 11:31, sujith h wrote:
>>
>>
>>
>>                     On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen
>>                     <belen.barros.pena@intel.com
>>             <mailto:belen.barros.pena@intel.com>
>>                     <mailto:belen.barros.pena@intel.com
>>             <mailto:belen.barros.pena@intel.com>>
>>                     <mailto:belen.barros.pena@intel.com
>>             <mailto:belen.barros.pena@intel.com>
>>                     <mailto:belen.barros.pena@intel.com
>>             <mailto:belen.barros.pena@intel.com>>>> wrote:
>>
>>
>>
>>                         On 27/07/2015 07:54, "sujith h"
>>             <sujith.h@gmail.com <mailto:sujith.h@gmail.com>
>>                     <mailto:sujith.h@gmail.com
>>             <mailto:sujith.h@gmail.com>>
>>                         <mailto:sujith.h@gmail.com
>>             <mailto:sujith.h@gmail.com> <mailto:sujith.h@gmail.com
>>             <mailto:sujith.h@gmail.com>>>>
>>                     wrote:
>>
>>                         >
>>                         >
>>                         >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena,
>>             Belen
>>                         ><belen.barros.pena@intel.com
>>             <mailto:belen.barros.pena@intel.com>
>>                     <mailto:belen.barros.pena@intel.com
>>             <mailto:belen.barros.pena@intel.com>>
>>                         <mailto:belen.barros.pena@intel.com
>>             <mailto:belen.barros.pena@intel.com>
>>                     <mailto:belen.barros.pena@intel.com
>>             <mailto:belen.barros.pena@intel.com>>>> wrote:
>>                         >
>>                         >
>>                         >
>>                         >On 24/07/2015 13:57, "sujith h"
>>             <sujith.h@gmail.com <mailto:sujith.h@gmail.com>
>>                     <mailto:sujith.h@gmail.com
>>             <mailto:sujith.h@gmail.com>>
>>                         <mailto:sujith.h@gmail.com
>>             <mailto:sujith.h@gmail.com> <mailto:sujith.h@gmail.com
>>             <mailto:sujith.h@gmail.com>>>>
>>
>>                     wrote:
>>                         >
>>                         >
>>                         >* Which version of Yocto Project you are
>>             using (fido or
>>                     master)?
>>                         >
>>                         >I am using fido branch.
>>                         >
>>                         >
>>                         >* Which release you have selected for your
>>             project?
>>                         >
>>                         >
>>                         >In the release I have selected "Local Yocto
>>             Project"
>>                         >
>>                         >
>>                         >* If you click the "view all compatible
>>             layers" link and
>>                     in that
>>                         page you
>>                         >search for meta-oe, do you get any results?
>>                         >
>>                         >I can see only "meta-yocto-bsp", "meta-yocto" and
>>                         "openembedded-core".
>>                         >Attached screenshot of the same.
>>                         >
>>                         >
>>                         >Also attaching screenshot of page where I try
>>             to import
>>                     meta-oe
>>                         from my
>>                         >locally cloned location.
>>                         >
>>                         >
>>                         >Below is the file structure I have:
>>                         >
>>             >sujith@kdekid:~/MEL/homework$ pwd
>>             >/home/sujith/MEL/homework
>>             >sujith@kdekid:~/MEL/homework$ ls -l
>>                         >total 5180
>>                         >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40
>>                     meta-oe-local
>>                         >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04
>>                         meta-openembedded-local
>>                         >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02
>>                     meta-qt5-local
>>                         >drwxrwxr-x 11 sujith sujith    4096 Jul 27
>>             12:07 poky
>>                         >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08
>>                         toaster_build_artifacts
>>                         >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19
>>                     toaster.sqlite
>>                         >drwxrwxr-x  6 sujith sujith    4096 Jul 24
>>             16:25 venv
>>             >sujith@kdekid:~/MEL/homework$
>>                         >
>>
>>                         Right, I've managed to reproduce this. Looking
>>             at the browser
>>                         console, it
>>                         might be a problem with the javascript doing
>>             the layer name
>>                         validation. If
>>                         you change the layer name to something
>>             completely random
>>                     that does not
>>                         exist in the Toaster database (something like
>>             meta-xyz),
>>                     can you
>>                         import
>>                         the layer?
>>
>>
>>                     Am bit new to the web world. So I gave a try with
>>             firebug to
>>                     debug which script ( Javascript or any ) call happens
>>                     when I click "Import  and add to project" button.
>>             Even after
>>                     changing meta-oe repo to meta-xyz as per suggestion,
>>                     the result remains same. But this is the output I
>>             see in the
>>                     firebug console:
>>                     |{"current_id": 5, "current_url":
>>                     "git://git.openembedded.org/meta-openembedded
>>             <http://git.openembedded.org/meta-openembedded>
>>                     <http://git.openembedded.org/meta-openembedded>
>>                     <http://git.openembedded.org/meta-openembedded>",
>>             "error":
>>             "hint-layer-exists-with-different-url"||}|
>>             hint-layer-exists-with-different-url
>>
>>                     Also attaching the screenshot of the same ( to get
>>             more clarity ).
>>
>>
>>                 Thanks for this, I noticed this wasn't working
>>             properly last week,
>>                 and rolled a couple of patches to fix these regressions.
>>
>>
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064
>>
>>                 and
>>
>>
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700
>>
>>                 I have a few other things to fix on this branch as I
>>             have been
>>                 fixing a number of things to allow me to test the new
>>             project
>>                 page, I'm intending to roll a separate branch for
>>             review on it.
>>
>>                 You've highlighted that we need a unit test which does
>>             a layer
>>                 import using the back end API calls, which although it
>>             wouldn't
>>                 have caught this error would be really good to have,
>>             if you're
>>                 interested in helping with that?
>>
>>
>>             It would be my pleasure to help :) I might need some
>>             assistance as I am learning Django. May be some hint like
>>             where to start with or so.
>>
>>
>>         This is the best place to start
>>         https://docs.djangoproject.com/en/1.6/topics/testing/overview/
>>
>>         In ./bitbake
>>         <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake
>> >/lib
>>         <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib
>> >/toaster
>>         <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster
>> >/toastergui
>>         <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui
>> >/tests.py
>>         <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui/tests.py
>> >
>>
>>         We can add something like
>>
>>         class ImportLayerTestCase(|ProvisionedLayersProjectTestCase|):
>>         ....
>>         ...
>>             def test_import_layer(self):
>>         client.post(reverse('xhr_importlayer',.....
>>
>>         ...
>>
>>         We can then use the JSON response from the client to help
>>         validate the data coming back as well as checking the import
>>         layer actually entered the database.
>>
>>         There are a few examples in the yocto error-report-web project
>>         too that might be useful to look at e.g.
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>>         <
>> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>> >
>>
>>         You can run the test by doing running ./manage.py test toastergui
>>
>>
>>     Thank you Michael for such a detailed step to follow. I have
>>     started reading the docs from django mentioned in the link and the
>>     reference mentioned in the mail.
>>
>>
>> I wrote a small piece of code in bitbake/lib/toaster/toastergui/tests.py.
>> Below is the code ( since I have written a small code, I thought to share
>> here. Kindly let me know if there is any problem sharing small code in the
>> mailing list ):
>> ----------
>> from django.test import TestCase
>> from django.test.client import Client
>> from django.core.urlresolvers import reverse
>> import json
>>
>>
>> class ImportLayerTestCase(TestCase):
>>     def test_import_layers(self):
>>         client = Client()
>>         json_string = json.dumps({'name':'meta-oe',
>> 'vcs-url':'/home/sujith/MEL/homework/meta-xyz',
>> 'git_ref':'c12b9596afd236116b25ce26dbe0d793de9dc7ce',
>> 'dir_path':'/home/sujith/MEL/homework/meta-xyz/meta-oe',
>>                       'project_id':'1', 'layer_deps':'1'})
>>         response = client.post(reverse('xhr_importlayer'),
>>                    {'data':json_string},
>>                    'json',
>>                    HTTP_X_REQUESTED_WITH='XMLHttpRequest')
>> -------------
>>
>> Let me know if I am in the right track. After following your mail and bit
>> of google, helped me in writing this code. My query here is when I try to
>> print response, it prints an html as follows:
>>
> --8<--
>
> Yep that's a good start, we currently don't actually pass IN a JSON
> document for the import layers call, it's just a bunch of parameters in the
> POST request.
> So instead of
>
>         json_string = json.dumps({'name':'meta-oe',
>>
>
> you can do:
>
>         data = {'name':'meta-oe',
>
>
> and then:
>
>        response = client.post(reverse('xhr_importlayer', args(1,)),
>                    data,
>

> etc
>

I modified my code segment to:
------------
        data = {'name':'meta-oe',
                'vcs-url':'/home/sujith/MEL/homework/meta-xyz',
                'git_ref':'c12b9596afd236116b25ce26dbe0d793de9dc7ce',
                'dir_path':'/home/sujith/MEL/homework/meta-xyz/meta-oe',
                'project_id':'1', 'layer_deps':'1'}
        response = client.post(reverse('xhr_importlayer'),
                   data, 'json',
                   HTTP_X_REQUESTED_WITH='XMLHttpRequest')
------------

After making this change when I try to run ./manage.py test toastergui, I
get an error saying:

--------------
(venv)sujith@kdekidd0:~/MEL/toaster_work/poky/bitbake/lib/toaster$
./manage.py test toastergui
Creating test database for alias 'default'...
Content-Type: application/json

{
  "error": "Missing parameters; requires vcs_url, name, git_ref and
project_id"
}
.
----------------------------------------------------------------------
Ran 1 test in 0.184s

OK
Destroying test database for alias 'default'...
(venv)sujith@kdekidd0:~/MEL/toaster_work/poky/bitbake/lib/toaster$
--------------

Bit confusing for me. From the views.py I can see that there is a
conditional check that is made for vcs_url, git_ref, project_id and name.
Which we are already providing in the dictionary, data.


>
> Looking at that response I'm wondering if you are you using current master
> branch? It seems to be showing the old response to that request where you
> haven't enabled build mode (which is enabled by default in current master).
> The response should be a JSON response where you have the returned state in
> it e.g. { "error" : "hint-layer-exists" } We can then parse this and test
> the various conditions are correct based on the data we sent it.
>

Just now moved to master branch. I was in the fido branch when I did my
initial testing.

>
> Thanks,
>
> Michael
>
>
>
>
>
>
>


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 22760 bytes --]

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

* Re: Usage of already cloned layers in toaster
  2015-08-04 10:35                       ` sujith h
@ 2015-08-04 13:16                         ` sujith h
  0 siblings, 0 replies; 20+ messages in thread
From: sujith h @ 2015-08-04 13:16 UTC (permalink / raw)
  To: Michael Wood; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 15115 bytes --]

On Tue, Aug 4, 2015 at 4:05 PM, sujith h <sujith.h@gmail.com> wrote:

>
>
> On Mon, Aug 3, 2015 at 3:56 PM, Michael Wood <michael.g.wood@intel.com>
> wrote:
>
>> On 31/07/15 14:06, sujith h wrote:
>>
>>>
>>>
>>> On Wed, Jul 29, 2015 at 8:09 PM, sujith h <sujith.h@gmail.com <mailto:
>>> sujith.h@gmail.com>> wrote:
>>>
>>>
>>>
>>>     On Wed, Jul 29, 2015 at 12:21 AM, Michael Wood
>>>     <michael.g.wood@intel.com <mailto:michael.g.wood@intel.com>> wrote:
>>>
>>>         On 27/07/15 16:23, sujith h wrote:
>>>
>>>
>>>
>>>             On Mon, Jul 27, 2015 at 6:55 PM, Michael Wood
>>>             <michael.g.wood@intel.com
>>>             <mailto:michael.g.wood@intel.com>
>>>             <mailto:michael.g.wood@intel.com
>>>
>>>             <mailto:michael.g.wood@intel.com>>> wrote:
>>>
>>>                 On 27/07/15 11:31, sujith h wrote:
>>>
>>>
>>>
>>>                     On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen
>>>                     <belen.barros.pena@intel.com
>>>             <mailto:belen.barros.pena@intel.com>
>>>                     <mailto:belen.barros.pena@intel.com
>>>             <mailto:belen.barros.pena@intel.com>>
>>>                     <mailto:belen.barros.pena@intel.com
>>>             <mailto:belen.barros.pena@intel.com>
>>>                     <mailto:belen.barros.pena@intel.com
>>>             <mailto:belen.barros.pena@intel.com>>>> wrote:
>>>
>>>
>>>
>>>                         On 27/07/2015 07:54, "sujith h"
>>>             <sujith.h@gmail.com <mailto:sujith.h@gmail.com>
>>>                     <mailto:sujith.h@gmail.com
>>>             <mailto:sujith.h@gmail.com>>
>>>                         <mailto:sujith.h@gmail.com
>>>             <mailto:sujith.h@gmail.com> <mailto:sujith.h@gmail.com
>>>             <mailto:sujith.h@gmail.com>>>>
>>>                     wrote:
>>>
>>>                         >
>>>                         >
>>>                         >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena,
>>>             Belen
>>>                         ><belen.barros.pena@intel.com
>>>             <mailto:belen.barros.pena@intel.com>
>>>                     <mailto:belen.barros.pena@intel.com
>>>             <mailto:belen.barros.pena@intel.com>>
>>>                         <mailto:belen.barros.pena@intel.com
>>>             <mailto:belen.barros.pena@intel.com>
>>>                     <mailto:belen.barros.pena@intel.com
>>>             <mailto:belen.barros.pena@intel.com>>>> wrote:
>>>                         >
>>>                         >
>>>                         >
>>>                         >On 24/07/2015 13:57, "sujith h"
>>>             <sujith.h@gmail.com <mailto:sujith.h@gmail.com>
>>>                     <mailto:sujith.h@gmail.com
>>>             <mailto:sujith.h@gmail.com>>
>>>                         <mailto:sujith.h@gmail.com
>>>             <mailto:sujith.h@gmail.com> <mailto:sujith.h@gmail.com
>>>             <mailto:sujith.h@gmail.com>>>>
>>>
>>>                     wrote:
>>>                         >
>>>                         >
>>>                         >* Which version of Yocto Project you are
>>>             using (fido or
>>>                     master)?
>>>                         >
>>>                         >I am using fido branch.
>>>                         >
>>>                         >
>>>                         >* Which release you have selected for your
>>>             project?
>>>                         >
>>>                         >
>>>                         >In the release I have selected "Local Yocto
>>>             Project"
>>>                         >
>>>                         >
>>>                         >* If you click the "view all compatible
>>>             layers" link and
>>>                     in that
>>>                         page you
>>>                         >search for meta-oe, do you get any results?
>>>                         >
>>>                         >I can see only "meta-yocto-bsp", "meta-yocto"
>>> and
>>>                         "openembedded-core".
>>>                         >Attached screenshot of the same.
>>>                         >
>>>                         >
>>>                         >Also attaching screenshot of page where I try
>>>             to import
>>>                     meta-oe
>>>                         from my
>>>                         >locally cloned location.
>>>                         >
>>>                         >
>>>                         >Below is the file structure I have:
>>>                         >
>>>             >sujith@kdekid:~/MEL/homework$ pwd
>>>             >/home/sujith/MEL/homework
>>>             >sujith@kdekid:~/MEL/homework$ ls -l
>>>                         >total 5180
>>>                         >drwxrwxr-x 19 sujith sujith    4096 Jun 12 18:40
>>>                     meta-oe-local
>>>                         >drwxrwxr-x 19 sujith sujith    4096 Jul 24 18:04
>>>                         meta-openembedded-local
>>>                         >drwxrwxr-x  8 sujith sujith    4096 Jul 24 18:02
>>>                     meta-qt5-local
>>>                         >drwxrwxr-x 11 sujith sujith    4096 Jul 27
>>>             12:07 poky
>>>                         >drwxrwxr-x  2 sujith sujith    4096 Jul 27 12:08
>>>                         toaster_build_artifacts
>>>                         >-rw-r--r--  1 sujith sujith 5277696 Jul 27 12:19
>>>                     toaster.sqlite
>>>                         >drwxrwxr-x  6 sujith sujith    4096 Jul 24
>>>             16:25 venv
>>>             >sujith@kdekid:~/MEL/homework$
>>>                         >
>>>
>>>                         Right, I've managed to reproduce this. Looking
>>>             at the browser
>>>                         console, it
>>>                         might be a problem with the javascript doing
>>>             the layer name
>>>                         validation. If
>>>                         you change the layer name to something
>>>             completely random
>>>                     that does not
>>>                         exist in the Toaster database (something like
>>>             meta-xyz),
>>>                     can you
>>>                         import
>>>                         the layer?
>>>
>>>
>>>                     Am bit new to the web world. So I gave a try with
>>>             firebug to
>>>                     debug which script ( Javascript or any ) call happens
>>>                     when I click "Import  and add to project" button.
>>>             Even after
>>>                     changing meta-oe repo to meta-xyz as per suggestion,
>>>                     the result remains same. But this is the output I
>>>             see in the
>>>                     firebug console:
>>>                     |{"current_id": 5, "current_url":
>>>                     "git://git.openembedded.org/meta-openembedded
>>>             <http://git.openembedded.org/meta-openembedded>
>>>                     <http://git.openembedded.org/meta-openembedded>
>>>                     <http://git.openembedded.org/meta-openembedded>",
>>>             "error":
>>>             "hint-layer-exists-with-different-url"||}|
>>>             hint-layer-exists-with-different-url
>>>
>>>                     Also attaching the screenshot of the same ( to get
>>>             more clarity ).
>>>
>>>
>>>                 Thanks for this, I noticed this wasn't working
>>>             properly last week,
>>>                 and rolled a couple of patches to fix these regressions.
>>>
>>>
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064
>>>
>>>                 and
>>>
>>>
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700
>>>
>>>                 I have a few other things to fix on this branch as I
>>>             have been
>>>                 fixing a number of things to allow me to test the new
>>>             project
>>>                 page, I'm intending to roll a separate branch for
>>>             review on it.
>>>
>>>                 You've highlighted that we need a unit test which does
>>>             a layer
>>>                 import using the back end API calls, which although it
>>>             wouldn't
>>>                 have caught this error would be really good to have,
>>>             if you're
>>>                 interested in helping with that?
>>>
>>>
>>>             It would be my pleasure to help :) I might need some
>>>             assistance as I am learning Django. May be some hint like
>>>             where to start with or so.
>>>
>>>
>>>         This is the best place to start
>>>         https://docs.djangoproject.com/en/1.6/topics/testing/overview/
>>>
>>>         In ./bitbake
>>>         <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake
>>> >/lib
>>>         <
>>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib
>>> >/toaster
>>>         <
>>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster
>>> >/toastergui
>>>         <
>>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui
>>> >/tests.py
>>>         <
>>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui/tests.py
>>> >
>>>
>>>         We can add something like
>>>
>>>         class ImportLayerTestCase(|ProvisionedLayersProjectTestCase|):
>>>         ....
>>>         ...
>>>             def test_import_layer(self):
>>>         client.post(reverse('xhr_importlayer',.....
>>>
>>>         ...
>>>
>>>         We can then use the JSON response from the client to help
>>>         validate the data coming back as well as checking the import
>>>         layer actually entered the database.
>>>
>>>         There are a few examples in the yocto error-report-web project
>>>         too that might be useful to look at e.g.
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>>>         <
>>> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>>> >
>>>
>>>         You can run the test by doing running ./manage.py test toastergui
>>>
>>>
>>>     Thank you Michael for such a detailed step to follow. I have
>>>     started reading the docs from django mentioned in the link and the
>>>     reference mentioned in the mail.
>>>
>>>
>>> I wrote a small piece of code in
>>> bitbake/lib/toaster/toastergui/tests.py. Below is the code ( since I have
>>> written a small code, I thought to share here. Kindly let me know if there
>>> is any problem sharing small code in the mailing list ):
>>> ----------
>>> from django.test import TestCase
>>> from django.test.client import Client
>>> from django.core.urlresolvers import reverse
>>> import json
>>>
>>>
>>> class ImportLayerTestCase(TestCase):
>>>     def test_import_layers(self):
>>>         client = Client()
>>>         json_string = json.dumps({'name':'meta-oe',
>>> 'vcs-url':'/home/sujith/MEL/homework/meta-xyz',
>>> 'git_ref':'c12b9596afd236116b25ce26dbe0d793de9dc7ce',
>>> 'dir_path':'/home/sujith/MEL/homework/meta-xyz/meta-oe',
>>>                       'project_id':'1', 'layer_deps':'1'})
>>>         response = client.post(reverse('xhr_importlayer'),
>>>                    {'data':json_string},
>>>                    'json',
>>>                    HTTP_X_REQUESTED_WITH='XMLHttpRequest')
>>> -------------
>>>
>>> Let me know if I am in the right track. After following your mail and
>>> bit of google, helped me in writing this code. My query here is when I try
>>> to print response, it prints an html as follows:
>>>
>> --8<--
>>
>> Yep that's a good start, we currently don't actually pass IN a JSON
>> document for the import layers call, it's just a bunch of parameters in the
>> POST request.
>> So instead of
>>
>>         json_string = json.dumps({'name':'meta-oe',
>>>
>>
>> you can do:
>>
>>         data = {'name':'meta-oe',
>>
>>
>> and then:
>>
>>        response = client.post(reverse('xhr_importlayer', args(1,)),
>>                    data,
>>
>
>> etc
>>
>
> I modified my code segment to:
> ------------
>         data = {'name':'meta-oe',
>                 'vcs-url':'/home/sujith/MEL/homework/meta-xyz',
>                 'git_ref':'c12b9596afd236116b25ce26dbe0d793de9dc7ce',
>                 'dir_path':'/home/sujith/MEL/homework/meta-xyz/meta-oe',
>                 'project_id':'1', 'layer_deps':'1'}
>         response = client.post(reverse('xhr_importlayer'),
>                    data, 'json',
>                    HTTP_X_REQUESTED_WITH='XMLHttpRequest')
> ------------
>
>
Modified code bit further:
 response = client.post(reverse('xhr_importlayer'),
                   data, content_type="application/json"


Also resulted in the same error.


> After making this change when I try to run ./manage.py test toastergui, I
> get an error saying:
>
> --------------
> (venv)sujith@kdekidd0:~/MEL/toaster_work/poky/bitbake/lib/toaster$
> ./manage.py test toastergui
> Creating test database for alias 'default'...
> Content-Type: application/json
>
> {
>   "error": "Missing parameters; requires vcs_url, name, git_ref and
> project_id"
> }
> .
> ----------------------------------------------------------------------
> Ran 1 test in 0.184s
>
> OK
> Destroying test database for alias 'default'...
> (venv)sujith@kdekidd0:~/MEL/toaster_work/poky/bitbake/lib/toaster$
> --------------
>
> Bit confusing for me. From the views.py I can see that there is a
> conditional check that is made for vcs_url, git_ref, project_id and name.
> Which we are already providing in the dictionary, data.
>
>
>>
>> Looking at that response I'm wondering if you are you using current
>> master branch? It seems to be showing the old response to that request
>> where you haven't enabled build mode (which is enabled by default in
>> current master). The response should be a JSON response where you have the
>> returned state in it e.g. { "error" : "hint-layer-exists" } We can then
>> parse this and test the various conditions are correct based on the data we
>> sent it.
>>
>
> Just now moved to master branch. I was in the fido branch when I did my
> initial testing.
>
>>
>> Thanks,
>>
>> Michael
>>
>>
>>
>>
>>
>>
>>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 24075 bytes --]

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

end of thread, other threads:[~2015-08-04 13:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-24  9:56 Usage of already cloned layers in toaster Barros Pena, Belen
2015-07-24 10:21 ` Damian, Alexandru
2015-07-24 12:57 ` sujith h
2015-07-24 13:06   ` Barros Pena, Belen
2015-07-27  6:54     ` sujith h
2015-07-27 10:09       ` Barros Pena, Belen
2015-07-27 10:29         ` Barros Pena, Belen
2015-07-27 10:38           ` sujith h
2015-07-27 10:59             ` Barros Pena, Belen
2015-07-27 10:31         ` sujith h
2015-07-27 13:25           ` Michael Wood
2015-07-27 15:23             ` sujith h
2015-07-28 18:51               ` Michael Wood
2015-07-29 14:39                 ` sujith h
2015-07-31 13:06                   ` sujith h
2015-08-03 10:26                     ` Michael Wood
2015-08-04 10:35                       ` sujith h
2015-08-04 13:16                         ` sujith h
  -- strict thread matches above, loose matches on Subject: below --
2015-07-24  9:37 Haridasan, Sujith
2015-07-23  6:14 Haridasan, Sujith

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.