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>
This commit is contained in:
Farrell Wymore
2014-04-02 12:10:55 -07:00
committed by Richard Purdie
parent 1029726121
commit 396e2153a9
2 changed files with 52 additions and 23 deletions

View File

@@ -109,7 +109,16 @@
</dt>
<dd>
<ul>
<li><p class="alert-info">TODO:Covering tasks will be displayed here</p></li>
{% for t in covered_by %}
<li>
<a href="{%url 'task' t.build.pk t.pk%}"
class="task-info"
title="{{t.get_executed_display}} | {{t.get_outcome_display}}">
{{t.recipe.name}}_{{t.recipe.version}}
{{t.task_name}}
</a>
</li>
{% endfor %}
</ul>
</dd>
</dl>

View File

@@ -448,38 +448,58 @@ def builddashboard( request, build_id ):
return render( request, template, context )
def task(request, build_id, task_id):
def generateCoveredList( task ):
revList = _find_task_revdep( task );
list = { };
for t in revList:
if ( t.outcome == Task.OUTCOME_COVERED ):
list.update( generateCoveredList( t ));
else:
list[ t.task_name ] = t;
return( list );
def task( request, build_id, task_id ):
template = "task.html"
if Task.objects.filter(pk=task_id).count() == 0 :
return redirect(builds)
task = Task.objects.filter(pk=task_id)[0]
dependencies = sorted(_find_task_dep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name))
reverse_dependencies = sorted(_find_task_revdep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name))
tasks = Task.objects.filter( pk=task_id )
if tasks.count( ) == 0:
return redirect( builds )
task = tasks[ 0 ];
dependencies = sorted(
_find_task_dep( task ),
key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name))
reverse_dependencies = sorted(
_find_task_revdep( task ),
key=lambda t:'%s_%s %s'%( t.recipe.name, t.recipe.version, t.task_name ))
coveredBy = '';
if ( task.outcome == Task.OUTCOME_COVERED ):
dict = generateCoveredList( task )
coveredBy = [ ]
for name, t in dict.items( ):
coveredBy.append( t )
log_head = ''
log_body = ''
if task.outcome == task.OUTCOME_FAILED:
pass
# FIXME: the log should be read from the orm_logmessage table.
# This will be fixed when the backend is done.
context = {
'build' : Build.objects.filter(pk=build_id)[0],
'object': task,
'task':task,
'deps': dependencies,
'rdeps': reverse_dependencies,
'log_head':log_head,
'log_body':log_body,
'showing_matches':False,
'build' : Build.objects.filter( pk = build_id )[ 0 ],
'object' : task,
'task' : task,
'covered_by' : coveredBy,
'deps' : dependencies,
'rdeps' : reverse_dependencies,
'log_head' : log_head,
'log_body' : log_body,
'showing_matches' : False,
}
if request.GET.get( 'show_matches', "" ):
context[ 'showing_matches' ] = True
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')
if request.GET.get('show_matches', ""):
context['showing_matches'] = True
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')
return render( request, template, context )
return render(request, template, context)
def recipe(request, build_id, recipe_id):
template = "recipe.html"