* [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users
@ 2015-10-01 17:08 Ed Bartosh
2015-10-01 17:08 ` [PATCH 1/2] toaster: delete recipe if it can't be saved Ed Bartosh
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ed Bartosh @ 2015-10-01 17:08 UTC (permalink / raw)
To: toaster
Hi,
Fixed 7969. The issue was caused by incomplete records in the database.
Now the root cause is fixed in backend(lsupdate).
Just to make sure incomplete records are not shown in UI even if they exist
another piece of backend(get_all_compatible_recipes) was modified to filter
out recipes with empty names.
The following changes since commit 7b10ae122d46891c734e786358ea5f36760e8d5e:
toaster: Fix broken test case (2015-10-01 10:42:16 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib ed/toaster/7969
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/7969
Ed Bartosh (2):
toaster: delete recipe if it can't be saved
toaster: exclude recipes with empty names
bitbake/lib/toaster/orm/models.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
Regards,
Ed
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] toaster: delete recipe if it can't be saved
2015-10-01 17:08 [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users Ed Bartosh
@ 2015-10-01 17:08 ` Ed Bartosh
2015-10-01 17:08 ` [PATCH 2/2] toaster: exclude recipes with empty names Ed Bartosh
2015-10-01 21:19 ` [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users Brian Avery
2 siblings, 0 replies; 4+ messages in thread
From: Ed Bartosh @ 2015-10-01 17:08 UTC (permalink / raw)
To: toaster
Due to Recipe model constraints some recipes can't be
saved. However, they still can create incomplete records in
the database. This causes all sorts of errors when Toaster
operates with those objects. Removing them should fix those
issues.
[YOCTO #7969]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
bitbake/lib/toaster/orm/models.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 5aed158..89343f2 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1011,6 +1011,7 @@ class LayerIndexLayerSource(LayerSource):
ro.save()
except IntegrityError as e:
logger.debug("Failed saving recipe, ignoring: %s (%s:%s)" % (e, ro.layer_version, ri['filepath']+"/"+ri['filename']))
+ ro.delete()
if not connection.features.autocommits_when_autocommit_is_off:
transaction.set_autocommit(True)
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] toaster: exclude recipes with empty names
2015-10-01 17:08 [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users Ed Bartosh
2015-10-01 17:08 ` [PATCH 1/2] toaster: delete recipe if it can't be saved Ed Bartosh
@ 2015-10-01 17:08 ` Ed Bartosh
2015-10-01 21:19 ` [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users Brian Avery
2 siblings, 0 replies; 4+ messages in thread
From: Ed Bartosh @ 2015-10-01 17:08 UTC (permalink / raw)
To: toaster
Modified get_all_compatible_recipes function to exclude recipes
with empty names from the result queryset. This should stop UI
to show recipes with empty names in compatible recipes page.
[YOCTO #7969]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
bitbake/lib/toaster/orm/models.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 89343f2..ad12dd4 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -253,7 +253,7 @@ class Project(models.Model):
""" Returns QuerySet of all the compatible Recipes available to the
project including ones from Layers not currently added """
queryset = Recipe.objects.filter(
- layer_version__in=self.get_all_compatible_layer_versions())
+ layer_version__in=self.get_all_compatible_layer_versions()).exclude(name__exact='')
return queryset
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users
2015-10-01 17:08 [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users Ed Bartosh
2015-10-01 17:08 ` [PATCH 1/2] toaster: delete recipe if it can't be saved Ed Bartosh
2015-10-01 17:08 ` [PATCH 2/2] toaster: exclude recipes with empty names Ed Bartosh
@ 2015-10-01 21:19 ` Brian Avery
2 siblings, 0 replies; 4+ messages in thread
From: Brian Avery @ 2015-10-01 21:19 UTC (permalink / raw)
To: Ed Bartosh; +Cc: toaster
worked for me on both new layer pull and on an old db with bad recipes
and a migration.
Upstreamed and pushed to toaster-next.
-b
p.s. we still have 1 broken orm test but that was there before this test.
broken test:
orm ->FAIL: test_build_layerversion (orm.tests.LayerVersionEquivalenceTestCase)
On Thu, Oct 1, 2015 at 10:08 AM, Ed Bartosh <ed.bartosh@linux.intel.com> wrote:
> Hi,
>
> Fixed 7969. The issue was caused by incomplete records in the database.
> Now the root cause is fixed in backend(lsupdate).
> Just to make sure incomplete records are not shown in UI even if they exist
> another piece of backend(get_all_compatible_recipes) was modified to filter
> out recipes with empty names.
>
> The following changes since commit 7b10ae122d46891c734e786358ea5f36760e8d5e:
>
> toaster: Fix broken test case (2015-10-01 10:42:16 +0100)
>
> are available in the git repository at:
>
> git://git.yoctoproject.org/poky-contrib ed/toaster/7969
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/7969
>
> Ed Bartosh (2):
> toaster: delete recipe if it can't be saved
> toaster: exclude recipes with empty names
>
> bitbake/lib/toaster/orm/models.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --
> Regards,
> Ed
>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-01 21:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-01 17:08 [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users Ed Bartosh
2015-10-01 17:08 ` [PATCH 1/2] toaster: delete recipe if it can't be saved Ed Bartosh
2015-10-01 17:08 ` [PATCH 2/2] toaster: exclude recipes with empty names Ed Bartosh
2015-10-01 21:19 ` [PATCH 0/2] fix for 7969 - Toaster shows recipes without names to users Brian Avery
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.