diff options
author | Farrell Wymore <farrell.wymore@windriver.com> | 2014-04-02 12:10:55 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-05 14:55:29 +0100 |
commit | 396e2153a99c7ec742ec5432d471e8b0d88c0a3f (patch) | |
tree | 09dc21163410b68d76843c5d8a73d3ab6b274867 | |
parent | 10297261219d4373843b31e8aaaed094fcbcf605 (diff) | |
download | ast2050-yocto-poky-396e2153a99c7ec742ec5432d471e8b0d88c0a3f.zip ast2050-yocto-poky-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.html | 11 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 64 |
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 c1504b6..66a6695 100644 --- a/bitbake/lib/toaster/toastergui/templates/task.html +++ b/bitbake/lib/toaster/toastergui/templates/task.html @@ -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> diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 2da81c1..910b3b9 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -448,38 +448,58 @@ def builddashboard( request, build_id ): return render( request, template, context ) -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)) +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" + 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" |