Patchwork [bitbake-devel,56/94] bitbake: webhob: add simple visualisation for build errors

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 24, 2013, 4:52 p.m.
Message ID <f42ec76b022a796ad68dfbd32face301d2e12908.1380041477.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/58745/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 24, 2013, 4:52 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

Adding Simple web error viewing in the builds page.
Now the error/warning column will contain the actual
content of the error.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bitbake/lib/webhob/bldviewer/templates/build.html | 4 ++--
 bitbake/lib/webhob/bldviewer/views.py             | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

Patch

diff --git a/bitbake/lib/webhob/bldviewer/templates/build.html b/bitbake/lib/webhob/bldviewer/templates/build.html
index 15d88a0..bef84a9 100644
--- a/bitbake/lib/webhob/bldviewer/templates/build.html
+++ b/bitbake/lib/webhob/bldviewer/templates/build.html
@@ -33,8 +33,8 @@ 
             <td>{% if build.is_image %} <a href="/simple/build/{{build.id}}/package/">{{build.is_image}}</a>{% else %} {{build.is_image}} {% endif %}</td>
             <td>{{build.machine.name}}</td>
             <td>{% time_difference build.started_on build.completed_on %}</td>
-            <td>{{build.errors_no}}</td>
-            <td>{{build.warnings_no}}</td>
+            <td>{% if  build.errors_no %}{% for error in logs %}{% if error.build == build %}{% if error.level == 2 %}<p>{{error.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td>
+            <td>{% if  build.warnings_no %}{% for warning in logs %}{% if warning.build == build %}{% if warning.level == 1 %}<p>{{warning.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td>
             <td>{{build.image_fstypes}}</td>
             <td>{{build.cooker_log_path}}</td>
             <td>{{build.bitbake_version}}</td>
diff --git a/bitbake/lib/webhob/bldviewer/views.py b/bitbake/lib/webhob/bldviewer/views.py
index 99e4b99..8535963 100644
--- a/bitbake/lib/webhob/bldviewer/views.py
+++ b/bitbake/lib/webhob/bldviewer/views.py
@@ -2,14 +2,16 @@  import operator
 
 from django.db.models import Q
 from django.shortcuts import render
-from orm.models import Build, Task, Layer, Layer_Version, Task_Dependency, Recipe, Package, Package_Dependency
+from orm.models import Build, Task, Layer, Layer_Version, Recipe, Package, LogMessage
+from orm.models import Task_Dependency, Package_Dependency
 
 
 def build(request):
     template = 'build.html'
     build_info = Build.objects.all()
+    logs = LogMessage.objects.all()
 
-    context = {'builds': build_info}
+    context = {'builds': build_info, 'logs': logs }
 
     return render(request, template, context)