[bitbake-devel] [PATCH 01/17] toastergui: project page - consistent error display

Alex DAMIAN alexandru.damian at intel.com
Thu Mar 12 10:46:34 UTC 2015


From: Alexandru DAMIAN <alexandru.damian at intel.com>

We modify the project page to provide a consistent view of the
build errors. The display is now similar with the
managed_mrb_section and links point to the buildrequest
detail view.

[YOCTO #7188]

Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
 lib/toaster/toastergui/templates/project.html | 50 +++++++++++++++------------
 lib/toaster/toastergui/views.py               |  5 ++-
 2 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/lib/toaster/toastergui/templates/project.html b/lib/toaster/toastergui/templates/project.html
index 54590ee..039601f 100644
--- a/lib/toaster/toastergui/templates/project.html
+++ b/lib/toaster/toastergui/templates/project.html
@@ -130,29 +130,35 @@ vim: expandtab tabstop=2
         <switch ng-switch="b.status">
 
           <case ng-switch-when="failed">
-            <div class="lead span3"> <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span></div>
-            <div >
-                <button class="btn pull-right btn-danger" ng-click="buildExistingTarget(b.targets)">Run again</button>
+            <div class="lead span3">
+              <a ng-class="{'succeeded': 'success', 'failed': 'error'}[b.status]" href="{[b.br_page_url]}">
+                <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span>
+              </a>
             </div>
-            <div class="row-fluid">
-              <div class="air well" ng-repeat="e in b.errors">
-                    <pre>{[e.msg]}</pre>
-                  <ngif ng-if="e.msg.indexOf('Nothin') == 0">
-                    <div ng-repeat="t in getTargetNameFromErrorMsg(e.msg)">
-                     <p class="lead">The target <strong>{[t]}</strong> is not provided by any of your project layers.</p>
-                     <p> Your build has failed because the target <strong>{[t]}</strong> is not provided by any of your project layers.</p>
-                     <ngif ng-if="layersForTargets[t].length > 0">
-                       <p>The following layers provide this target. You could add one of them to your project.</p>
-                       <button class="btn btn-danger add-layer-with-dependencies" ng-repeat="l in layersForTargets[t]" ng-click="layerAddById(l.id)">Add {[l.name]}</button>
-                     </ngif>
-                    </div>
-                  </ngif>
-                  <ngif ng-if="e.msg.indexOf('Nothin') != 0">
-                    <p>
-                    Please contact your system administrator to help troubleshoot this error.
-                    </p>
-                  </ngif>
-              </div>
+            <div class="span2 lead">
+              <ngif ng-if="b.updated - todaydate > 0">
+                 {[b.updated|date:'HH:mm']}
+              </ngif>
+              <ngif ng-if="b.updated - todaydate < 0">
+                 {[b.updated|date:'dd/MM/yy HH:mm']}
+              </ngif>
+            </div>
+            <div class="span2">
+              <ngif ng-if="b.errors.length">
+                <span>
+                  <i class="icon-minus-sign red lead"></i>
+                  <a href="{[b.br_page_url]}#errors" class="lead error">{[b.errors.length]}
+                  <ng-pluralize count="b.errors.length" when="{'1':'error','other':'errors'}"></ng-pluralize></a>
+                </span>
+              </ngif>
+            </div>
+            <div class="span2">
+              <!-- we don't have warnings in this case -->
+            </div>
+            <div> <span class="lead">Build time: {[b.command_time|timediff]}</span>
+                <button class="btn pull-right" ng-class="{'succeeded':  'btn-success', 'failed': 'btn-danger'}[b.status]"
+                    ng-click="buildExistingTarget(b.targets)">Run again</button>
+
             </div>
           </case>
 
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 8034cfc..1e9df3f 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -66,7 +66,10 @@ def _project_recent_build_list(prj):
             "id":  x.pk,
             "targets" : map(lambda y: {"target": y.target, "task": y.task }, x.brtarget_set.all()),
             "status": x.get_state_display(),
-            "errors": map(lambda y: {"type": y.errtype, "msg": y.errmsg, "tb": y.traceback}, x.brerror_set.exclude(errmsg__contains="Command Failed")),
+            "errors": map(lambda y: {"type": y.errtype, "msg": y.errmsg, "tb": y.traceback}, x.brerror_set.all()),
+            "updated": x.updated.strftime('%s')+"000",
+            "command_time": (x.updated - x.created).total_seconds(),
+            "br_page_url": reverse('buildrequestdetails', args=(x.project.id, x.pk) ),
             "build" : map( lambda y: {"id": y.pk,
                         "status": y.get_outcome_display(),
                         "completed_on" : y.completed_on.strftime('%s')+"000",
-- 
1.9.1



More information about the bitbake-devel mailing list