From: Elliot Smith <elliot.smith@intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH 2/2] toaster: remove links from time field on failed builds
Date: Mon, 21 Mar 2016 19:53:53 +0000 [thread overview]
Message-ID: <1458590033-4724-3-git-send-email-elliot.smith@intel.com> (raw)
In-Reply-To: <1458590033-4724-1-git-send-email-elliot.smith@intel.com>
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.
next prev parent reply other threads:[~2016-03-21 19:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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 2/2] toaster: remove links from time field on failed builds Elliot Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1458590033-4724-3-git-send-email-elliot.smith@intel.com \
--to=elliot.smith@intel.com \
--cc=toaster@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.