summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/api.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-07-11 14:47:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-11 00:09:26 +0100
commitdd99cf957da5836dc9b48d200f15a66f0bbce245 (patch)
treee7b8b8fa6b88520aabd6f17bc41cc8410af66761 /bitbake/lib/toaster/toastergui/api.py
parent952ffb3e1f4a00793e0c9c49bc0c8fb8729424c4 (diff)
downloadpoky-dd99cf957da5836dc9b48d200f15a66f0bbce245.tar.gz
bitbake: toaster: show progress of recipe parsing in recent builds area
Modify buildinfohelper and toasterui so that they record the recipe parse progress (from ParseProgress events in bitbake) on the Build object. Note that because the Build object is now created at the point when ParseStarted occurs, it is necessary to set the build name to the empty string initially (hence the migration). The build name can be set when the build properly starts, i.e. at the BuildStarted event. Then use this additional data to determine whether a Build is in a "Parsing" state, and report this in the JSON API. This enables the most recent builds area to show the recipe parse progress. Add additional logic to update the progress bar if the progress for a build object changes. [YOCTO #9631] (Bitbake rev: f33d51d46d70e73e04e325807c1bc4eb68462f7b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/api.py')
-rw-r--r--bitbake/lib/toaster/toastergui/api.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py
index aa3cbd83b2..b57f670ba3 100644
--- a/bitbake/lib/toaster/toastergui/api.py
+++ b/bitbake/lib/toaster/toastergui/api.py
@@ -87,7 +87,7 @@ class XhrBuildRequest(View):
87 br.save() 87 br.save()
88 88
89 except BuildRequest.DoesNotExist: 89 except BuildRequest.DoesNotExist:
90 return error_response('No such build id %s' % i) 90 return error_response('No such build request id %s' % i)
91 91
92 return error_response('ok') 92 return error_response('ok')
93 93
@@ -256,6 +256,14 @@ class MostRecentBuildsView(View):
256 build['id'] = build_obj.pk 256 build['id'] = build_obj.pk
257 build['dashboard_url'] = dashboard_url 257 build['dashboard_url'] = dashboard_url
258 258
259 buildrequest_id = None
260 if hasattr(build_obj, 'buildrequest'):
261 buildrequest_id = build_obj.buildrequest.pk
262 build['buildrequest_id'] = buildrequest_id
263
264 build['recipes_parsed_percentage'] = \
265 int((build_obj.recipes_parsed / build_obj.recipes_to_parse) * 100)
266
259 tasks_complete_percentage = 0 267 tasks_complete_percentage = 0
260 if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED): 268 if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED):
261 tasks_complete_percentage = 100 269 tasks_complete_percentage = 100