Show custom build dashboard for builds which fail early
cover Show custom build dashboard for builds which fail early
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 ingit://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 ++++++++-------- .../toastergui/templates/builddashboard.html | 186 +++++++++++---------- .../toaster/toastergui/templates/mrb_section.html | 7 +- bitbake/lib/toaster/toastergui/views.py | 1 + 6 files changed, 199 insertions(+), 166 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.
PATCH 1/2 toaster: adjust build dashboard for failed builds
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]
--- 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(-)
bitbake/lib/toaster/orm/models.py +15 -0
@@ -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
bitbake/lib/toaster/toastergui/templates/basebuildpage.html +70 -78
159 lines not on this page · raw message
bitbake/lib/toaster/toastergui/templates/builddashboard.html +91 -83
246 lines not on this page · raw message
bitbake/lib/toaster/toastergui/views.py +1 -0
@@ -506,6 +506,7 @@ def builddashboard( request, build_id ): context = { 'build' : build, + 'Build' : Build, 'hasImages' : hasImages, 'ntargets' : ntargets, 'targets' : targets,
Signature · 14 lines
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.
PATCH 2/2 toaster: remove links from time field on failed builds
In reply to Elliot SmithFailed 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]
--- 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(-)
bitbake/lib/toaster/toastergui/tables.py +6 -2
@@ -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 = '''
bitbake/lib/toaster/toastergui/templates/builddashboard.html +10 -2
@@ -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>
bitbake/lib/toaster/toastergui/templates/mrb_section.html +6 -1
@@ -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
Signature · 14 lines
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.
Quoted 8 lines · On 17/03/2016 11:40, "[email protected] on behalf of Elliot…
Changes since
358ba11b15f5182c4d667cf35565afc0c6ad4126(toaster-next) are ingit://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-8443Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8443
This works like a charm, but something in the layout has gone funny. It's easier to see in the "Configuration" page, where the page header and the div with id navTab seem to have classes they don't need: row-fluid pull-right and span10. There is already a row-fluid parent and a span10 parent, so those classes should not be needed in those divs. They are restricting the width available to the content and pushing it to the right of the page.
In the pages with tables, like the tasks one, the table is wrapped in two divs both with the class span10. The second one should not be needed, since it restricts the width the table can use.
Thanks!
Belén
Quoted 22 lines · Belen
Quoted 5 lines · On 17/03/2016 11:40, "[email protected] on behalf of Elliot…
Changes since
358ba11b15f5182c4d667cf35565afc0c6ad4126(toaster-next) are ingit://git.yoctoproject.org/poky-contrib,
elliot/toaster/failed_builds_display-8443http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/fa
Quoted 3 lines
iled_builds_display-8443
Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8443
This works like a charm, but something in the layout has gone funny. It's easier to see in the "Configuration" page, where the page header and the div with id navTab seem to have classes they don't need: row-fluid pull-right and span10. There is already a row-fluid parent and a span10 parent, so those classes should not be needed in those divs. They are restricting the width available to the content and pushing it to the right of the page.
Quoted 4 lines
In the pages with tables, like the tasks one, the table is wrapped in two divs both with the class span10. The second one should not be needed, since it restricts the width the table can use.
Yes, I messed that up. I will amend and send another version.
Thanks.
Elliot
Quoted 6 lines
Thanks!
Belén
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre