summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFarrell Wymore <farrell.wymore@windriver.com>2014-04-02 12:10:55 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-05 14:55:29 +0100
commit396e2153a99c7ec742ec5432d471e8b0d88c0a3f (patch)
tree09dc21163410b68d76843c5d8a73d3ab6b274867
parent10297261219d4373843b31e8aaaed094fcbcf605 (diff)
downloadpoky-396e2153a99c7ec742ec5432d471e8b0d88c0a3f.tar.gz
bitbake: toaster: added covered task list
if a task has a 'covered' indication, the list of tasks that covered the task are computed and displayed. amended to add tooltip. [YOCTO #5925] (Bitbake rev: bb05ee13f53f10988579b6238802327732041d0c) Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/toastergui/templates/task.html11
-rw-r--r--bitbake/lib/toaster/toastergui/views.py64
2 files changed, 52 insertions, 23 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/task.html b/bitbake/lib/toaster/toastergui/templates/task.html
index c1504b6041..66a6695ec1 100644
--- a/bitbake/lib/toaster/toastergui/templates/task.html
+++ b/bitbake/lib/toaster/toastergui/templates/task.html
@@ -109,7 +109,16 @@
109 </dt> 109 </dt>
110 <dd> 110 <dd>
111 <ul> 111 <ul>
112 <li><p class="alert-info">TODO:Covering tasks will be displayed here</p></li> 112 {% for t in covered_by %}
113 <li>
114 <a href="{%url 'task' t.build.pk t.pk%}"
115 class="task-info"
116 title="{{t.get_executed_display}} | {{t.get_outcome_display}}">
117 {{t.recipe.name}}_{{t.recipe.version}}
118 {{t.task_name}}
119 </a>
120 </li>
121 {% endfor %}
113 </ul> 122 </ul>
114 </dd> 123 </dd>
115 </dl> 124 </dl>
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 2da81c1ede..910b3b9532 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -448,38 +448,58 @@ def builddashboard( request, build_id ):
448 return render( request, template, context ) 448 return render( request, template, context )
449 449
450 450
451def task(request, build_id, task_id): 451def generateCoveredList( task ):
452 template = "task.html" 452 revList = _find_task_revdep( task );
453 if Task.objects.filter(pk=task_id).count() == 0 : 453 list = { };
454 return redirect(builds) 454 for t in revList:
455 task = Task.objects.filter(pk=task_id)[0] 455 if ( t.outcome == Task.OUTCOME_COVERED ):
456 456 list.update( generateCoveredList( t ));
457 dependencies = sorted(_find_task_dep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name)) 457 else:
458 reverse_dependencies = sorted(_find_task_revdep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name)) 458 list[ t.task_name ] = t;
459 return( list );
459 460
461def task( request, build_id, task_id ):
462 template = "task.html"
463 tasks = Task.objects.filter( pk=task_id )
464 if tasks.count( ) == 0:
465 return redirect( builds )
466 task = tasks[ 0 ];
467 dependencies = sorted(
468 _find_task_dep( task ),
469 key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name))
470 reverse_dependencies = sorted(
471 _find_task_revdep( task ),
472 key=lambda t:'%s_%s %s'%( t.recipe.name, t.recipe.version, t.task_name ))
473 coveredBy = '';
474 if ( task.outcome == Task.OUTCOME_COVERED ):
475 dict = generateCoveredList( task )
476 coveredBy = [ ]
477 for name, t in dict.items( ):
478 coveredBy.append( t )
460 log_head = '' 479 log_head = ''
461 log_body = '' 480 log_body = ''
462 if task.outcome == task.OUTCOME_FAILED: 481 if task.outcome == task.OUTCOME_FAILED:
463 pass 482 pass
464# FIXME: the log should be read from the orm_logmessage table.
465# This will be fixed when the backend is done.
466 483
467 context = { 484 context = {
468 'build' : Build.objects.filter(pk=build_id)[0], 485 'build' : Build.objects.filter( pk = build_id )[ 0 ],
469 'object': task, 486 'object' : task,
470 'task':task, 487 'task' : task,
471 'deps': dependencies, 488 'covered_by' : coveredBy,
472 'rdeps': reverse_dependencies, 489 'deps' : dependencies,
473 'log_head':log_head, 490 'rdeps' : reverse_dependencies,
474 'log_body':log_body, 491 'log_head' : log_head,
475 'showing_matches':False, 492 'log_body' : log_body,
493 'showing_matches' : False,
476 } 494 }
495 if request.GET.get( 'show_matches', "" ):
496 context[ 'showing_matches' ] = True
497 context[ 'matching_tasks' ] = Task.objects.filter(
498 sstate_checksum=task.sstate_checksum ).filter(
499 build__completed_on__lt=task.build.completed_on ).order_by('-build__completed_on')
477 500
478 if request.GET.get('show_matches', ""): 501 return render( request, template, context )
479 context['showing_matches'] = True
480 context['matching_tasks'] = Task.objects.filter(sstate_checksum=task.sstate_checksum).filter(build__completed_on__lt=task.build.completed_on).order_by('-build__completed_on')
481 502
482 return render(request, template, context)
483 503
484def recipe(request, build_id, recipe_id): 504def recipe(request, build_id, recipe_id):
485 template = "recipe.html" 505 template = "recipe.html"