From dd99cf957da5836dc9b48d200f15a66f0bbce245 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Mon, 11 Jul 2016 14:47:06 +0100 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/api.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/toaster/toastergui/api.py') 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): br.save() except BuildRequest.DoesNotExist: - return error_response('No such build id %s' % i) + return error_response('No such build request id %s' % i) return error_response('ok') @@ -256,6 +256,14 @@ class MostRecentBuildsView(View): build['id'] = build_obj.pk build['dashboard_url'] = dashboard_url + buildrequest_id = None + if hasattr(build_obj, 'buildrequest'): + buildrequest_id = build_obj.buildrequest.pk + build['buildrequest_id'] = buildrequest_id + + build['recipes_parsed_percentage'] = \ + int((build_obj.recipes_parsed / build_obj.recipes_to_parse) * 100) + tasks_complete_percentage = 0 if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED): tasks_complete_percentage = 100 -- cgit v1.2.3-54-g00ecf