* [PATCH] toaster/toastergui: Bug-fix verify given layer path only if import/add local layer
@ 2024-01-04 15:18 Alassane Yattara
2024-01-05 0:00 ` [Toaster] " Richard Purdie
[not found] ` <17A74A7597EB16F1.25044@lists.yoctoproject.org>
0 siblings, 2 replies; 3+ messages in thread
From: Alassane Yattara @ 2024-01-04 15:18 UTC (permalink / raw)
To: toaster; +Cc: Alassane Yattara
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
---
lib/toaster/toastergui/api.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/lib/toaster/toastergui/api.py b/lib/toaster/toastergui/api.py
index a06ffc00..e367bd91 100644
--- a/lib/toaster/toastergui/api.py
+++ b/lib/toaster/toastergui/api.py
@@ -227,7 +227,7 @@ class XhrSetDefaultImageUrl(View):
# same logical name
# * Each project that uses a layer will have its own
# LayerVersion and Project Layer for it
-# * During the Paroject delete process, when the last
+# * During the Project delete process, when the last
# LayerVersion for a 'local_source_dir' layer is deleted
# then the Layer record is deleted to remove orphans
#
@@ -457,15 +457,18 @@ class XhrLayer(View):
'layerdetailurl':
layer_dep.get_detailspage_url(project.pk)})
- # Scan the layer's content and update components
- scan_layer_content(layer,layer_version)
+ # Only scan_layer_content if layer is local
+ if layer_data.get('local_source_dir', None):
+ # Scan the layer's content and update components
+ scan_layer_content(layer,layer_version)
except Layer_Version.DoesNotExist:
return error_response("layer-dep-not-found")
except Project.DoesNotExist:
return error_response("project-not-found")
- except KeyError:
- return error_response("incorrect-parameters")
+ except KeyError as e:
+ _log("KeyError: %s" % e)
+ return error_response(f"incorrect-parameters")
return JsonResponse({'error': "ok",
'imported_layer': {
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Toaster] [PATCH] toaster/toastergui: Bug-fix verify given layer path only if import/add local layer
2024-01-04 15:18 [PATCH] toaster/toastergui: Bug-fix verify given layer path only if import/add local layer Alassane Yattara
@ 2024-01-05 0:00 ` Richard Purdie
[not found] ` <17A74A7597EB16F1.25044@lists.yoctoproject.org>
1 sibling, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2024-01-05 0:00 UTC (permalink / raw)
To: Alassane Yattara, toaster
On Thu, 2024-01-04 at 16:18 +0100, Alassane Yattara wrote:
> Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
> ---
> lib/toaster/toastergui/api.py | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/lib/toaster/toastergui/api.py b/lib/toaster/toastergui/api.py
> index a06ffc00..e367bd91 100644
> --- a/lib/toaster/toastergui/api.py
> +++ b/lib/toaster/toastergui/api.py
> @@ -227,7 +227,7 @@ class XhrSetDefaultImageUrl(View):
> # same logical name
> # * Each project that uses a layer will have its own
> # LayerVersion and Project Layer for it
> -# * During the Paroject delete process, when the last
> +# * During the Project delete process, when the last
> # LayerVersion for a 'local_source_dir' layer is deleted
> # then the Layer record is deleted to remove orphans
> #
> @@ -457,15 +457,18 @@ class XhrLayer(View):
> 'layerdetailurl':
> layer_dep.get_detailspage_url(project.pk)})
>
> - # Scan the layer's content and update components
> - scan_layer_content(layer,layer_version)
> + # Only scan_layer_content if layer is local
> + if layer_data.get('local_source_dir', None):
> + # Scan the layer's content and update components
> + scan_layer_content(layer,layer_version)
>
> except Layer_Version.DoesNotExist:
> return error_response("layer-dep-not-found")
> except Project.DoesNotExist:
> return error_response("project-not-found")
> - except KeyError:
> - return error_response("incorrect-parameters")
> + except KeyError as e:
> + _log("KeyError: %s" % e)
> + return error_response(f"incorrect-parameters")
>
> return JsonResponse({'error': "ok",
> 'imported_layer': {
Thanks! I made 4 test runs with this applied and the failure counts
reduced significantly, there was only one failure on one build:
https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/116
I've merged this patch and scheduled a few more test runs.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Toaster] [PATCH] toaster/toastergui: Bug-fix verify given layer path only if import/add local layer
[not found] ` <17A74A7597EB16F1.25044@lists.yoctoproject.org>
@ 2024-01-05 7:49 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2024-01-05 7:49 UTC (permalink / raw)
To: Alassane Yattara, toaster; +Cc: Mohammed Raza
On Fri, 2024-01-05 at 00:00 +0000, Richard Purdie via
lists.yoctoproject.org wrote:
> On Thu, 2024-01-04 at 16:18 +0100, Alassane Yattara wrote:
> > Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
> > ---
> > lib/toaster/toastergui/api.py | 13 ++++++++-----
> > 1 file changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/lib/toaster/toastergui/api.py b/lib/toaster/toastergui/api.py
> > index a06ffc00..e367bd91 100644
> > --- a/lib/toaster/toastergui/api.py
> > +++ b/lib/toaster/toastergui/api.py
> > @@ -227,7 +227,7 @@ class XhrSetDefaultImageUrl(View):
> > # same logical name
> > # * Each project that uses a layer will have its own
> > # LayerVersion and Project Layer for it
> > -# * During the Paroject delete process, when the last
> > +# * During the Project delete process, when the last
> > # LayerVersion for a 'local_source_dir' layer is deleted
> > # then the Layer record is deleted to remove orphans
> > #
> > @@ -457,15 +457,18 @@ class XhrLayer(View):
> > 'layerdetailurl':
> > layer_dep.get_detailspage_url(project.pk)})
> >
> > - # Scan the layer's content and update components
> > - scan_layer_content(layer,layer_version)
> > + # Only scan_layer_content if layer is local
> > + if layer_data.get('local_source_dir', None):
> > + # Scan the layer's content and update components
> > + scan_layer_content(layer,layer_version)
> >
> > except Layer_Version.DoesNotExist:
> > return error_response("layer-dep-not-found")
> > except Project.DoesNotExist:
> > return error_response("project-not-found")
> > - except KeyError:
> > - return error_response("incorrect-parameters")
> > + except KeyError as e:
> > + _log("KeyError: %s" % e)
> > + return error_response(f"incorrect-parameters")
> >
> > return JsonResponse({'error': "ok",
> > 'imported_layer': {
>
> Thanks! I made 4 test runs with this applied and the failure counts
> reduced significantly, there was only one failure on one build:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/116
>
> I've merged this patch and scheduled a few more test runs.
I ran 5 more runs, we had 2 successes and 3 failures:
https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/119
tests/functional/test_project_page_tab_config.py::TestProjectConfigTab::test_project_config_tab_right_section
https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/120
tests/functional/test_create_new_project.py::TestCreateNewProject::test_create_new_project_dunfell
https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/122
tests/functional/test_create_new_project.py::TestCreateNewProject::test_create_new_project_dunfell
With 119 above being:
tests/functional/test_project_page_tab_config.py::TestProjectConfigTab::test_image_recipe_show_rows
So I think there is still something making the tests a little
unreliable unfortunately :(.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-05 7:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04 15:18 [PATCH] toaster/toastergui: Bug-fix verify given layer path only if import/add local layer Alassane Yattara
2024-01-05 0:00 ` [Toaster] " Richard Purdie
[not found] ` <17A74A7597EB16F1.25044@lists.yoctoproject.org>
2024-01-05 7:49 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).