On 01/04/2015 03:26, "Reyna, David" <[email protected]> wrote:
>Hi Belén, > >> However, something strange is happening with >> the Sourcetype field. Whatever value I select there, >> it reverts to 'local'. > >1) Ok, I have found the issue and resolution, and I have updated my >commit to V2: > > dreyna/add_layersource_7437 > >The issue was that "LayerSource::Save" was using the "__class__" value to >force the "sourcetype", but that is all wrong for the save method where >the user is trying to explicitly set a new value of "sourcetype", so it >was locking the objects to "local". I have reverse that functionality to >allow the user's "sourcetype" to force the class type. > >With this change I can now easily create layers and also change their >source types. Yep, this is working for me. Thanks! > >2) I do have a question. I tried to test this feature and I find I do not >know how to use it, and the documentation did not help. > >I created a new layer source, using examples from 7505: > > Name=my-raspberry > Type=Import > Apiurl=https://github.com/agherzan/meta-raspberrypi > > * When I then create a new project, this layer is not available, >neither as a new default layer nor as a selectable layer. > * The Admin interface does not match the "Import Layer" interface, in >that there are no "Revision" nor "Repository subdirectory" entries. > * I even tried "bitbake/lib/toaster/manage.py lsupdates" and restarted >Toaster, but that did not change anything. Right, I think we are confusing layer sources with importing layers, but they are 2 different things. The confusion is understandable: the Django admin interface should not be asking for the Apiurl for a layer source of type 'imported'. Those changes were covered by https://bugzilla.yoctoproject.org/show_bug.cgi?id=6897 But that feature was pushed to 1.9. I'll try to explain. A layer source is a set of information about existing layers. There is a type of layer source called 'layer index', which is the one you would set up via the Django admin interface, and that is an instance of a layer index application that contains information about a set of custom layers. An example of a layer index in the OpenEmbedded one, which lives at http://layers.openembedded.org That's the one that comes configured by default with Toaster. A layer index application has a REST API that Toaster can use to "collect" the layer information and store it in its database. The URL of that API is what you need to enter in the Apiurl field. You should go to the trouble of setting up your own layer index when you have a collection of custom layers that you want to make easily available to users of your Toaster instance. The 'imported' layer source type exists to enable the 'import layer' functionality. This layer source type should not be exposed via the Django admin interface. The import layer functionality is there to allow users to build their own layers. To import a layer, you need to provide the URL of a Git repo. That is what you are trying to do above, but you cannot do that from the Django admin interface: you can only import layers via the Toaster web UI. There is a section about layer sources in the Toaster manual: > >I am very confused. > >3) I also tried the "Import Layer" user interface, and I find that the >"Import and Add to project" button does not do anything, even with all >the fields filled in. I am probably missing a patch. > >- David > >> -----Original Message----- >> From: Barros Pena, Belen [mailto:[email protected]] >> Sent: Tuesday, March 31, 2015 9:31 AM >> To: Reyna, David; DAMIAN, ALEXANDRU >> Cc: [email protected] >> Subject: Re: [Toaster] [review-request] dreyna/add_layersource_7437 >> >> >> >> On 31/03/2015 10:06, "Reyna, David" <[email protected]> wrote: >> >> >Hi Belén and Alex, >> > >> >I have a working solution for 7437, in that clicking the add new layer >> >sources no longer crashes. >> > >> > dreyna/add_layersource_7437 >> > >> >It appears to me that given the backtrace, the Django admin is >>attempting >> >to touch the new layer source object before the Toaster code can >> >initialize it. This patch simple initializes the empty members to a >>sane >> >(but empty) object values, allowing the bootstrap to finish. When the >> >"Add layer source" page does appear to the user, all of the fields are >> >indeed empty as you would expect. >> > >> >You may not like this particular solution, but it works, and may >>indicate >> >an obvious alternative fix if you see one. >> >> Can't comment on the patch itself, but the page no longer crashes and I >> can create a layer source. However, something strange is happening with >> the Sourcetype field. Whatever value I select there, it reverts to >>'local'. >> >> Let me know if you need me to open a new issue for this. >> >> Cheers >> >> Belén >> >> > >> >diff --git a/bitbake/lib/toaster/orm/models.py >> >b/bitbake/lib/toaster/orm/models.py >> >index 625eb1e..abe9c3a 100644 >> >--- a/bitbake/lib/toaster/orm/models.py >> >+++ b/bitbake/lib/toaster/orm/models.py >> >@@ -651,6 +651,14 @@ class LayerSource(models.Model): >> > return super(LayerSource, self).save(*args, **kwargs) >> > >> > def get_object(self): >> >+ # preset an un-initilized object >> >+ if None == self.name: >> >+ self.name="" >> >+ if None == self.apiurl: >> >+ self.apiurl="" >> >+ if None == self.sourcetype: >> >+ self.sourcetype=LayerSource.TYPE_LOCAL >> >+ >> > if self.sourcetype == LayerSource.TYPE_LOCAL: >> > self.__class__ = LocalLayerSource >> > elif self.sourcetype == LayerSource.TYPE_LAYERINDEX: >> > >> >- David >> > >> >> -----Original Message----- >> >> From: [email protected] [mailto:toaster- >> >> [email protected]] On Behalf Of Reyna, David >> >> Sent: Monday, March 30, 2015 6:37 PM >> >> To: BARROS PENA, BELEN; WOOD, MICHAEL; DAMIAN, ALEXANDRU >> >> Cc: [email protected] >> >> Subject: [Toaster] [review-request] dreyna/projects_pagecount_7483 >> >> >> >> Hi Belén and Michael, >> >> >> >> I went ahead and grabbed (and solved) 7483 "Searching in the all >> >>projects >> >> table resets the 'show rows' menu to '10'" since it was still in the >>new >> >> state. >> >> >> >> dreyna/projects_pagecount_7483 >> >> >> >> The "count" value for the all projects page was not fully saved in >>the >> >> cookies because the view class did not end with a >> >> '_save_parameters_cookies'. >> >> >> >> The intermediate cookie "_count" was there (from >>basetable_bottom.html) >> >> which is why it kind of worked, but that is not used when a search is >> >> issued. >> >> >> >> - David >> >> >> >> -- >> >> _______________________________________________ >> >> toaster mailing list >> >> [email protected] >> >> https://lists.yoctoproject.org/listinfo/toaster >> > -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
