* [PATCH 1/2] toaster: adjust build dashboard for failed builds
2016-03-17 11:40 [PATCH 0/2] " Elliot Smith
@ 2016-03-17 11:40 ` Elliot Smith
0 siblings, 0 replies; 5+ messages in thread
From: Elliot Smith @ 2016-03-17 11:40 UTC (permalink / raw)
To: toaster
Remove the side bar and build details modules for failed builds.
Modify templates so that the span is moved out of the individual
elements and into the container. This makes it simpler to change
the width of the main container, depending on whether the
build failed or not (which in turn hides or shows the left-hand
menu).
[YOCTO #8443]
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
bitbake/lib/toaster/orm/models.py | 15 ++
.../toastergui/templates/basebuildpage.html | 148 +++++++++---------
.../toastergui/templates/builddashboard.html | 174 +++++++++++----------
bitbake/lib/toaster/toastergui/views.py | 1 +
4 files changed, 177 insertions(+), 161 deletions(-)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 3c98c0b..1d69c24 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -516,6 +516,21 @@ class Build(models.Model):
return target_labels
+ def started(self):
+ """
+ As build variables are only added for a build when its BuildStarted event
+ is received, a build with no build variables is counted as
+ "in preparation" and not properly started yet. This method
+ will return False if a build has no build variables (it never properly
+ started), or True otherwise.
+
+ Note that this is a temporary workaround for the fact that we don't
+ have a fine-grained state variable on a build which would allow us
+ to record "in progress" (BuildStarted received) vs. "in preparation".
+ """
+ variables = Variable.objects.filter(build=self)
+ return len(variables) > 0
+
def get_current_status(self):
"""
get the status string from the build request if the build
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
index ff9433e..7762210 100644
--- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
+++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
@@ -2,89 +2,81 @@
{% load projecttags %}
{% load project_url_tag %}
{% load humanize %}
-{% block pagecontent %}
+{% block pagecontent %}
+ <!-- Breadcrumbs -->
+ <div class="section">
+ <ul class="breadcrumb" id="breadcrumb">
+ <li><a href="{% project_url build.project %}">{{build.project.name}}</a></li>
+ {% if not build.project.is_default %}
+ <li><a href="{% url 'projectbuilds' build.project.id %}">Builds</a></li>
+ {% endif %}
+ <li>
+ {% block parentbreadcrumb %}
+ <a href="{%url 'builddashboard' build.pk%}">
+ {{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+{{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})
+ </a>
+ {% endblock %}
+ </li>
+ {% block localbreadcrumb %}{% endblock %}
+ </ul>
+ <script>
+ $( function () {
+ $('#breadcrumb > li').append('<span class="divider">→</span>');
+ $('#breadcrumb > li:last').addClass("active");
+ $('#breadcrumb > li:last > span').remove();
+ });
+ </script>
+ </div>
- <div class="">
-<!-- Breadcrumbs -->
- <div class="section">
- <ul class="breadcrumb" id="breadcrumb">
- <li><a href="{% project_url build.project %}">{{build.project.name}}</a></li>
- {% if not build.project.is_default %}
- <li><a href="{% url 'projectbuilds' build.project.id %}">Builds</a></li>
- {% endif %}
- <li>
- {% block parentbreadcrumb %}
- <a href="{%url 'builddashboard' build.pk%}">
- {{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+{{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})
- </a>
+ <div class="row-fluid">
+ {% if build.started %}
+ <!-- begin left sidebar container for builds which properly started -->
+ <div id="nav" class="span2">
+ <ul class="nav nav-list well">
+ <li {% if request.resolver_match.url_name == 'builddashboard' %}class="active"{% endif %}>
+ <a class="nav-parent" href="{% url 'builddashboard' build.pk %}">Build summary</a>
+ </li>
+ {% if build.target_set.all.0.is_image and build.outcome == 0 %}
+ <li class="nav-header">Images</li>
+ {% block nav-target %}
+ {% for t in build.get_sorted_target_list %}
+ <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+ {% endfor %}
{% endblock %}
- </li>
- {% block localbreadcrumb %}{% endblock %}
+ {% endif %}
+ <li class="nav-header">Build</li>
+ {% block nav-configuration %}
+ <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+ {% endblock %}
+ {% block nav-tasks %}
+ <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+ {% endblock %}
+ {% block nav-recipes %}
+ <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+ {% endblock %}
+ {% block nav-packages %}
+ <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
+ {% endblock %}
+ <li class="nav-header">Performance</li>
+ {% block nav-buildtime %}
+ <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+ {% endblock %}
+ {% block nav-cputime %}
+ <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li>
+ {% endblock %}
+ {% block nav-diskio %}
+ <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+ {% endblock %}
</ul>
- <script>
- $( function () {
- $('#breadcrumb > li').append('<span class="divider">→</span>');
- $('#breadcrumb > li:last').addClass("active");
- $('#breadcrumb > li:last > span').remove();
- });
- </script>
- </div>
-
- <div class="row-fluid">
-
- <!-- begin left sidebar container -->
- <div id="nav" class="span2">
- <ul class="nav nav-list well">
- <li
- {% if request.resolver_match.url_name == 'builddashboard' %}
- class="active"
- {% endif %} >
- <a class="nav-parent" href="{% url 'builddashboard' build.pk %}">Build summary</a>
- </li>
- {% if build.target_set.all.0.is_image and build.outcome == 0 %}
- <li class="nav-header">Images</li>
- {% block nav-target %}
- {% for t in build.get_sorted_target_list %}
- <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
- {% endfor %}
- {% endblock %}
- {% endif %}
- <li class="nav-header">Build</li>
- {% block nav-configuration %}
- <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
- {% endblock %}
- {% block nav-tasks %}
- <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
- {% endblock %}
- {% block nav-recipes %}
- <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
- {% endblock %}
- {% block nav-packages %}
- <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
- {% endblock %}
- <li class="nav-header">Performance</li>
- {% block nav-buildtime %}
- <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
- {% endblock %}
- {% block nav-cputime %}
- <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li>
- {% endblock %}
- {% block nav-diskio %}
- <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
- {% endblock %}
- </ul>
- </div>
- <!-- end left sidebar container -->
-
- <!-- Begin right container -->
- {% block buildinfomain %}{% endblock %}
- <!-- End right container -->
-
+ </div>
+ <!-- end left sidebar container -->
+ {% endif %}
+ <!-- Begin right container; we need span10 if we are showing the left side-bar -->
+ <div class="{% if build.started %}span10{% else %}row-fluid{% endif %}">
+ {% block buildinfomain %}{% endblock %}
</div>
+ <!-- End right container -->
</div>
-
-
{% endblock %}
-
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
index a0da71e..b0c3d99 100644
--- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html
+++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
@@ -13,14 +13,14 @@
{% block buildinfomain %}
<!-- page title -->
-<div class="row-fluid span10">
+<div class="row-fluid">
<div class="page-header">
<h1>{{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}}</h1>
</div>
</div>
<!-- build result bar -->
-<div class="row-fluid span10 pull-right">
+<div class="row-fluid pull-right">
<div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%}">
<div class="row-fluid lead">
<span class="pull-left"><strong>
@@ -53,7 +53,7 @@
</div>
{% if build.errors.count %}
-<div class="accordion span10 pull-right" id="errors">
+<div class="accordion pull-right row-fluid" id="errors">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle error toggle-errors">
@@ -65,13 +65,11 @@
</div>
<div class="accordion-body collapse in" id="collapse-errors">
<div class="accordion-inner">
- <div class="span10">
- {% for error in build.errors %}
- <div class="alert alert-error" data-error="{{ error.id }}">
- <pre>{{error.message}}</pre>
- </div>
- {% endfor %}
- </div>
+ {% for error in build.errors %}
+ <div class="alert alert-error" data-error="{{ error.id }}">
+ <pre>{{error.message}}</pre>
+ </div>
+ {% endfor %}
</div>
</div>
</div>
@@ -81,7 +79,7 @@
{%if build.outcome == build.SUCCEEDED%}
<!-- built images -->
{% if hasImages %}
-<div class="row-fluid span10 pull-right">
+<div class="row-fluid pull-right">
<h2>Images</h2>
{% for target in targets %}
{% if target.target.is_image %}
@@ -149,7 +147,7 @@
<!-- other artifacts -->
{% if build.buildartifact_set.all.count > 0 %}
-<div class="row-fluid span10 pull-right">
+<div class="row-fluid pull-right">
<h2>Other artifacts</h2>
<div class="well dashboard-section">
@@ -172,107 +170,117 @@
</div>
{% endif %}
-<!-- build summary -->
-<div class="row-fluid span10 pull-right">
-<h2>Build summary</h2>
+
+{% if build.outcome == Build.SUCCEEDED %}
+ <!-- build summary -->
+ <div class="row-fluid pull-right">
+ <h2>Build summary</h2>
<div class="well span4 dashboard-section" style="margin-left:0px;">
- <h4><a href="{%url 'configuration' build.pk%}">Configuration</a></h4>
- <dl>
+ <h4><a href="{%url 'configuration' build.pk%}">Configuration</a></h4>
+ <dl>
<dt>Machine</dt><dd>{{build.machine}}</dd>
<dt>Distro</dt><dd>{{build.distro}}</dd>
- <dt>Layers</dt>{% for i in build.layer_version_build.all|dictsort:"layer.name" %}<dd>{{i.layer.name}}</dd>{%endfor%}
- </dl>
+ <dt>Layers</dt>
+ {% for i in build.layer_version_build.all|dictsort:"layer.name" %}
+ <dd>{{i.layer.name}}</dd>
+ {% endfor %}
+ </dl>
</div>
<div class="well span4 dashboard-section">
- <h4><a href="{%url 'tasks' build.pk%}">Tasks</a></h4>
- <dl>
- {% query build.task_build outcome=4 order__gt=0 as exectask%}
- {% if exectask.count > 0 %}
- <dt>Failed tasks</dt>
- <dd>
- {% if exectask.count == 1 %}
- <a class="error" href="{% url "task" build.id exectask.0.id %}">
- {{exectask.0.recipe.name}}
- <span class="task-name">{{exectask.0.task_name}}</span>
- </a>
+ <h4><a href="{%url 'tasks' build.pk%}">Tasks</a></h4>
+ <dl>
+ {% query build.task_build outcome=4 order__gt=0 as exectask %}
+ {% if exectask.count > 0 %}
+ <dt>Failed tasks</dt>
+ <dd>
+ {% if exectask.count == 1 %}
+ <a class="error" href="{% url "task" build.id exectask.0.id %}">
+ {{exectask.0.recipe.name}}
+ <span class="task-name">{{exectask.0.task_name}}</span>
+ </a>
- <a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
- <i class="icon-download-alt" title="" data-original-title="Download task log file"></i>
- </a>
+ <a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
+ <i class="icon-download-alt" title="" data-original-title="Download task log file"></i>
+ </a>
- {% elif exectask.count > 1%}
- <a class="error" href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}}</a>
- {% endif %}
- </dd>
+ {% elif exectask.count > 1%}
+ <a class="error" href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}}</a>
{% endif %}
- <dt>Total number of tasks</dt><dd><a href="{% url 'tasks' build.pk %}">{% query build.task_build order__gt=0 as alltasks %}{{alltasks.count}}</a></dd>
+ </dd>
+ {% endif %}
+ <dt>Total number of tasks</dt>
+ <dd><a href="{% url 'tasks' build.pk %}">{% query build.task_build order__gt=0 as alltasks %}{{alltasks.count}}</a></dd>
<dt>
- Tasks executed
- <i class="icon-question-sign get-help" title="'Executed' tasks are those that need to be run in order to generate the task output"></i>
+ Tasks executed
+ <i class="icon-question-sign get-help" title="'Executed' tasks are those that need to be run in order to generate the task output"></i>
</dt>
<dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A1&count=25&search=&page=1&orderby=order%3A%2B">{% query build.task_build task_executed=1 order__gt=0 as exectask%}{{exectask.count}}</a></dd>
<dt>
- Tasks not executed
- <i class="icon-question-sign get-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></i>
+ Tasks not executed
+ <i class="icon-question-sign get-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></i>
</dt>
<dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A0&count=25&search=&page=1&orderby=order%3A%2B">{% query build.task_build task_executed=0 order__gt=0 as noexectask%}{{noexectask.count}}</a></dd>
<dt>
- Reuse
- <i class="icon-question-sign get-help" title="The percentage of 'not executed' tasks over the total number of tasks, which is a measure of the efficiency of your build"></i>
+ Reuse
+ <i class="icon-question-sign get-help" title="The percentage of 'not executed' tasks over the total number of tasks, which is a measure of the efficiency of your build"></i>
</dt>
<dd>
-{% query build.task_build order__gt=0 as texec %}
-{% if noexectask.count|multiply:100|divide:texec.count < 0 %}
-0
-{% else %}
-{{noexectask.count|multiply:100|divide:texec.count}}
-{% endif %}
-%
+ {% query build.task_build order__gt=0 as texec %}
+ {% if noexectask.count|multiply:100|divide:texec.count < 0 %}
+ 0
+ {% else %}
+ {{noexectask.count|multiply:100|divide:texec.count}}
+ {% endif %}
+ %
</dd>
- </dl>
+ </dl>
</div>
<div class="well span4 dashboard-section">
- <h4><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h4>
- <dl>
- <dt>Recipes built</dt><dd><a href="{% url 'recipes' build.pk %}">{{recipecount}}</a></dd>
- <dt>Packages built</dt><dd><a href="{% url 'packages' build.pk %}">{{packagecount}}</a></dd>
- </dl>
+ <h4><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h4>
+ <dl>
+ <dt>Recipes built</dt>
+ <dd><a href="{% url 'recipes' build.pk %}">{{recipecount}}</a></dd>
+ <dt>Packages built</dt>
+ <dd><a href="{% url 'packages' build.pk %}">{{packagecount}}</a></dd>
+ </dl>
</div>
-</div>
+ </div>
+ <!-- end build summary -->
+{% endif %}
{% if build.warnings.count %}
-<div class="accordion span10 pull-right" id="warnings">
- <div class="accordion-group">
- <div class="accordion-heading">
- <a class="accordion-toggle warning toggle-warnings">
- <h2 id="warning-toggle">
- <i class="icon-warning-sign"></i>
- {{build.warnings.count}} warning{{build.warnings.count|pluralize}}
- </h2>
- </a>
- </div>
- <div class="accordion-body collapse" id="collapse-warnings">
- <div class="accordion-inner">
- <div class="span10">
- {% for warning in logmessages %}{% if warning.level == 1 %}
- <div class="alert alert-warning">
- <pre>{{warning.message}}</pre>
- </div>
- {% endif %}{% endfor %}
+ <div class="accordion pull-right" id="warnings">
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle warning toggle-warnings">
+ <h2 id="warning-toggle">
+ <i class="icon-warning-sign"></i>
+ {{build.warnings.count}} warning{{build.warnings.count|pluralize}}
+ </h2>
+ </a>
+ </div>
+ <div class="accordion-body collapse" id="collapse-warnings">
+ <div class="accordion-inner">
+ <div class="span10">
+ {% for warning in logmessages %}{% if warning.level == 1 %}
+ <div class="alert alert-warning">
+ <pre>{{warning.message}}</pre>
+ </div>
+ {% endif %}{% endfor %}
+ </div>
</div>
</div>
</div>
</div>
-</div>
{% endif %}
<script type="text/javascript">
- $(document).ready(function() {
- //show warnings section when requested from the previous page
- if (location.href.search('#warnings') > -1) {
- $('#collapse-warnings').addClass('in');
- }
- });
+ $(document).ready(function() {
+ //show warnings section when requested from the previous page
+ if (location.href.search('#warnings') > -1) {
+ $('#collapse-warnings').addClass('in');
+ }
+ });
</script>
{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 85ca9be..f94fb1c 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -506,6 +506,7 @@ def builddashboard( request, build_id ):
context = {
'build' : build,
+ 'Build' : Build,
'hasImages' : hasImages,
'ntargets' : ntargets,
'targets' : targets,
--
Elliot Smith
Software Engineer
Intel OTC
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 0/2][v2] Show custom build dashboard for builds which fail early
@ 2016-03-21 19:53 Elliot Smith
2016-03-21 19:53 ` [PATCH 1/2] toaster: adjust build dashboard for failed builds Elliot Smith
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Elliot Smith @ 2016-03-21 19:53 UTC (permalink / raw)
To: toaster
v2:
Modifications for other templates which were missed in v1, as per Belen's
review.
v1:
Builds which fail early at the "build request stage" (i.e. before the BuildStarted
event happens) need a custom build dashboard, as they don't have any buildstats
data, images, recipes etc., so the links in the left-hand menu are irrelevant.
Hide the build dashboard's left-hand menu if a build failed early (before
BuildStarted). Also remove the build time links for the failed builds, as
time data is not available.
The state of the build as "started" or not is determined by looking for
build variables associated with a build. As these variables are only added
at the point when BuildStarted occurs, any Build object without these
variables hasn't triggered a BuildStarted event.
(This is something of a work-around; in future we may have more fine-grained
states on a build so that we can properly tell its state. When this happens, the
Build.started() method could be modified to properly reflect this.)
To test:
1. Start a build with a bad target, e.g. "zzz".
2. When the build fails, go to the dashboard for the build. The left-hand menu
should not be visible.
3. Go to the all builds page. The build time for the failed build should
not have a hyperlink on it.
4. Start a build with a bad MACHINE variable setting (either modify in project
configuration or in conf/toaster.conf).
5. Repeat steps 2 and 3 for the failed build.
6. Start a build with a bad DISTRO variable setting (either modify in project
configuration or in conf/toaster.conf).
7. Repeat steps 2 and 3 for the failed build.
8. Start a good build, e.g. "mpfr-native".
9. When the build completes (successfully), go to the dashboard. The left-hand
menu should be visible and functioning.
10. Go to the all builds page. Links on the build time should be present and
should point at the time page for the build.
Note that I have some Selenium tests for testing these changes, but they
depend on a previous patchset which is not yet in toaster-next; see
https://lists.yoctoproject.org/pipermail/toaster/2016-March/004164.html.
Changes since 358ba11b15f5182c4d667cf35565afc0c6ad4126 (toaster-next) are in
git://git.yoctoproject.org/poky-contrib, elliot/toaster/failed_builds_display-8443
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/failed_builds_display-8443
Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8443
Elliot Smith (2):
toaster: adjust build dashboard for failed builds
toaster: remove links from time field on failed builds
bitbake/lib/toaster/orm/models.py | 15 ++
bitbake/lib/toaster/toastergui/tables.py | 8 +-
.../toastergui/templates/basebuildpage.html | 148 ++++++++--------
.../lib/toaster/toastergui/templates/bpackage.html | 2 -
.../toastergui/templates/builddashboard.html | 186 ++++++++++---------
.../toastergui/templates/configuration.html | 4 +-
.../toaster/toastergui/templates/configvars.html | 4 +-
.../lib/toaster/toastergui/templates/dirinfo.html | 105 ++++++-----
.../toaster/toastergui/templates/mrb_section.html | 7 +-
.../lib/toaster/toastergui/templates/recipes.html | 2 -
.../lib/toaster/toastergui/templates/target.html | 6 +-
.../lib/toaster/toastergui/templates/tasks.html | 196 ++++++++++-----------
bitbake/lib/toaster/toastergui/views.py | 1 +
13 files changed, 354 insertions(+), 330 deletions(-)
--
Elliot Smith
Software Engineer
Intel OTC
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] toaster: adjust build dashboard for failed builds
2016-03-21 19:53 [PATCH 0/2][v2] Show custom build dashboard for builds which fail early Elliot Smith
@ 2016-03-21 19:53 ` Elliot Smith
2016-03-21 19:53 ` [PATCH 2/2] toaster: remove links from time field on " Elliot Smith
2016-03-23 14:39 ` [PATCH 0/2][v2] Show custom build dashboard for builds which fail early Barros Pena, Belen
2 siblings, 0 replies; 5+ messages in thread
From: Elliot Smith @ 2016-03-21 19:53 UTC (permalink / raw)
To: toaster
Remove the side bar and build details modules for failed builds.
Modify templates so that the span is moved out of the individual
elements and into the container. This makes it simpler to change
the width of the main container, depending on whether the
build failed or not (which in turn hides or shows the left-hand
menu).
[YOCTO #8443]
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
bitbake/lib/toaster/orm/models.py | 15 ++
.../toastergui/templates/basebuildpage.html | 148 ++++++++--------
.../lib/toaster/toastergui/templates/bpackage.html | 2 -
.../toastergui/templates/builddashboard.html | 174 +++++++++---------
.../toastergui/templates/configuration.html | 4 +-
.../toaster/toastergui/templates/configvars.html | 4 +-
.../lib/toaster/toastergui/templates/dirinfo.html | 105 ++++++-----
.../lib/toaster/toastergui/templates/recipes.html | 2 -
.../lib/toaster/toastergui/templates/target.html | 6 +-
.../lib/toaster/toastergui/templates/tasks.html | 196 ++++++++++-----------
bitbake/lib/toaster/toastergui/views.py | 1 +
11 files changed, 332 insertions(+), 325 deletions(-)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 3c98c0b..1d69c24 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -516,6 +516,21 @@ class Build(models.Model):
return target_labels
+ def started(self):
+ """
+ As build variables are only added for a build when its BuildStarted event
+ is received, a build with no build variables is counted as
+ "in preparation" and not properly started yet. This method
+ will return False if a build has no build variables (it never properly
+ started), or True otherwise.
+
+ Note that this is a temporary workaround for the fact that we don't
+ have a fine-grained state variable on a build which would allow us
+ to record "in progress" (BuildStarted received) vs. "in preparation".
+ """
+ variables = Variable.objects.filter(build=self)
+ return len(variables) > 0
+
def get_current_status(self):
"""
get the status string from the build request if the build
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
index ff9433e..7762210 100644
--- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
+++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
@@ -2,89 +2,81 @@
{% load projecttags %}
{% load project_url_tag %}
{% load humanize %}
-{% block pagecontent %}
+{% block pagecontent %}
+ <!-- Breadcrumbs -->
+ <div class="section">
+ <ul class="breadcrumb" id="breadcrumb">
+ <li><a href="{% project_url build.project %}">{{build.project.name}}</a></li>
+ {% if not build.project.is_default %}
+ <li><a href="{% url 'projectbuilds' build.project.id %}">Builds</a></li>
+ {% endif %}
+ <li>
+ {% block parentbreadcrumb %}
+ <a href="{%url 'builddashboard' build.pk%}">
+ {{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+{{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})
+ </a>
+ {% endblock %}
+ </li>
+ {% block localbreadcrumb %}{% endblock %}
+ </ul>
+ <script>
+ $( function () {
+ $('#breadcrumb > li').append('<span class="divider">→</span>');
+ $('#breadcrumb > li:last').addClass("active");
+ $('#breadcrumb > li:last > span').remove();
+ });
+ </script>
+ </div>
- <div class="">
-<!-- Breadcrumbs -->
- <div class="section">
- <ul class="breadcrumb" id="breadcrumb">
- <li><a href="{% project_url build.project %}">{{build.project.name}}</a></li>
- {% if not build.project.is_default %}
- <li><a href="{% url 'projectbuilds' build.project.id %}">Builds</a></li>
- {% endif %}
- <li>
- {% block parentbreadcrumb %}
- <a href="{%url 'builddashboard' build.pk%}">
- {{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+{{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})
- </a>
+ <div class="row-fluid">
+ {% if build.started %}
+ <!-- begin left sidebar container for builds which properly started -->
+ <div id="nav" class="span2">
+ <ul class="nav nav-list well">
+ <li {% if request.resolver_match.url_name == 'builddashboard' %}class="active"{% endif %}>
+ <a class="nav-parent" href="{% url 'builddashboard' build.pk %}">Build summary</a>
+ </li>
+ {% if build.target_set.all.0.is_image and build.outcome == 0 %}
+ <li class="nav-header">Images</li>
+ {% block nav-target %}
+ {% for t in build.get_sorted_target_list %}
+ <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+ {% endfor %}
{% endblock %}
- </li>
- {% block localbreadcrumb %}{% endblock %}
+ {% endif %}
+ <li class="nav-header">Build</li>
+ {% block nav-configuration %}
+ <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+ {% endblock %}
+ {% block nav-tasks %}
+ <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+ {% endblock %}
+ {% block nav-recipes %}
+ <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+ {% endblock %}
+ {% block nav-packages %}
+ <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
+ {% endblock %}
+ <li class="nav-header">Performance</li>
+ {% block nav-buildtime %}
+ <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+ {% endblock %}
+ {% block nav-cputime %}
+ <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li>
+ {% endblock %}
+ {% block nav-diskio %}
+ <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+ {% endblock %}
</ul>
- <script>
- $( function () {
- $('#breadcrumb > li').append('<span class="divider">→</span>');
- $('#breadcrumb > li:last').addClass("active");
- $('#breadcrumb > li:last > span').remove();
- });
- </script>
- </div>
-
- <div class="row-fluid">
-
- <!-- begin left sidebar container -->
- <div id="nav" class="span2">
- <ul class="nav nav-list well">
- <li
- {% if request.resolver_match.url_name == 'builddashboard' %}
- class="active"
- {% endif %} >
- <a class="nav-parent" href="{% url 'builddashboard' build.pk %}">Build summary</a>
- </li>
- {% if build.target_set.all.0.is_image and build.outcome == 0 %}
- <li class="nav-header">Images</li>
- {% block nav-target %}
- {% for t in build.get_sorted_target_list %}
- <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
- {% endfor %}
- {% endblock %}
- {% endif %}
- <li class="nav-header">Build</li>
- {% block nav-configuration %}
- <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
- {% endblock %}
- {% block nav-tasks %}
- <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
- {% endblock %}
- {% block nav-recipes %}
- <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
- {% endblock %}
- {% block nav-packages %}
- <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
- {% endblock %}
- <li class="nav-header">Performance</li>
- {% block nav-buildtime %}
- <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
- {% endblock %}
- {% block nav-cputime %}
- <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li>
- {% endblock %}
- {% block nav-diskio %}
- <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
- {% endblock %}
- </ul>
- </div>
- <!-- end left sidebar container -->
-
- <!-- Begin right container -->
- {% block buildinfomain %}{% endblock %}
- <!-- End right container -->
-
+ </div>
+ <!-- end left sidebar container -->
+ {% endif %}
+ <!-- Begin right container; we need span10 if we are showing the left side-bar -->
+ <div class="{% if build.started %}span10{% else %}row-fluid{% endif %}">
+ {% block buildinfomain %}{% endblock %}
</div>
+ <!-- End right container -->
</div>
-
-
{% endblock %}
-
diff --git a/bitbake/lib/toaster/toastergui/templates/bpackage.html b/bitbake/lib/toaster/toastergui/templates/bpackage.html
index 81973cb..88ba2fe 100644
--- a/bitbake/lib/toaster/toastergui/templates/bpackage.html
+++ b/bitbake/lib/toaster/toastergui/templates/bpackage.html
@@ -12,7 +12,6 @@
{% endblock %}
{% block buildinfomain %}
-<div class="span10">
{% if not request.GET.filter and not request.GET.search and not objects.paginator.count %}
@@ -104,5 +103,4 @@
{% include "basetable_bottom.html" %}
{% endif %} {# objects.paginator.count #}
{% endif %} {# Empty #}
-</div>
{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
index a0da71e..b0c3d99 100644
--- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html
+++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
@@ -13,14 +13,14 @@
{% block buildinfomain %}
<!-- page title -->
-<div class="row-fluid span10">
+<div class="row-fluid">
<div class="page-header">
<h1>{{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}}</h1>
</div>
</div>
<!-- build result bar -->
-<div class="row-fluid span10 pull-right">
+<div class="row-fluid pull-right">
<div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%}">
<div class="row-fluid lead">
<span class="pull-left"><strong>
@@ -53,7 +53,7 @@
</div>
{% if build.errors.count %}
-<div class="accordion span10 pull-right" id="errors">
+<div class="accordion pull-right row-fluid" id="errors">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle error toggle-errors">
@@ -65,13 +65,11 @@
</div>
<div class="accordion-body collapse in" id="collapse-errors">
<div class="accordion-inner">
- <div class="span10">
- {% for error in build.errors %}
- <div class="alert alert-error" data-error="{{ error.id }}">
- <pre>{{error.message}}</pre>
- </div>
- {% endfor %}
- </div>
+ {% for error in build.errors %}
+ <div class="alert alert-error" data-error="{{ error.id }}">
+ <pre>{{error.message}}</pre>
+ </div>
+ {% endfor %}
</div>
</div>
</div>
@@ -81,7 +79,7 @@
{%if build.outcome == build.SUCCEEDED%}
<!-- built images -->
{% if hasImages %}
-<div class="row-fluid span10 pull-right">
+<div class="row-fluid pull-right">
<h2>Images</h2>
{% for target in targets %}
{% if target.target.is_image %}
@@ -149,7 +147,7 @@
<!-- other artifacts -->
{% if build.buildartifact_set.all.count > 0 %}
-<div class="row-fluid span10 pull-right">
+<div class="row-fluid pull-right">
<h2>Other artifacts</h2>
<div class="well dashboard-section">
@@ -172,107 +170,117 @@
</div>
{% endif %}
-<!-- build summary -->
-<div class="row-fluid span10 pull-right">
-<h2>Build summary</h2>
+
+{% if build.outcome == Build.SUCCEEDED %}
+ <!-- build summary -->
+ <div class="row-fluid pull-right">
+ <h2>Build summary</h2>
<div class="well span4 dashboard-section" style="margin-left:0px;">
- <h4><a href="{%url 'configuration' build.pk%}">Configuration</a></h4>
- <dl>
+ <h4><a href="{%url 'configuration' build.pk%}">Configuration</a></h4>
+ <dl>
<dt>Machine</dt><dd>{{build.machine}}</dd>
<dt>Distro</dt><dd>{{build.distro}}</dd>
- <dt>Layers</dt>{% for i in build.layer_version_build.all|dictsort:"layer.name" %}<dd>{{i.layer.name}}</dd>{%endfor%}
- </dl>
+ <dt>Layers</dt>
+ {% for i in build.layer_version_build.all|dictsort:"layer.name" %}
+ <dd>{{i.layer.name}}</dd>
+ {% endfor %}
+ </dl>
</div>
<div class="well span4 dashboard-section">
- <h4><a href="{%url 'tasks' build.pk%}">Tasks</a></h4>
- <dl>
- {% query build.task_build outcome=4 order__gt=0 as exectask%}
- {% if exectask.count > 0 %}
- <dt>Failed tasks</dt>
- <dd>
- {% if exectask.count == 1 %}
- <a class="error" href="{% url "task" build.id exectask.0.id %}">
- {{exectask.0.recipe.name}}
- <span class="task-name">{{exectask.0.task_name}}</span>
- </a>
+ <h4><a href="{%url 'tasks' build.pk%}">Tasks</a></h4>
+ <dl>
+ {% query build.task_build outcome=4 order__gt=0 as exectask %}
+ {% if exectask.count > 0 %}
+ <dt>Failed tasks</dt>
+ <dd>
+ {% if exectask.count == 1 %}
+ <a class="error" href="{% url "task" build.id exectask.0.id %}">
+ {{exectask.0.recipe.name}}
+ <span class="task-name">{{exectask.0.task_name}}</span>
+ </a>
- <a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
- <i class="icon-download-alt" title="" data-original-title="Download task log file"></i>
- </a>
+ <a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
+ <i class="icon-download-alt" title="" data-original-title="Download task log file"></i>
+ </a>
- {% elif exectask.count > 1%}
- <a class="error" href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}}</a>
- {% endif %}
- </dd>
+ {% elif exectask.count > 1%}
+ <a class="error" href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}}</a>
{% endif %}
- <dt>Total number of tasks</dt><dd><a href="{% url 'tasks' build.pk %}">{% query build.task_build order__gt=0 as alltasks %}{{alltasks.count}}</a></dd>
+ </dd>
+ {% endif %}
+ <dt>Total number of tasks</dt>
+ <dd><a href="{% url 'tasks' build.pk %}">{% query build.task_build order__gt=0 as alltasks %}{{alltasks.count}}</a></dd>
<dt>
- Tasks executed
- <i class="icon-question-sign get-help" title="'Executed' tasks are those that need to be run in order to generate the task output"></i>
+ Tasks executed
+ <i class="icon-question-sign get-help" title="'Executed' tasks are those that need to be run in order to generate the task output"></i>
</dt>
<dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A1&count=25&search=&page=1&orderby=order%3A%2B">{% query build.task_build task_executed=1 order__gt=0 as exectask%}{{exectask.count}}</a></dd>
<dt>
- Tasks not executed
- <i class="icon-question-sign get-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></i>
+ Tasks not executed
+ <i class="icon-question-sign get-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></i>
</dt>
<dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A0&count=25&search=&page=1&orderby=order%3A%2B">{% query build.task_build task_executed=0 order__gt=0 as noexectask%}{{noexectask.count}}</a></dd>
<dt>
- Reuse
- <i class="icon-question-sign get-help" title="The percentage of 'not executed' tasks over the total number of tasks, which is a measure of the efficiency of your build"></i>
+ Reuse
+ <i class="icon-question-sign get-help" title="The percentage of 'not executed' tasks over the total number of tasks, which is a measure of the efficiency of your build"></i>
</dt>
<dd>
-{% query build.task_build order__gt=0 as texec %}
-{% if noexectask.count|multiply:100|divide:texec.count < 0 %}
-0
-{% else %}
-{{noexectask.count|multiply:100|divide:texec.count}}
-{% endif %}
-%
+ {% query build.task_build order__gt=0 as texec %}
+ {% if noexectask.count|multiply:100|divide:texec.count < 0 %}
+ 0
+ {% else %}
+ {{noexectask.count|multiply:100|divide:texec.count}}
+ {% endif %}
+ %
</dd>
- </dl>
+ </dl>
</div>
<div class="well span4 dashboard-section">
- <h4><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h4>
- <dl>
- <dt>Recipes built</dt><dd><a href="{% url 'recipes' build.pk %}">{{recipecount}}</a></dd>
- <dt>Packages built</dt><dd><a href="{% url 'packages' build.pk %}">{{packagecount}}</a></dd>
- </dl>
+ <h4><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h4>
+ <dl>
+ <dt>Recipes built</dt>
+ <dd><a href="{% url 'recipes' build.pk %}">{{recipecount}}</a></dd>
+ <dt>Packages built</dt>
+ <dd><a href="{% url 'packages' build.pk %}">{{packagecount}}</a></dd>
+ </dl>
</div>
-</div>
+ </div>
+ <!-- end build summary -->
+{% endif %}
{% if build.warnings.count %}
-<div class="accordion span10 pull-right" id="warnings">
- <div class="accordion-group">
- <div class="accordion-heading">
- <a class="accordion-toggle warning toggle-warnings">
- <h2 id="warning-toggle">
- <i class="icon-warning-sign"></i>
- {{build.warnings.count}} warning{{build.warnings.count|pluralize}}
- </h2>
- </a>
- </div>
- <div class="accordion-body collapse" id="collapse-warnings">
- <div class="accordion-inner">
- <div class="span10">
- {% for warning in logmessages %}{% if warning.level == 1 %}
- <div class="alert alert-warning">
- <pre>{{warning.message}}</pre>
- </div>
- {% endif %}{% endfor %}
+ <div class="accordion pull-right" id="warnings">
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle warning toggle-warnings">
+ <h2 id="warning-toggle">
+ <i class="icon-warning-sign"></i>
+ {{build.warnings.count}} warning{{build.warnings.count|pluralize}}
+ </h2>
+ </a>
+ </div>
+ <div class="accordion-body collapse" id="collapse-warnings">
+ <div class="accordion-inner">
+ <div class="span10">
+ {% for warning in logmessages %}{% if warning.level == 1 %}
+ <div class="alert alert-warning">
+ <pre>{{warning.message}}</pre>
+ </div>
+ {% endif %}{% endfor %}
+ </div>
</div>
</div>
</div>
</div>
-</div>
{% endif %}
<script type="text/javascript">
- $(document).ready(function() {
- //show warnings section when requested from the previous page
- if (location.href.search('#warnings') > -1) {
- $('#collapse-warnings').addClass('in');
- }
- });
+ $(document).ready(function() {
+ //show warnings section when requested from the previous page
+ if (location.href.search('#warnings') > -1) {
+ $('#collapse-warnings').addClass('in');
+ }
+ });
</script>
{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/templates/configuration.html b/bitbake/lib/toaster/toastergui/templates/configuration.html
index 85d6a62..2e5c00c 100644
--- a/bitbake/lib/toaster/toastergui/templates/configuration.html
+++ b/bitbake/lib/toaster/toastergui/templates/configuration.html
@@ -12,14 +12,14 @@
{% block buildinfomain %}
<!-- page title -->
-<div class="row-fluid span10">
+<div class="row-fluid">
<div class="page-header">
<h1>Configuration</h1>
</div>
</div>
<!-- configuration table -->
-<div class="row-fluid pull-right span10" id="navTab">
+<div class="row-fluid" id="navTab">
<ul class="nav nav-pills">
<li class="active"><a href="#">Summary</a></li>
<li class=""><a href="{% url 'configvars' build.id %}">BitBake variables</a></li>
diff --git a/bitbake/lib/toaster/toastergui/templates/configvars.html b/bitbake/lib/toaster/toastergui/templates/configvars.html
index e40c225..6348497 100644
--- a/bitbake/lib/toaster/toastergui/templates/configvars.html
+++ b/bitbake/lib/toaster/toastergui/templates/configvars.html
@@ -12,7 +12,7 @@
{% block buildinfomain %}
<!-- page title -->
-<div class="row-fluid span10">
+<div class="row-fluid">
<div class="page-header">
<h1>
{% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %}
@@ -27,7 +27,7 @@
</div>
<!-- configuration table -->
-<div class="row-fluid pull-right span10" id="navTab">
+<div class="row-fluid" id="navTab">
<ul class="nav nav-pills">
<li class=""><a href="{% url 'configuration' build.id %}">Summary</a></li>
<li class="active"><a href="#" >BitBake variables</a></li>
diff --git a/bitbake/lib/toaster/toastergui/templates/dirinfo.html b/bitbake/lib/toaster/toastergui/templates/dirinfo.html
index ecb46bf..d204332 100644
--- a/bitbake/lib/toaster/toastergui/templates/dirinfo.html
+++ b/bitbake/lib/toaster/toastergui/templates/dirinfo.html
@@ -168,10 +168,10 @@
$.fn.isOffScreen = function(){
var win = $(window);
viewportBottom = win.scrollTop() + win.height();
-
+
var bounds = this.offset();
bounds.bottom = bounds.top + this.outerHeight();
-
+
return (bounds.bottom > viewportBottom);
};
@@ -184,58 +184,55 @@
}
</script>
-<div class="span10">
-
- <div class="page-header">
- <h1> {{target.target}} </h1>
- </div>
-
- <ul class="nav nav-pills">
- <li class="">
- <a href="{% url 'target' build.id target.id %}">
- <i class="icon-question-sign get-help" title="Of all the packages built, the subset installed in the root file system of this image"></i>
- Packages included ({{target.package_count}} - {{packages_sum|filtered_filesizeformat}})
- </a>
- </li>
- <li class="active">
- <a href="{% url 'dirinfo' build.id target.id %}">
- <i class="icon-question-sign get-help" title="The directories and files in the root file system of this image"></i>
- Directory structure
- </a>
- </li>
- </ul>
-
- <div id="directory-structure" class="tab-pane active">
- <table id="dirtable" class="table table-bordered table-hover treetable">
- <thead>
- <tr>
- <th>Directory / File</th>
- <th>Symbolic link to</th>
- <th>Source package</th>
- <th class="narrow-col">Size</th>
- <th class="medium-col">Permissions</th>
- <th class="narrow-col">Owner</th>
- <th class="narrow-col">Group</th>
- </tr>
- </thead>
- <tbody>
- <script type='text/javascript'>
- setupTreetable();
- addRows(null, {{ objects|safe }} );
- {% if file_path %}
- {% comment %}
- link from package_included_detail specifies file path
- {% endcomment %}
- {% for dir_elem in dir_list %}
- $("#dirtable").treetable("expandNode", "{{dir_elem}}");
- {% endfor %}
- selectRow("{{file_path}}");
- {% endif %}
- </script>
- </tbody>
- </table>
- </div> <!-- directory-structure -->
-</div> <!-- span10 -->
+<div class="page-header">
+ <h1> {{target.target}} </h1>
+</div>
+
+<ul class="nav nav-pills">
+ <li class="">
+ <a href="{% url 'target' build.id target.id %}">
+ <i class="icon-question-sign get-help" title="Of all the packages built, the subset installed in the root file system of this image"></i>
+ Packages included ({{target.package_count}} - {{packages_sum|filtered_filesizeformat}})
+ </a>
+ </li>
+ <li class="active">
+ <a href="{% url 'dirinfo' build.id target.id %}">
+ <i class="icon-question-sign get-help" title="The directories and files in the root file system of this image"></i>
+ Directory structure
+ </a>
+ </li>
+</ul>
+
+<div id="directory-structure" class="tab-pane active">
+ <table id="dirtable" class="table table-bordered table-hover treetable">
+ <thead>
+ <tr>
+ <th>Directory / File</th>
+ <th>Symbolic link to</th>
+ <th>Source package</th>
+ <th class="narrow-col">Size</th>
+ <th class="medium-col">Permissions</th>
+ <th class="narrow-col">Owner</th>
+ <th class="narrow-col">Group</th>
+ </tr>
+ </thead>
+ <tbody>
+ <script type='text/javascript'>
+ setupTreetable();
+ addRows(null, {{ objects|safe }} );
+ {% if file_path %}
+ {% comment %}
+ link from package_included_detail specifies file path
+ {% endcomment %}
+ {% for dir_elem in dir_list %}
+ $("#dirtable").treetable("expandNode", "{{dir_elem}}");
+ {% endfor %}
+ selectRow("{{file_path}}");
+ {% endif %}
+ </script>
+ </tbody>
+ </table>
+</div> <!-- directory-structure -->
{% endblock buildinfomain %}
diff --git a/bitbake/lib/toaster/toastergui/templates/recipes.html b/bitbake/lib/toaster/toastergui/templates/recipes.html
index d144893..9253d07 100644
--- a/bitbake/lib/toaster/toastergui/templates/recipes.html
+++ b/bitbake/lib/toaster/toastergui/templates/recipes.html
@@ -12,7 +12,6 @@
{% endblock %}
{% block buildinfomain %}
-<div class="span10">
<div class="page-header">
<h1>
{% if request.GET.search and objects.paginator.count > 0 %}
@@ -109,5 +108,4 @@
{% include "basetable_bottom.html" %}
{% endif %}
-</div>
{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/templates/target.html b/bitbake/lib/toaster/toastergui/templates/target.html
index 4c33eaa..4479eb0 100644
--- a/bitbake/lib/toaster/toastergui/templates/target.html
+++ b/bitbake/lib/toaster/toastergui/templates/target.html
@@ -18,7 +18,7 @@
{% block buildinfomain %}
-<div class="row-fluid span10">
+<div class="row-fluid">
<div class="page-header">
<h1>
{% if request.GET.search and objects.paginator.count > 0 %}
@@ -32,7 +32,7 @@
</div>
</div>
-<div class="row-fluid pull-right span10" id="navTab">
+<div class="row-fluid pull-right" id="navTab">
<ul class="nav nav-pills">
<li class="active">
<a href="#target">
@@ -159,5 +159,5 @@
{% include "basetable_bottom.html" %}
{% endif %}
</div> <!-- tabpane -->
-</div> <!--span 10-->
+</div>
{% endblock buildinfomain %}
diff --git a/bitbake/lib/toaster/toastergui/templates/tasks.html b/bitbake/lib/toaster/toastergui/templates/tasks.html
index 23eb957..3808e42 100644
--- a/bitbake/lib/toaster/toastergui/templates/tasks.html
+++ b/bitbake/lib/toaster/toastergui/templates/tasks.html
@@ -38,106 +38,104 @@
{% endif %}
{% endblock %}
-{% block buildinfomain %}
-<div class="span10">
-{% if not request.GET.filter and not request.GET.search and not objects.paginator.count %}
- <!-- Empty - no data in database -->
- <div class="page-header">
- <h1>{{mainheading}}</h1>
- </div>
- <div class="alert alert-info lead">
- No data was recorded for this build.
- </div>
-
-{% else %}
-
- <div class="page-header">
- <h1>
- {% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %}
- {{objects.paginator.count}} task{{objects.paginator.count|pluralize}} found
- {%elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %}
- No tasks found
- {%else%}
- {{mainheading}}
- {%endif%}
- </h1>
- </div>
-
- {% if objects.paginator.count == 0 %}
- <div class="row-fluid">
- <div class="alert">
- <form class="no-results input-append" id="searchform">
- <input id="search" name="search" class="input-xxlarge" type="text" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{% endif %}
- <button class="btn" type="submit" value="Search">Search</button>
- <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all tasks</button>
- </form>
- </div>
- </div>
-
+ {% block buildinfomain %}
+ {% if not request.GET.filter and not request.GET.search and not objects.paginator.count %}
+ <!-- Empty - no data in database -->
+ <div class="page-header">
+ <h1>{{mainheading}}</h1>
+ </div>
+ <div class="alert alert-info lead">
+ No data was recorded for this build.
+ </div>
{% else %}
- {% include "basetable_top.html" %}
-
- {% for task in objects %}
- <tr {{ task|task_color }} id="{{task.order}}">
- <td class="order">
- <a href="{%url "task" build.pk task.pk%}">{{task.order}}</a>
- </td>
- <td class="recipe_name" >
- <a href="{% url "recipe" build.pk task.recipe.pk %}">{{task.recipe.name}}</a>
- </td>
- <td class="recipe_version">
- <a href="{% url "recipe" build.pk task.recipe.pk %}">{{task.recipe.version}}</a>
- </td>
- <td class="task_name">
- <a href="{%url "task" build.pk task.pk%}">{{task.task_name}}</a> {% if task.get_description %}<i class="icon-question-sign get-help hover-help" title="{{task.get_description}}"></i> {% endif %}
- </td>
- <td class="executed">
- <a href="{%url "task" build.pk task.pk%}">{{task.get_executed_display}}</a>
- </td>
- <td class="outcome">
- <a href="{%url "task" build.pk task.pk%}">{{task.get_outcome_display}} </a>
- {% if task.outcome = task.OUTCOME_FAILED %}
- <a href="{% url 'build_artifact' build.pk "tasklogfile" task.pk %}">
- <i class="icon-download-alt" title="Download task log file"></i>
- </a>
- {% endif %}
- <i class="icon-question-sign get-help hover-help" title="{{task.get_outcome_help}}"></i>
- </td>
- <td class="cache_attempt">
- <a href="{%url "task" build.pk task.pk%}">{{task.get_sstate_result_display|format_none_and_zero}}</a>
- </td>
- <td class="time_taken">
- {{task.elapsed_time|format_none_and_zero|floatformat:2}}
- </td>
- <td class="cpu_time_system">
- {{task.cpu_time_system|format_none_and_zero|floatformat:2}}
- </td>
- <td class="cpu_time_user">
- {{task.cpu_time_user|format_none_and_zero|floatformat:2}}
- </td>
- <td class="disk_io">
- {{task.disk_io|format_none_and_zero|intcomma}}
- </td>
-
- </tr>
- {% endfor %}
-
- {% include "basetable_bottom.html" %}
- {% endif %} {# objects.paginator.count #}
-{% endif %} {# empty #}
-</div>
-
-<script type="text/javascript">
-
- $(document).ready(function() {
- // enable blue hightlight animation for the order link
- if (location.href.search('#') > -1) {
- var task_order = location.href.split('#')[1];
- $("#" + task_order).addClass("highlight");
- }
- });
-
-</script>
+
+ <div class="page-header">
+ <h1>
+ {% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %}
+ {{objects.paginator.count}} task{{objects.paginator.count|pluralize}} found
+ {%elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %}
+ No tasks found
+ {%else%}
+ {{mainheading}}
+ {%endif%}
+ </h1>
+ </div>
+
+ {% if objects.paginator.count == 0 %}
+ <div class="row-fluid">
+ <div class="alert">
+ <form class="no-results input-append" id="searchform">
+ <input id="search" name="search" class="input-xxlarge" type="text" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{% endif %}
+ <button class="btn" type="submit" value="Search">Search</button>
+ <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all tasks</button>
+ </form>
+ </div>
+ </div>
+
+
+ {% else %}
+ {% include "basetable_top.html" %}
+
+ {% for task in objects %}
+ <tr {{ task|task_color }} id="{{task.order}}">
+ <td class="order">
+ <a href="{%url "task" build.pk task.pk%}">{{task.order}}</a>
+ </td>
+ <td class="recipe_name" >
+ <a href="{% url "recipe" build.pk task.recipe.pk %}">{{task.recipe.name}}</a>
+ </td>
+ <td class="recipe_version">
+ <a href="{% url "recipe" build.pk task.recipe.pk %}">{{task.recipe.version}}</a>
+ </td>
+ <td class="task_name">
+ <a href="{%url "task" build.pk task.pk%}">{{task.task_name}}</a> {% if task.get_description %}<i class="icon-question-sign get-help hover-help" title="{{task.get_description}}"></i> {% endif %}
+ </td>
+ <td class="executed">
+ <a href="{%url "task" build.pk task.pk%}">{{task.get_executed_display}}</a>
+ </td>
+ <td class="outcome">
+ <a href="{%url "task" build.pk task.pk%}">{{task.get_outcome_display}} </a>
+ {% if task.outcome = task.OUTCOME_FAILED %}
+ <a href="{% url 'build_artifact' build.pk "tasklogfile" task.pk %}">
+ <i class="icon-download-alt" title="Download task log file"></i>
+ </a>
+ {% endif %}
+ <i class="icon-question-sign get-help hover-help" title="{{task.get_outcome_help}}"></i>
+ </td>
+ <td class="cache_attempt">
+ <a href="{%url "task" build.pk task.pk%}">{{task.get_sstate_result_display|format_none_and_zero}}</a>
+ </td>
+ <td class="time_taken">
+ {{task.elapsed_time|format_none_and_zero|floatformat:2}}
+ </td>
+ <td class="cpu_time_system">
+ {{task.cpu_time_system|format_none_and_zero|floatformat:2}}
+ </td>
+ <td class="cpu_time_user">
+ {{task.cpu_time_user|format_none_and_zero|floatformat:2}}
+ </td>
+ <td class="disk_io">
+ {{task.disk_io|format_none_and_zero|intcomma}}
+ </td>
+
+ </tr>
+ {% endfor %}
+
+ {% include "basetable_bottom.html" %}
+ {% endif %} {# objects.paginator.count #}
+ {% endif %} {# empty #}
+
+ <script type="text/javascript">
+
+ $(document).ready(function() {
+ // enable blue hightlight animation for the order link
+ if (location.href.search('#') > -1) {
+ var task_order = location.href.split('#')[1];
+ $("#" + task_order).addClass("highlight");
+ }
+ });
+
+ </script>
{% endblock %}
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 85ca9be..f94fb1c 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -506,6 +506,7 @@ def builddashboard( request, build_id ):
context = {
'build' : build,
+ 'Build' : Build,
'hasImages' : hasImages,
'ntargets' : ntargets,
'targets' : targets,
--
Elliot Smith
Software Engineer
Intel OTC
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] toaster: remove links from time field on failed builds
2016-03-21 19:53 [PATCH 0/2][v2] Show custom build dashboard for builds which fail early Elliot Smith
2016-03-21 19:53 ` [PATCH 1/2] toaster: adjust build dashboard for failed builds Elliot Smith
@ 2016-03-21 19:53 ` Elliot Smith
2016-03-23 14:39 ` [PATCH 0/2][v2] Show custom build dashboard for builds which fail early Barros Pena, Belen
2 siblings, 0 replies; 5+ messages in thread
From: Elliot Smith @ 2016-03-21 19:53 UTC (permalink / raw)
To: toaster
Failed builds don't have any time data recorded for them,
so the time field in the builds table, the time shown
in the recent builds area, and the build time shown in
the build dashboard should not be links for failed builds.
[YOCTO #8443]
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
bitbake/lib/toaster/toastergui/tables.py | 8 ++++++--
bitbake/lib/toaster/toastergui/templates/builddashboard.html | 12 ++++++++++--
bitbake/lib/toaster/toastergui/templates/mrb_section.html | 7 ++++++-
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 67a6592..ebe7431 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -1195,9 +1195,13 @@ class BuildsTable(ToasterTable):
time_template = '''
{% load projecttags %}
- <a href="{% url "buildtime" data.id %}">
+ {% if data.outcome == extra.Build.SUCCEEDED %}
+ <a href="{% url "buildtime" data.id %}">
+ {{data.timespent_seconds | sectohms}}
+ </a>
+ {% else %}
{{data.timespent_seconds | sectohms}}
- </a>
+ {% endif %}
'''
image_files_template = '''
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
index b0c3d99..e38ee6c 100644
--- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html
+++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
@@ -41,9 +41,17 @@
{% endif %}
<span > <i class="icon-warning-sign yellow"></i><strong><a href="#warnings" class="warning show-warnings"> {{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a></strong></span>
{% endif %}
- <span class="pull-right">Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+ <span class="pull-right">
+ Build time:
+ <span data-build-field="buildtime">
+ {% if build.started %}
+ <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+ {% else %}
+ {{ build.timespent_seconds|sectohms }}
+ {% endif %}
+ </span>
{% if build.cooker_log_path %}
- <a class="btn {%if build.outcome == build.SUCCEEDED%}btn-success{%else%}btn-danger{%endif%} pull-right log" href="{% url 'build_artifact' build.id "cookerlog" build.id %}">Download build log</a>
+ <a class="btn {%if build.outcome == build.SUCCEEDED%}btn-success{%else%}btn-danger{%endif%} pull-right log" href="{% url 'build_artifact' build.id "cookerlog" build.id %}">Download build log</a>
{% endif %}
</span>
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
index 551e341..07914d8 100644
--- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html
+++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -85,7 +85,12 @@
</div>
<div class="lead ">
<span class="lead">
- Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+ Build time:
+ {% if build.outcome == build.SUCCEEDED %}
+ <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+ {% else %}
+ {{ build.timespent_seconds|sectohms }}
+ {% endif %}
</span>
{% if build.project.is_default %}
<i class="pull-right icon-question-sign get-help
--
Elliot Smith
Software Engineer
Intel OTC
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2][v2] Show custom build dashboard for builds which fail early
2016-03-21 19:53 [PATCH 0/2][v2] Show custom build dashboard for builds which fail early Elliot Smith
2016-03-21 19:53 ` [PATCH 1/2] toaster: adjust build dashboard for failed builds Elliot Smith
2016-03-21 19:53 ` [PATCH 2/2] toaster: remove links from time field on " Elliot Smith
@ 2016-03-23 14:39 ` Barros Pena, Belen
2 siblings, 0 replies; 5+ messages in thread
From: Barros Pena, Belen @ 2016-03-23 14:39 UTC (permalink / raw)
To: Smith, Elliot, toaster@yoctoproject.org
On 21/03/2016 19:53, "toaster-bounces@yoctoproject.org on behalf of Elliot
Smith" <toaster-bounces@yoctoproject.org on behalf of
elliot.smith@intel.com> wrote:
>v2:
>
>Modifications for other templates which were missed in v1, as per Belen's
>review.
This one looks good: layout issues are fixed.
Thanks!
Belén
>
>v1:
>
>Builds which fail early at the "build request stage" (i.e. before the
>BuildStarted
>event happens) need a custom build dashboard, as they don't have any
>buildstats
>data, images, recipes etc., so the links in the left-hand menu are
>irrelevant.
>
>Hide the build dashboard's left-hand menu if a build failed early (before
>BuildStarted). Also remove the build time links for the failed builds, as
>time data is not available.
>
>The state of the build as "started" or not is determined by looking for
>build variables associated with a build. As these variables are only added
>at the point when BuildStarted occurs, any Build object without these
>variables hasn't triggered a BuildStarted event.
>
>(This is something of a work-around; in future we may have more
>fine-grained
>states on a build so that we can properly tell its state. When this
>happens, the
>Build.started() method could be modified to properly reflect this.)
>
>To test:
>
>1. Start a build with a bad target, e.g. "zzz".
>2. When the build fails, go to the dashboard for the build. The left-hand
>menu
>should not be visible.
>3. Go to the all builds page. The build time for the failed build should
>not have a hyperlink on it.
>4. Start a build with a bad MACHINE variable setting (either modify in
>project
>configuration or in conf/toaster.conf).
>5. Repeat steps 2 and 3 for the failed build.
>6. Start a build with a bad DISTRO variable setting (either modify in
>project
>configuration or in conf/toaster.conf).
>7. Repeat steps 2 and 3 for the failed build.
>8. Start a good build, e.g. "mpfr-native".
>9. When the build completes (successfully), go to the dashboard. The
>left-hand
>menu should be visible and functioning.
>10. Go to the all builds page. Links on the build time should be present
>and
>should point at the time page for the build.
>
>Note that I have some Selenium tests for testing these changes, but they
>depend on a previous patchset which is not yet in toaster-next; see
>https://lists.yoctoproject.org/pipermail/toaster/2016-March/004164.html.
>
>Changes since 358ba11b15f5182c4d667cf35565afc0c6ad4126 (toaster-next) are
>in
>git://git.yoctoproject.org/poky-contrib,
>elliot/toaster/failed_builds_display-8443
>http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/fa
>iled_builds_display-8443
>
>Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8443
>
>Elliot Smith (2):
> toaster: adjust build dashboard for failed builds
> toaster: remove links from time field on failed builds
>
> bitbake/lib/toaster/orm/models.py | 15 ++
> bitbake/lib/toaster/toastergui/tables.py | 8 +-
> .../toastergui/templates/basebuildpage.html | 148 ++++++++--------
> .../lib/toaster/toastergui/templates/bpackage.html | 2 -
> .../toastergui/templates/builddashboard.html | 186
>++++++++++---------
> .../toastergui/templates/configuration.html | 4 +-
> .../toaster/toastergui/templates/configvars.html | 4 +-
> .../lib/toaster/toastergui/templates/dirinfo.html | 105 ++++++-----
> .../toaster/toastergui/templates/mrb_section.html | 7 +-
> .../lib/toaster/toastergui/templates/recipes.html | 2 -
> .../lib/toaster/toastergui/templates/target.html | 6 +-
> .../lib/toaster/toastergui/templates/tasks.html | 196
>++++++++++-----------
> bitbake/lib/toaster/toastergui/views.py | 1 +
> 13 files changed, 354 insertions(+), 330 deletions(-)
>
>--
>Elliot Smith
>Software Engineer
>Intel OTC
>
>---------------------------------------------------------------------
>Intel Corporation (UK) Limited
>Registered No. 1134945 (England)
>Registered Office: Pipers Way, Swindon SN3 1RJ
>VAT No: 860 2173 47
>
>This e-mail and any attachments may contain confidential material for
>the sole use of the intended recipient(s). Any review or distribution
>by others is strictly prohibited. If you are not the intended
>recipient, please contact the sender and delete all copies.
>
>--
>_______________________________________________
>toaster mailing list
>toaster@yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-23 14:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-21 19:53 [PATCH 0/2][v2] Show custom build dashboard for builds which fail early Elliot Smith
2016-03-21 19:53 ` [PATCH 1/2] toaster: adjust build dashboard for failed builds Elliot Smith
2016-03-21 19:53 ` [PATCH 2/2] toaster: remove links from time field on " Elliot Smith
2016-03-23 14:39 ` [PATCH 0/2][v2] Show custom build dashboard for builds which fail early Barros Pena, Belen
-- strict thread matches above, loose matches on Subject: below --
2016-03-17 11:40 [PATCH 0/2] " Elliot Smith
2016-03-17 11:40 ` [PATCH 1/2] toaster: adjust build dashboard for failed builds Elliot Smith
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.