summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-07-12 16:14:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-11 00:09:26 +0100
commit82d998d6c6378e4eb70b5712b339b6095ed7540a (patch)
tree8eab08477492849c9f4175e99e9e624f93319f67 /bitbake/lib
parentdd99cf957da5836dc9b48d200f15a66f0bbce245 (diff)
downloadpoky-82d998d6c6378e4eb70b5712b339b6095ed7540a.tar.gz
bitbake: toaster: show "Tasks starting..." until the first task completes
To prevent showing a "0% of tasks complete" message for a long time, don't show the progress bar until the first task has finished. While waiting for that first task, show a message about tasks starting instead. [YOCTO #9631] (Bitbake rev: 5529bcd860d2932b967a064ae28690ac5a725342) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/orm/models.py13
-rw-r--r--bitbake/lib/toaster/toastergui/templates/mrb_section.html28
2 files changed, 37 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 4641736add..cfa243c595 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -628,6 +628,17 @@ class Build(models.Model):
628 return self.outcome == Build.IN_PROGRESS and \ 628 return self.outcome == Build.IN_PROGRESS and \
629 self.recipes_parsed < self.recipes_to_parse 629 self.recipes_parsed < self.recipes_to_parse
630 630
631 def is_starting(self):
632 """
633 True if the build has no completed tasks yet and is still just starting
634 tasks.
635
636 Note that the mechanism for testing whether a Task is "done" is whether
637 its order field is set, as per the completeper() method.
638 """
639 return self.outcome == Build.IN_PROGRESS and \
640 self.task_build.filter(order__isnull=False).count() == 0
641
631 def get_state(self): 642 def get_state(self):
632 """ 643 """
633 Get the state of the build; one of 'Succeeded', 'Failed', 'In Progress', 644 Get the state of the build; one of 'Succeeded', 'Failed', 'In Progress',
@@ -643,6 +654,8 @@ class Build(models.Model):
643 return 'Queued' 654 return 'Queued'
644 elif self.is_parsing(): 655 elif self.is_parsing():
645 return 'Parsing' 656 return 'Parsing'
657 elif self.is_starting():
658 return 'Starting'
646 else: 659 else:
647 return self.get_outcome_text() 660 return self.get_outcome_text()
648 661
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
index 880485d45f..b74f723932 100644
--- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html
+++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -71,6 +71,8 @@
71 <%include tmpl='#succeeded-or-failed-build-template'/%> 71 <%include tmpl='#succeeded-or-failed-build-template'/%>
72 <%else state == 'Cancelling'%> 72 <%else state == 'Cancelling'%>
73 <%include tmpl='#cancelling-build-template'/%> 73 <%include tmpl='#cancelling-build-template'/%>
74 <%else state == 'Starting'%>
75 <%include tmpl='#starting-template'/%>
74 <%else state == 'In Progress'%> 76 <%else state == 'In Progress'%>
75 <%include tmpl='#in-progress-build-template'/%> 77 <%include tmpl='#in-progress-build-template'/%>
76 <%else state == 'Cancelled'%> 78 <%else state == 'Cancelled'%>
@@ -81,8 +83,9 @@
81<!-- queued build --> 83<!-- queued build -->
82<script id="queued-build-template" type="text/x-jsrender"> 84<script id="queued-build-template" type="text/x-jsrender">
83 <div class="col-md-5"> 85 <div class="col-md-5">
84 <span class="glyphicon glyphicon-question-sign get-help get-help-blue" title="This build is waiting for 86 <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
85the build directory to become available"></span> 87 title="This build is waiting for the build directory to become available">
88 </span>
86 89
87 Build queued 90 Build queued
88 </div> 91 </div>
@@ -108,7 +111,8 @@ the build directory to become available"></span>
108 111
109 <div class="col-md-4 progress-info"> 112 <div class="col-md-4 progress-info">
110 <!-- parse completion percentage --> 113 <!-- parse completion percentage -->
111 <span class="glyphicon glyphicon-question-sign get-help get-help-blue" title="BitBake is parsing the layers required for your build"></span> 114 <span class="glyphicon glyphicon-question-sign get-help get-help-blue" title="BitBake is parsing the layers required for your build">
115 </span>
112 116
113 Parsing <span id="recipes-parsed-percentage-<%:id%>"><%:recipes_parsed_percentage%></span>% complete 117 Parsing <span id="recipes-parsed-percentage-<%:id%>"><%:recipes_parsed_percentage%></span>% complete
114 118
@@ -116,7 +120,23 @@ the build directory to become available"></span>
116 </div> 120 </div>
117</script> 121</script>
118 122
119<!-- in progress build --> 123<!-- in progress build; tasks still starting -->
124<script id="starting-template" type="text/x-jsrender">
125 <div class="col-md-5">
126 <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
127 title="This build is waiting for tasks to start">
128 </span>
129
130 Tasks starting...
131 </div>
132
133 <div class="col-md-4">
134 <!-- cancel button -->
135 <%include tmpl='#cancel-template'/%>
136 </div>
137</script>
138
139<!-- in progress build; at least one task finished -->
120<script id="in-progress-build-template" type="text/x-jsrender"> 140<script id="in-progress-build-template" type="text/x-jsrender">
121 <!-- progress bar and task completion percentage --> 141 <!-- progress bar and task completion percentage -->
122 <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info"> 142 <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">