toaster patchset
cover toaster patchset
From: Alexandru DAMIAN <[email protected]>
This patchset consists on data collection improvement patches, and UI interface improvements.
Can you please pull in these changes ?
The following changes since commit fe8baaa2f533db7a1b7203476c675588923d8d45:
runqueue: Improve sigchld handler (2014-03-12 05:55:59 -0700)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib adamian/submission-12032014
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=submission-12032014
Amit Kumar Chaudhary (1):
toaster: add errors and warnings listing
Cristiana Voicu (2):
toaster: populate target image file table
toaster: add license manifest path to database
Ravi Chintakunta (1):
toaster: Add counters to filters
lib/bb/ui/buildinfohelper.py | 27 +++++++ lib/bb/ui/toasterui.py | 10 ++- lib/toaster/bldviewer/api.py | 1 + lib/toaster/bldviewer/views.py | 3 +- lib/toaster/toastergui/static/js/main.js | 20 ++++++ .../toastergui/templates/builddashboard.html | 56 ++++++++++++++- .../toastergui/templates/filtersnippet.html | 17 +++-- lib/toaster/toastergui/views.py | 84 ++++++++++++---------- 8 files changed, 171 insertions(+), 47 deletions(-)
Signature · 1 line
1.8.3.2
PATCH 1/4 toaster: populate target image file table
From: Cristiana Voicu <[email protected]>
Using ImageFileSize Metadata event, the image output file and its size are populated into target_image_file table.
[YOCTO #5189] [YOCTO #5228]
--- lib/bb/ui/buildinfohelper.py | 13 +++++++++++++ lib/bb/ui/toasterui.py | 2 ++ lib/toaster/bldviewer/api.py | 1 + lib/toaster/bldviewer/views.py | 3 ++- 4 files changed, 18 insertions(+), 1 deletion(-)
lib/bb/ui/buildinfohelper.py +13 -0
@@ -26,6 +26,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toaster.toastermain.settings") import toaster.toastermain.settings as toaster_django_settings from toaster.orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage +from toaster.orm.models import Target_Image_File from toaster.orm.models import Variable, VariableHistory from toaster.orm.models import Package, Package_File, Target_Installed_Package, Target_File from toaster.orm.models import Task_Dependency, Package_Dependency
@@ -344,6 +345,11 @@ class ORMWrapper(object): if (len(errormsg) > 0): raise Exception(errormsg) + def save_target_image_file_information(self, target_obj, file_name, file_size): + target_image_file = Target_Image_File.objects.create( target = target_obj, + file_name = file_name, + file_size = file_size) + target_image_file.save() def create_logmessage(self, log_information): assert 'build' in log_information
@@ -598,6 +604,13 @@ class BuildInfoHelper(object): # Save build configuration self.orm_wrapper.save_build_variables(build_obj, self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0]) + def update_target_image_file(self, event): + for t in self.internal_state['targets']: + if t.is_image == True: + output_files = list(event.data.viewkeys()) + for output in output_files: + if t.target in output: + self.orm_wrapper.save_target_image_file_information(t, output, event.data[output]) def update_build_information(self, event, errors, warnings, taskfailures): if 'build' in self.internal_state:
lib/bb/ui/toasterui.py +2 -0
@@ -241,6 +241,8 @@ def main(server, eventHandler, params ): buildinfohelper.store_tasks_stats(event) if event.type == "ImagePkgList": buildinfohelper.store_target_package_data(event) + elif event.type == "ImageFileSize": + buildinfohelper.update_target_image_file(event) continue # ignore
lib/toaster/bldviewer/api.py +1 -0
@@ -25,6 +25,7 @@ from django.conf.urls import patterns, include, url urlpatterns = patterns('bldviewer.views', url(r'^builds$', 'model_explorer', {'model_name':'build'}, name='builds'), url(r'^targets$', 'model_explorer', {'model_name':'target'}, name='targets'), + url(r'^target_image_file$', 'model_explorer', {'model_name':'target_image_file'}, name='target_image_file'), url(r'^tasks$', 'model_explorer', {'model_name':'task'}, name='task'), url(r'^task_dependencies$', 'model_explorer', {'model_name':'task_dependency'}, name='task_dependencies'), url(r'^packages$', 'model_explorer', {'model_name':'package'}, name='package'),
lib/toaster/bldviewer/views.py +2 -1
@@ -25,7 +25,7 @@ from django.db.models import Q from django.shortcuts import render from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable, Target_Installed_Package from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency -from orm.models import Target_Installed_Package, VariableHistory +from orm.models import Target_Installed_Package, VariableHistory, Target_Image_File from django.views.decorators.cache import cache_control from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
@@ -159,6 +159,7 @@ def model_explorer(request, model_name): model_mapping = { 'build': Build, 'target': Target, + 'target_image_file': Target_Image_File, 'task': Task, 'task_dependency': Task_Dependency, 'package': Package,
Signature · 1 line
1.8.3.2
PATCH 2/4 toaster: add license manifest path to database
From: Cristiana Voicu <[email protected]>
Based on image_name, the target is obtained, and the path is added to the database.
[YOCTO #5649]
--- lib/bb/ui/buildinfohelper.py | 14 ++++++++++++++ lib/bb/ui/toasterui.py | 8 +++++--- 2 files changed, 19 insertions(+), 3 deletions(-)
lib/bb/ui/buildinfohelper.py +14 -0
@@ -93,6 +93,10 @@ class ORMWrapper(object): build.outcome = outcome build.save() + def update_target_object(self, target, license_manifest_path): + + target.license_manifest_path = license_manifest_path + target.save() def get_update_task_object(self, task_information, must_exist = False): assert 'build' in task_information
@@ -616,6 +620,16 @@ class BuildInfoHelper(object): if 'build' in self.internal_state: self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures) + + def store_license_manifest_path(self, event): + deploy_dir = event.data['deploy_dir_image'] + image_name = event.data['image_name'] + path = deploy_dir + "/licenses/" + image_name + "/" + for target in self.internal_state['targets']: + if target.target in image_name: + self.orm_wrapper.update_target_object(target, path) + + def store_started_task(self, event): assert isinstance(event, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped)) assert 'taskfile' in vars(event)
lib/bb/ui/toasterui.py +5 -3
@@ -235,14 +235,16 @@ def main(server, eventHandler, params ): if isinstance(event, bb.event.MetadataEvent): if event.type == "SinglePackageInfo": buildinfohelper.store_build_package_information(event) - if event.type == "LayerInfo": + elif event.type == "LayerInfo": buildinfohelper.store_layer_info(event) - if event.type == "BuildStatsList": + elif event.type == "BuildStatsList": buildinfohelper.store_tasks_stats(event) - if event.type == "ImagePkgList": + elif event.type == "ImagePkgList": buildinfohelper.store_target_package_data(event) elif event.type == "ImageFileSize": buildinfohelper.update_target_image_file(event) + elif event.type == "LicenseManifestPath": + buildinfohelper.store_license_manifest_path(event) continue # ignore
Signature · 1 line
1.8.3.2
PATCH 3/4 toaster: Add counters to filters
In reply to Alex DAMIANFrom: Ravi Chintakunta <[email protected]>
Added count to filters in Build, Tasks and Config variables.
[YOCTO #5821]
--- .../toastergui/templates/filtersnippet.html | 17 +++-- lib/toaster/toastergui/views.py | 81 ++++++++++++---------- 2 files changed, 58 insertions(+), 40 deletions(-)
lib/toaster/toastergui/templates/filtersnippet.html +13 -4
@@ -4,16 +4,25 @@ <input type="hidden" name="search" value="{{request.GET.search}}"/> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> - <h3>Filter {%if filter_search_display%}{{filter_search_display|title}}{%else%}{{objectname|title}}{%endif%} by '{{tc.name}}'</h3> + {% if search_term %} + <h3>Filter {{total_count}} {%if filter_search_display%}{{filter_search_display|title}}{%else%}{{objectname|title}}{%endif%} matching '{{search_term}}' by '{{tc.name}}'</h3> + {% else %} + <h3>Filter {%if filter_search_display%}{{filter_search_display|title}}{%else%}{{objectname|title}}{%endif%} by '{{tc.name}}'</h3> + {% endif %} </div> <div class="modal-body"> <p>{{f.label}}</p> <label class="radio"> - <input type="radio" name="filter" {%if request.GET.filter%}{{f.options|check_filter_status:request.GET.filter}} {%else%} checked {%endif%} value=""> All {%if filter_search_display%}{{filter_search_display|title}}{%else%}{{objectname|title}}{%endif%} + <input type="radio" name="filter" {%if request.GET.filter%}{{f.options|check_filter_status:request.GET.filter}} {%else%} checked {%endif%} value=""> All {%if filter_search_display%}{{filter_search_display|title}}{%else%}{{objectname|title}}{%endif%} ({{total_count}}) </label> {% for option in f.options %} - <label class="radio"> - <input type="radio" name="filter" {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}"> {{option.0}} + {% if option.2 %} + <label class="radio"> + <input type="radio" name="filter" {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}"> {{option.0}} ({{option.2}}) + {% else %} + <label class="radio muted"> + <input type="radio" name="filter" disabled {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}"> {{option.0}} ({{option.2}}) + {% endif %} </label> {% endfor %} </div>
lib/toaster/toastergui/views.py +45 -36
183 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 4/4 toaster: add errors and warnings listing
In reply to Alex DAMIANFrom: Amit Kumar Chaudhary <[email protected]>
Add the errors and warnings listing to the build
dashboard page.
--- lib/toaster/toastergui/static/js/main.js | 20 ++++++++ .../toastergui/templates/builddashboard.html | 56 +++++++++++++++++++++- lib/toaster/toastergui/views.py | 3 +- 3 files changed, 76 insertions(+), 3 deletions(-)
lib/toaster/toastergui/static/js/main.js +20 -0
@@ -91,3 +91,23 @@ $(document).ready(function() { }); }); + +$(document).ready(function() { + //toggle the errors and warnings sections + $('.show-errors').click(function() { + $('#collapse-errors').addClass('in'); + }); + $('.toggle-errors').click(function() { + $('#collapse-errors').toggleClass('in'); + }); + $('.show-warnings').click(function() { + $('#collapse-warnings').addClass('in'); + }); + $('.toggle-warnings').click(function() { + $('#collapse-warnings').toggleClass('in'); + }); + //show warnings section when requested from the previous page + if (location.href.search('#warnings') > -1) { + $('#collapse-warnings').addClass('in'); + } +});
lib/toaster/toastergui/templates/builddashboard.html +54 -2
74 lines not on this page · raw message
lib/toaster/toastergui/views.py +2 -1
@@ -356,7 +356,8 @@ def builddashboard(request, build_id): return redirect(builds) context = { 'build' : Build.objects.filter(pk=build_id)[0], - 'recipecount' : Recipe.objects.filter(layer_version__id__in=Layer_Version.objects.filter(build=build_id)).count() + 'recipecount' : Recipe.objects.filter(layer_version__id__in=Layer_Version.objects.filter(build=build_id)).count(), + 'logmessages' : LogMessage.objects.filter(build=build_id), } return render(request, template, context)
Signature · 1 line
1.8.3.2