Toaster fixes patchset
PATCH 1/12 toastergui: fix spacing and input field sizes
In reply to Alex DAMIANFrom: Belen Barros Pena <[email protected]>
The revision label was missing the projec-form class (which controls the spacing in the form), and the revision text field was a bit too long, so changed it from span4 to span3.
--- lib/toaster/toastergui/templates/importlayer.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/toaster/toastergui/templates/importlayer.html +2 -2
@@ -75,11 +75,11 @@ <input type="text" id="layer-subdir"> <div class="control-group" id="layer-revision-ctrl"> - <label class="control-label" for="layer-git-ref">Revision + <label class="control-label project-form" for="layer-git-ref">Revision <span class="icon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span> </label> <div class="controls"> - <input type="text" class="span4" id="layer-git-ref" required> + <input type="text" class="span3" id="layer-git-ref" required> <span class="help-inline" style="diaply:none;" id="invalid-layer-revision-hint"></span> </div> </div>
Signature · 1 line
1.9.1
PATCH 3/12 toaster: layerdetails Add link to machines file
From: Michael Wood <[email protected]>
In the machines table for a layer add a link/icon to the machine definition file.
[YOCTO #7241]
--- lib/toaster/toastergui/templates/layerdetails.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
lib/toaster/toastergui/templates/layerdetails.html +6 -1
@@ -396,7 +396,12 @@ <tbody> {% for machine in machines %} <tr> - <td>{{machine.name}}</td> + <td> + {{machine.name}} + {% if machine.get_vcs_machine_file_link_url %} + <a href="{{machine.get_vcs_machine_file_link_url}}" target="_blank"><i class="icon-share get-info"></i></a> + {% endif %} + </td> <td>{{machine.description}}</td> <td><button class="btn btn-block select-machine-btn" data-machine-name="{{machine.name}}" {% if layer_in_project == 0 %}disabled="disabled"{% endif %}}>Select machine</button></td> </tr>
Signature · 1 line
1.9.1
PATCH 4/12 toaster: layerdetails Fix pagination controls
In reply to Alex DAMIANFrom: Michael Wood <[email protected]>
Bring the pagination controls into line with others in toaster by limiting the number of page buttons to 5
[YOCTO #7195]
--- lib/toaster/toastergui/templates/layerdetails.html | 4 ++-- lib/toaster/toastergui/views.py | 20 ++------------------ 2 files changed, 4 insertions(+), 20 deletions(-)
lib/toaster/toastergui/templates/layerdetails.html +2 -2
@@ -287,7 +287,7 @@ {%else%} <li class="disabled"><a href="#">«</a></li> {%endif%} - {% for i in targets.paginator.page_range %} + {% for i in targets.page_range %} <li {%if i == targets.number %} class="active" {%endif%}><a href="?tpage={{i}}#targets">{{i}}</a></li> {% endfor %} {%if targets.has_next%}
@@ -418,7 +418,7 @@ {%else%} <li class="disabled"><a href="#">«</a></li> {%endif%} - {% for i in machines.paginator.page_range %} + {% for i in machines.page_range %} <li {%if i == machines.number %} class="active" {%endif%}><a href="?mpage={{i}}#machines">{{i}}</a></li> {% endfor %} {%if machines.has_next%}
lib/toaster/toastergui/views.py +2 -18
@@ -2630,15 +2630,7 @@ if toastermain.settings.MANAGED: Q(name__icontains=request.GET['targets_search']) | Q(summary__icontains=request.GET['targets_search'])) - targets = Paginator(targets_query.order_by("name"), limit) - - if request.GET.has_key("tpage"): - try: - targets = targets.page(request.GET['tpage']) - except EmptyPage: - targets = targets.page(targets.num_pages) - else: - targets = targets.page(1) + targets = _build_page_range(Paginator(targets_query.order_by("name"), limit), request.GET.get('tpage', 1)) machines_query = Machine.objects.filter(layer_version=layer_version)
@@ -2648,15 +2640,7 @@ if toastermain.settings.MANAGED: Q(name__icontains=request.GET['machines_search']) | Q(description__icontains=request.GET['machines_search'])) - machines = Paginator(machines_query.order_by("name"), limit) - - if request.GET.has_key("mpage"): - try: - machines = machines.page(request.GET['mpage']) - except EmptyPage: - machines = machines.page(machines.num_pages) - else: - machines = machines.page(1) + machines = _build_page_range(Paginator(machines_query.order_by("name"), limit), request.GET.get('mpage', 1)) context = { 'layerversion': layer_version,
Signature · 1 line
1.9.1
PATCH 2/12 toaster: layerdetails summary/descriptions to be searchable
In reply to Alex DAMIANFrom: Michael Wood <[email protected]>
Allow the descriptions of the machine summary and layer description to be searchable in their respective tables.
[YOCTO #7199]
--- lib/toaster/toastergui/templates/layerdetails.html | 2 +- lib/toaster/toastergui/views.py | 42 +++++++++++++--------- 2 files changed, 26 insertions(+), 18 deletions(-)
lib/toaster/toastergui/templates/layerdetails.html +1 -1
@@ -257,7 +257,7 @@ <i class="icon-question-sign get-help" title="The recipe version and revision"></i> Target version </th> - <th class="span4">Description</th> + <th class="span4">Summary</th> <th class="span2">Build target</th> </tr> </thead>
lib/toaster/toastergui/views.py +25 -17
65 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH 5/12 toasterui: style the Toaster version information
In reply to Alex DAMIANFrom: Belen Barros Pena <[email protected]>
When debugging is turned on, we show some Toaster version information in the top bar. Present it so that it can be easily copied and pasted.
--- lib/toaster/toastergui/static/css/default.css | 3 ++- lib/toaster/toastergui/static/js/libtoaster.js | 3 +++ lib/toaster/toastergui/templates/base.html | 2 +- lib/toaster/toastergui/views.py | 7 ++++--- lib/toaster/toastermain/settings.py | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-)
lib/toaster/toastergui/static/css/default.css +2 -1
@@ -5,7 +5,8 @@ /* style the version information */ .brand > a { color: #777; } .brand > a:hover { color: #999; text-decoration: none; } -.icon-info-sign.get-help { color: #777; font-size: 16px; margin-left: 5px;} +.icon-info-sign { color: #777; font-size: 16px; margin-left: 5px;} +.icon-info-sign:hover { color: #999; cursor: pointer; } /* Style the breadcrumb */ .breadcrumb { display: inline-block; background-color: transparent; }
lib/toaster/toastergui/static/js/libtoaster.js +3 -0
@@ -317,6 +317,9 @@ $(document).ready(function() { // initialise the tooltips for the download icons $(".icon-download-alt").tooltip({ container: 'body', html: true, delay: { show: 200 } }); + // initialise popover for debug information + $(".icon-info-sign").popover( { placement: 'bottom', html: true, container: 'body' }); + // linking directly to tabs $(function(){ var hash = window.location.hash;
lib/toaster/toastergui/templates/base.html +1 -1
@@ -61,7 +61,7 @@ <span class="brand"> <a href="/">Toaster</a> {% if DEBUG %} - <i class="icon-info-sign get-help heading-help" data-placement="bottom" title="Version: {{TOASTER_VERSION}} <br /> Mode: {%if MANAGED%}build{%else%}analysis{%endif%}"></i> + <i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd><dt>Mode</dt><dd>{%if MANAGED%}Build{%else%}Analysis{%endif%}</dd></dl>"></i> {% endif %} </span> <a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/documentation/toaster-manual">
lib/toaster/toastergui/views.py +4 -3
@@ -1731,7 +1731,8 @@ if toastermain.settings.MANAGED: "projects": Project.objects.all(), "MANAGED" : toastermain.settings.MANAGED, "DEBUG" : toastermain.settings.DEBUG, - "TOASTER_VERSION": toastermain.settings.TOASTER_VERSION, + "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH, + "TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION, } if 'project_id' in request.session: try:
@@ -3104,8 +3105,8 @@ else: "projects": [], "MANAGED" : toastermain.settings.MANAGED, "DEBUG" : toastermain.settings.DEBUG, - "TOASTER_VERSION": toastermain.settings.TOASTER_VERSION, - + "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH, + "TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION, }
lib/toaster/toastermain/settings.py +2 -2
@@ -232,8 +232,8 @@ from os.path import dirname as DN SITE_ROOT=DN(DN(os.path.abspath(__file__))) import subprocess -TOASTER_VERSION = subprocess.Popen('git branch | grep "^* " | tr -d "* "', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0] -TOASTER_VERSION += " " + subprocess.Popen('git rev-parse HEAD ', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0] +TOASTER_BRANCH = subprocess.Popen('git branch | grep "^* " | tr -d "* "', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0] +TOASTER_REVISION = subprocess.Popen('git rev-parse HEAD ', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0] ROOT_URLCONF = 'toastermain.urls'
Signature · 1 line
1.9.1
PATCH 6/12 toaster: Add machine selection notification
In reply to Alex DAMIANFrom: Michael Wood <[email protected]>
This adds a notification to the project page to notify users of the change in project configuration.
--- lib/toaster/toastergui/static/css/default.css | 6 ++++++ lib/toaster/toastergui/static/js/layerdetails.js | 2 +- lib/toaster/toastergui/static/js/machines.js | 3 +-- lib/toaster/toastergui/static/js/projectapp.js | 9 +++++++++ 4 files changed, 17 insertions(+), 3 deletions(-)
lib/toaster/toastergui/static/css/default.css +6 -0
@@ -237,4 +237,10 @@ div.add-deps { margin-top: 15px; } .animate-repeat.ng-enter.ng-enter-active { opacity:1; } + +@keyframes machines-fade { 0% { background-color: #D9EDF7; } 25% { background-color: #D9EDF7; } 100% { background-color: white; } } +@-webkit-keyframes machines-fade { 0% { background-color: #D9EDF7; } 25% { background-color: #D9EDF7; } 100% { background-color: white; } } + +.machines-highlight { -webkit-animation: machines-fade 7s 1; -moz-animation: machines-fade 7s 1; animation: machines-fade 7s 1; } + .tab-pane table { margin-top: 10px; }
lib/toaster/toastergui/static/js/layerdetails.js +1 -1
@@ -133,7 +133,7 @@ function layerDetailsPageInit (ctx) { var data = { machineName : $(this).data('machine-name') }; libtoaster.editProject(ctx.xhrEditProjectUrl, ctx.projectId, data, function (){ - window.location.replace(ctx.projectPageUrl); + window.location.replace(ctx.projectPageUrl+"#/machineselected"); }, null); });
lib/toaster/toastergui/static/js/machines.js +1 -2
@@ -77,7 +77,6 @@ function machinesPageInit (ctx) { show_layer_deps_modal(ctx.projectId, layer, data.list, null, null, true, function () { /* Success add deps and layer */ setLayerInCurrentPrj(btn, data.list); - console.log ("TODO SUCCESS"); }); } }, null);
@@ -87,7 +86,7 @@ function machinesPageInit (ctx) { var data = { machineName : $(this).data('machine-name') }; libtoaster.editProject(ctx.xhrEditProjectUrl, ctx.projectId, data, function (){ - window.location.replace(ctx.projectPageUrl); + window.location.replace(ctx.projectPageUrl+"#/machineselected"); }, null); });
lib/toaster/toastergui/static/js/projectapp.js +9 -0
@@ -665,6 +665,15 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc "\">select targets</a> you want to build.", "alert-success"); }); + _cmdExecuteWithParam("/machineselected", function () { + $scope.displayAlert($scope.zone2alerts, "You have changed the machine to: <strong>" + $scope.machine.name + "</strong>", "alert-info"); + var machineDistro = angular.element("#machine-distro"); + + angular.element("html, body").animate({ scrollTop: machineDistro.position().top }, 700).promise().done(function() { + $animate.addClass(machineDistro, "machines-highlight"); + }); + }); + _cmdExecuteWithParam("/layerimported", function (layer) { var imported = $cookieStore.get("layer-imported-alert"); var text;
Signature · 1 line
1.9.1
PATCH 7/12 toasterui: improving the latest builds consistency
In reply to Alex DAMIANFrom: Belen Barros Pena <[email protected]>
We have 2 pages where we have a 'latest builds' section:
the 'all builds / all projects' page and the 'project' page. Unfortunately, we are currently using different code base in both, which means that some inconsistencies between the two in behaviour and presentation have sneaked in.
This patch addresses some of such inconsistencies.
--- lib/toaster/toastergui/static/css/default.css | 1 + .../toastergui/templates/managed_mrb_section.html | 27 +++++++++++++--------- lib/toaster/toastergui/templates/project.html | 10 ++++---- 3 files changed, 22 insertions(+), 16 deletions(-)
lib/toaster/toastergui/static/css/default.css +1 -0
@@ -145,6 +145,7 @@ select { width: auto; } /* styles for showing the project name in build mode */ .project-name { padding-top: 0; } .project-name .label { font-weight: normal; margin-bottom: 5px; margin-left: -15px; padding: 5px; } +.project-name .label > a { color: #fff; font-weight: normal; } /* Remove bottom margin for forms inside modal dialogs */ #dependencies_modal_form { margin-bottom: 0px; }
lib/toaster/toastergui/templates/managed_mrb_section.html +16 -11
@@ -15,7 +15,9 @@ <div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%} {% if MANAGED and build.project %}project-name{% endif %} "> {% if MANAGED and build.project %} - <span class="label {%if build.outcome == build.SUCCEEDED%}label-success{%elif build.outcome == build.FAILED%}label-danger{%else%}label-info{%endif%}"> {{build.project.name}} </span> + <span class="label {%if build.outcome == build.SUCCEEDED%}label-success{%elif build.outcome == build.FAILED%}label-important{%else%}label-info{%endif%}"> + <a href="{% url 'project' build.project.id %}"> {{build.project.name}} </a> + </span> {% endif %} <div class="row-fluid">
@@ -29,6 +31,7 @@ </a> {% endif %} </div> + {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} <div class="span2 lead"> {% if build.completed_on|format_build_date %} {{ build.completed_on|date:'d/m/y H:i' }}
@@ -36,7 +39,6 @@ {{ build.completed_on|date:'H:i' }} {% endif %} </div> - {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %} <div class="span2 lead"> {% if build.errors_no %} <i class="icon-minus-sign red"></i> <a href="{%url 'builddashboard' build.pk%}#errors" class="error">{{build.errors_no}} error{{build.errors_no|pluralize}}</a>
@@ -52,12 +54,13 @@ Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent|sectohms }}</a> </span> {% if build.project %} - <button class="btn {%if build.outcome == build.SUCCEEDED%}btn-success{%elif build.outcome == build.FAILED%}btn-danger{%else%}btn-info{%endif%} pull-right" onclick='scheduleBuild({% url 'xhr_projectbuild' build.project.id as bpi%}{{bpi|json}}, {{build.project.name|json}}, {{build.get_sorted_target_list|mapselect:'target'|json}})'>Run again</button> + <button class="btn {%if build.outcome == build.SUCCEEDED%}btn-success{%elif build.outcome == build.FAILED%}btn-danger{%else%}btn-info{%endif%} pull-right" onclick='scheduleBuild({% url 'xhr_projectbuild' build.project.id as bpi%}{{bpi|json}}, {{build.project.name|json}}, +{% url 'project' buildrequest.project.id as bpurl%}{{bpurl|json}}, {{build.get_sorted_target_list|mapselect:'target'|json}})'>Run again</button> {% endif %} </div> {%endif%} {%if build.outcome == build.IN_PROGRESS %} - <div class="span4"> + <div class="span4 offset1"> <div class="progress" style="margin-top:5px;" data-toggle="tooltip" title="{{build.completeper}}% of tasks complete"> <div style="width: {{build.completeper}}%;" class="bar"></div> </div>
@@ -73,7 +76,9 @@ <div class="alert {% if buildrequest.state == buildrequest.REQ_FAILED %}alert-error{% else %}alert-info{% endif %} project-name"> - <span class="label label-danger"> {{buildrequest.project.name}} </span> + <span class="label {% if buildrequest.state == buildrequest.REQ_FAILED %}label-important{% else%}label-info{% endif %}"> + <a href="{% url 'project' buildrequest.project.id %}"> {{buildrequest.project.name}} </a> + </span> <div class="row-fluid"> {% if buildrequest.state == buildrequest.REQ_FAILED %}
@@ -100,7 +105,7 @@ <span class="lead{%if not MANAGED or not buildrequest.project%} pull-right{%endif%}"> Build time: {{ buildrequest.get_duration|sectohms }} </span> - <button class="btn btn-danger pull-right" onclick='scheduleBuild({% url 'xhr_projectbuild' buildrequest.project.id as bpi%}{{bpi|json}}, {{buildrequest.project.name|json}}, {{buildrequest.get_sorted_target_list|mapselect:'target'|json}})'>Run again</button> + <button class="btn btn-danger pull-right" onclick='scheduleBuild({% url 'xhr_projectbuild' buildrequest.project.id as bpi%}{{bpi|json}}, {{buildrequest.project.name|json}}, {% url 'project' buildrequest.project.id as bpurl%}|{{bpurl|json}}, {{buildrequest.get_sorted_target_list|mapselect:'target'|json}})'>Run again</button> </div>
@@ -111,7 +116,7 @@ <span data-toggle="tooltip" {%if buildrequest.brtarget_set.all.count > 1%}title="Targets: {%for target in buildrequest.brtarget_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{buildrequest.brtarget_set.all.0.target}} {%if buildrequest.brtarget_set.all.count > 1%}(+ {{buildrequest.brtarget_set.all.count|add:"-1"}}){%endif%} </span> </div> - <div class="span4 lead" >Build queued + <div class="span4 lead">Build queued <i title="This build will start as soon as a build server is available" class="icon-question-sign get-help get-help-blue heading-help" data-toggle="tooltip"></i> </div>
@@ -172,13 +177,13 @@ function _makeXHRBuildCall(url, data, onsuccess, onfail) { } -function scheduleBuild(url, projectName, buildlist) { +function scheduleBuild(url, projectName, projectUrl, buildlist) { console.log("scheduleBuild"); _makeXHRBuildCall(url, {targets: buildlist.join(" ")}, function (_data) { - $('#latest-builds').prepend('<div class="alert alert-info" style="padding-top:0px">' + '<span class="label label-info" style="font-weight: normal; margin-bottom: 5px; margin-left:-15px; padding-top:5px;">'+projectName+'</span><div class="row-fluid">' + - '<div class="span4 lead">' + buildlist.join(" ") + - '</div><div class="span4 lead pull-right">Build queued. Your build will start shortly.</div></div></div>'); + $('#latest-builds').prepend("<div class=\"alert alert-info project-name\"><span class=\"label label-info\"><a href=\""+projectUrl+"\">"+projectName+"</a></span><div class=\"row-fluid\">" + + "<div class=\"span5 lead\">" + buildlist.join(" ") + + "</div><div class=\"span4 lead\">Build queued <i title=\"This build will start as soon as a build server is available\" class=\"icon-question-sign get-help get-help-blue heading-help\"></i></div></div></div>"); }); }
lib/toaster/toastergui/templates/project.html +5 -5
@@ -165,17 +165,17 @@ vim: expandtab tabstop=2 </case> <case ng-switch-when="created"> - <div class="lead span3"> <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span> </div> - <div class="span6" > + <div class="lead span5"> <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span> </div> + <div class="span4"> <span class="lead">Creating build</span> </div> <button class="btn pull-right btn-info" ng-click="buildCancel(b)">Cancel</button> </case> <case ng-switch-when="deleted"> - <div class="lead span3"> <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span> </div> - <div class="span6" id="{[b.id]}-deleted" > - <span class="lead">Build deleted</span> + <div class="lead span5"> <span ng-repeat="t in b.targets" ng-include src="'target_display'"></span> </div> + <div class="span4" id="{[b.id]}-deleted" > + <span class="lead">Build cancelled</span> </div> <button class="btn pull-right btn-info" ng-click="buildDelete(b)">Close</button> </case>
Signature · 1 line
1.9.1
PATCH 8/12 toaster: update requirement for Django 1.6
In reply to Alex DAMIANFrom: Alexandru Damian <[email protected]>
In order to bring in transaction.set_commit support, we need Django 1.6, discarding support for Django 1.5
This patch removes 1.5 from the list of acceptable Django versions.
--- bin/toaster | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
bin/toaster +2 -2
@@ -129,8 +129,8 @@ function notify_chldexit() { function verify_prereq() { # Verify prerequisites - if ! echo "import django; print (1,) == django.VERSION[0:1] and django.VERSION[1:2][0] in (5,6)" | python 2>/dev/null | grep True >/dev/null; then - echo -e "This program needs Django 1.5 or 1.6. Please install with\n\npip install django==1.6\n" + if ! echo "import django; print (1,) == django.VERSION[0:1] and django.VERSION[1:2][0] in (6,)" | python 2>/dev/null | grep True >/dev/null; then + echo -e "This program needs Django 1.6. Please install with\n\npip install django==1.6\n" return 2 fi
Signature · 1 line
1.9.1
PATCH 10/12 toastergui: performance improvements in task details page
In reply to Alex DAMIANFrom: Alexandru Damian <[email protected]>
This patch brings better forward and reverse dependency computing in tasks page (offloading python code to the database), as well as replacing the recursive depth-first covered-by tree search with breadth-first search.
--- lib/toaster/orm/models.py | 2 ++ lib/toaster/toastergui/views.py | 40 +++++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 19 deletions(-)
lib/toaster/orm/models.py +2 -0
@@ -393,6 +393,8 @@ class Task(models.Model): outcome_text = property(get_outcome_text) sstate_text = property(get_sstate_text) + def __unicode__(self): + return "%d %s:%s" % (self.id, self.recipe.name, self.task_name) class Meta: ordering = ('order', 'recipe' ,) unique_together = ('build', 'recipe', 'task_name', )
lib/toaster/toastergui/views.py +21 -19
@@ -352,15 +352,17 @@ def builddashboard( request, build_id ): return render( request, template, context ) -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 generateCoveredList2( revlist = [] ): + covered_list = [ x for x in revlist if x.outcome == Task.OUTCOME_COVERED ] + while len(covered_list): + revlist = [ x for x in revlist if x.outcome != Task.OUTCOME_COVERED ] + + newlist = _find_task_revdep_list(covered_list) + + revlist = list(set(revlist + newlist)) + covered_list = [ x for x in revlist if x.outcome == Task.OUTCOME_COVERED ] + return revlist def task( request, build_id, task_id ): template = "task.html"
@@ -376,9 +378,10 @@ def task( request, build_id, task_id ): 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 ) +# _list = generateCoveredList( task ) + _list = generateCoveredList2( _find_task_revdep( task ) ) coveredBy = [ ] - for name, t in dict.items( ): + for t in _list: coveredBy.append( t ) log_head = '' log_body = ''
@@ -737,18 +740,17 @@ def dirinfo(request, build_id, target_id, file_path=None): return render(request, template, context) def _find_task_dep(task): - tp = [] - for p in Task_Dependency.objects.filter(task=task): - if (p.depends_on.order > 0) and (p.depends_on.outcome != Task.OUTCOME_NA): - tp.append(p.depends_on); - return tp + return map(lambda x: x.depends_on, Task_Dependency.objects.filter(task=task).filter(depends_on__order__gt = 0).exclude(depends_on__outcome = Task.OUTCOME_NA).select_related("depends_on")) def _find_task_revdep(task): tp = [] - for p in Task_Dependency.objects.filter(depends_on=task): - if (p.task.order > 0) and (p.task.outcome != Task.OUTCOME_NA): - tp.append(p.task); + tp = map(lambda t: t.task, Task_Dependency.objects.filter(depends_on=task).filter(task__order__gt=0).exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")) + return tp + +def _find_task_revdep_list(tasklist): + tp = [] + tp = map(lambda t: t.task, Task_Dependency.objects.filter(depends_on__in=tasklist).filter(task__order__gt=0).exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")) return tp def _find_task_provider(task):
Signature · 1 line
1.9.1
PATCH 9/12 toasterui: disable autocommit for build logging
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
This patch disables autocommit for inserting build data, effectively updating all build data in a single transaction.
This is a purely performance improvement patch, as the transaction will always be commited.
Similar manual transaction handling in the layer source update method. Added feedback messages during update method.
[YOCTO #7140]
--- lib/bb/ui/buildinfohelper.py | 11 +++++++++++ lib/toaster/orm/models.py | 18 +++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-)
lib/bb/ui/buildinfohelper.py +11 -0
@@ -35,6 +35,7 @@ from bb.msg import BBLogFormatter as format from django.db import models import logging +from django.db import transaction logger = logging.getLogger("BitBake")
@@ -606,7 +607,9 @@ class BuildInfoHelper(object): self.internal_state = {} self.internal_state['taskdata'] = {} self.task_order = 0 + self.autocommit_step = 1 self.server = server + transaction.set_autocommit(False) self.orm_wrapper = ORMWrapper() self.has_build_history = has_build_history self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
@@ -926,6 +929,12 @@ class BuildInfoHelper(object): task_information['outcome'] = Task.OUTCOME_FAILED del self.internal_state['taskdata'][identifier] + # we force a sync point here, to get the progress bar to show + if self.autocommit_step % 3 == 0: + transaction.set_autocommit(True) + transaction.set_autocommit(False) + self.autocommit_step += 1 + self.orm_wrapper.get_update_task_object(task_information, True) # must exist
@@ -1197,3 +1206,5 @@ class BuildInfoHelper(object): # we have no build, and we still have events; something amazingly wrong happend for event in self.internal_state['backlog']: logger.error("UNSAVED log: %s", event.msg) + + transaction.set_autocommit(True)
lib/toaster/orm/models.py +17 -1
@@ -664,6 +664,7 @@ class LayerIndexLayerSource(LayerSource): """ assert self.apiurl is not None from django.db import IntegrityError + from django.db import transaction import httplib, urlparse, json import os
@@ -715,6 +716,7 @@ class LayerIndexLayerSource(LayerSource): # update branches; only those that we already have names listed in the Releases table whitelist_branch_names = map(lambda x: x.branch_name, Release.objects.all()) + print "Fetching branches" branches_info = _get_json_response(apilinks['branches'] + "?filter=name:%s" % "OR".join(whitelist_branch_names)) for bi in branches_info:
@@ -727,6 +729,7 @@ class LayerIndexLayerSource(LayerSource): # update layers layers_info = _get_json_response(apilinks['layerItems']) + transaction.set_autocommit(False) for li in layers_info: l, created = Layer.objects.get_or_create(layer_source = self, name = li['name']) l.up_id = li['id']
@@ -738,11 +741,15 @@ class LayerIndexLayerSource(LayerSource): l.summary = li['summary'] l.description = li['description'] l.save() + transaction.set_autocommit(True) # update layerbranches/layer_versions + print "Fetching layer information" layerbranches_info = _get_json_response(apilinks['layerBranches'] + "?filter=branch:%s" % "OR".join(map(lambda x: str(x.up_id), [i for i in Branch.objects.filter(layer_source = self) if i.up_id is not None] )) ) + + transaction.set_autocommit(False) for lbi in layerbranches_info: lv, created = Layer_Version.objects.get_or_create(layer_source = self, up_id = lbi['id'],
@@ -755,10 +762,12 @@ class LayerIndexLayerSource(LayerSource): lv.commit = lbi['actual_branch'] lv.dirpath = lbi['vcs_subdir'] lv.save() + transaction.set_autocommit(True) # update layer dependencies layerdependencies_info = _get_json_response(apilinks['layerDependencies']) dependlist = {} + transaction.set_autocommit(False) for ldi in layerdependencies_info: try: lv = Layer_Version.objects.get(layer_source = self, up_id = ldi['layerbranch'])
@@ -777,23 +786,29 @@ class LayerIndexLayerSource(LayerSource): LayerVersionDependency.objects.filter(layer_version = lv).delete() for lvd in dependlist[lv]: LayerVersionDependency.objects.get_or_create(layer_version = lv, depends_on = lvd) + transaction.set_autocommit(True) # update machines + print "Fetching machine information" machines_info = _get_json_response(apilinks['machines'] + "?filter=layerbranch:%s" % "OR".join(map(lambda x: str(x.up_id), Layer_Version.objects.filter(layer_source = self))) ) + transaction.set_autocommit(False) for mi in machines_info: mo, created = Machine.objects.get_or_create(layer_source = self, up_id = mi['id'], layer_version = Layer_Version.objects.get(layer_source = self, up_id = mi['layerbranch'])) mo.up_date = mi['updated'] mo.name = mi['name'] mo.description = mi['description'] mo.save() + transaction.set_autocommit(True) # update recipes; paginate by layer version / layer branch + print "Fetching target information" recipes_info = _get_json_response(apilinks['recipes'] + "?filter=layerbranch:%s" % "OR".join(map(lambda x: str(x.up_id), Layer_Version.objects.filter(layer_source = self))) ) + transaction.set_autocommit(False) for ri in recipes_info: try: ro, created = Recipe.objects.get_or_create(layer_source = self, up_id = ri['id'], layer_version = Layer_Version.objects.get(layer_source = self, up_id = ri['layerbranch']))
@@ -809,8 +824,9 @@ class LayerIndexLayerSource(LayerSource): ro.file_path = ri['filepath'] + "/" + ri['filename'] ro.save() except: - print "Duplicate Recipe, ignoring: ", vars(ro) + #print "Duplicate Recipe, ignoring: ", vars(ro) pass + transaction.set_autocommit(True) pass class BitbakeVersion(models.Model):
Signature · 1 line
1.9.1
PATCH 12/12 toasterui: fix ETA calculation
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
This patch fixes the ETA calculation.
[YOCTO 7349]
--- lib/toaster/orm/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/toaster/orm/models.py +1 -1
@@ -194,7 +194,7 @@ class Build(models.Model): eta = timezone.now() completeper = self.completeper() if self.completeper() > 0: - eta += ((eta - self.started_on)*100)/completeper + eta += ((eta - self.started_on)*(100-completeper))/completeper return eta
Signature · 1 line
1.9.1
cover Toaster fixes patchset
From: Alexandru DAMIAN <[email protected]>
Hello,
This is a patchset with fixes for the Toaster graphical user interface.
The patches have been reviewed and tested on the toaster mailinglist.
Can you please pull at your convenience ?
Cheers,
Alex
The following changes since commit 4b8fcf9a5bc802793bf332334217faace55f14f6:
bitbake-layers: add ability to fetch layers and their dependencies from layer index (2015-02-20 18:00:34 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib adamian/20150224-submission-bb
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=adamian/20150224-submission-bb
Alexandru DAMIAN (2):
toasterui: disable autocommit for build logging
toasterui: fix ETA calculation
Alexandru Damian (2):
toaster: update requirement for Django 1.6
toastergui: performance improvements in task details page
Belen Barros Pena (4):
toastergui: fix spacing and input field sizes
toasterui: style the Toaster version information
toasterui: improving the latest builds consistency
toaster: fix typo in models.py
Michael Wood (4):
toaster: layerdetails summary/descriptions to be searchable
toaster: layerdetails Add link to machines file
toaster: layerdetails Fix pagination controls
toaster: Add machine selection notification
bin/toaster | 4 +- lib/bb/ui/buildinfohelper.py | 11 +++ lib/toaster/orm/models.py | 24 +++++- lib/toaster/toastergui/static/css/default.css | 10 ++- lib/toaster/toastergui/static/js/layerdetails.js | 2 +- lib/toaster/toastergui/static/js/libtoaster.js | 3 + lib/toaster/toastergui/static/js/machines.js | 3 +- lib/toaster/toastergui/static/js/projectapp.js | 9 +++ lib/toaster/toastergui/templates/base.html | 2 +- lib/toaster/toastergui/templates/importlayer.html | 4 +- lib/toaster/toastergui/templates/layerdetails.html | 13 +++- .../toastergui/templates/managed_mrb_section.html | 27 ++++--- lib/toaster/toastergui/templates/project.html | 10 +-- lib/toaster/toastergui/views.py | 85 ++++++++++------------ lib/toaster/toastermain/settings.py | 4 +- 15 files changed, 132 insertions(+), 79 deletions(-)
Signature · 1 line
1.9.1
PATCH 11/12 toaster: fix typo in models.py
In reply to Alex DAMIANFrom: Belen Barros Pena <[email protected]>
The typo caused the tasks table to break when a task has no help text.
--- lib/toaster/orm/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/toaster/orm/models.py +1 -1
@@ -366,7 +366,7 @@ class Task(models.Model): return self._helptext try: self._helptext = HelpText.objects.get(key=self.task_name, area=HelpText.VARIABLE, build=self.build).text - except HelpText.DoesNotExit: + except HelpText.DoesNotExist: self._helptext = None return self._helptext
Signature · 1 line
1.9.1