From 43aaa802c35ecc9d972f3b9adcd060033de1d9de Mon Sep 17 00:00:00 2001 From: David Reyna Date: Tue, 27 Jun 2017 13:44:29 -0700 Subject: bitbake: toaster: git clone progress bar If a project has a lot of additional layers, the build may appear to hang while those layers are checked out. This patch adds a clone progress bar that is visible before the parsing progress appears. [YOCTO #9916] (Bitbake rev: 0c94d947b74c4dee23d7b9d255facd3cf839ccbe) Signed-off-by: David Reyna Signed-off-by: Richard Purdie --- .../lib/toaster/toastergui/static/js/mrbsection.js | 15 +++++++++++ .../toaster/toastergui/templates/mrb_section.html | 29 +++++++++++++++++++++- bitbake/lib/toaster/toastergui/widgets.py | 4 +++ 3 files changed, 47 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/toaster/toastergui') diff --git a/bitbake/lib/toaster/toastergui/static/js/mrbsection.js b/bitbake/lib/toaster/toastergui/static/js/mrbsection.js index 73d0935fa5..c0c5fa9589 100644 --- a/bitbake/lib/toaster/toastergui/static/js/mrbsection.js +++ b/bitbake/lib/toaster/toastergui/static/js/mrbsection.js @@ -61,6 +61,12 @@ function mrbSectionInit(ctx){ return (cached.recipes_parsed_percentage !== build.recipes_parsed_percentage); } + // returns true if the number of repos cloned/to clone changed + function cloneProgressChanged(build) { + var cached = getCached(build); + return (cached.repos_cloned_percentage !== build.repos_cloned_percentage); + } + function refreshMostRecentBuilds(){ libtoaster.getMostRecentBuilds( libtoaster.ctx.mostRecentBuildsUrl, @@ -100,6 +106,15 @@ function mrbSectionInit(ctx){ container.html(html); } + else if (cloneProgressChanged(build)) { + // update the clone progress text + selector = '#repos-cloned-percentage-' + build.id; + $(selector).html(build.repos_cloned_percentage); + + // update the recipe progress bar + selector = '#repos-cloned-percentage-bar-' + build.id; + $(selector).width(build.repos_cloned_percentage + '%'); + } else if (tasksProgressChanged(build)) { // update the task progress text selector = '#build-pc-done-' + build.id; diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html index b761ffe1df..c5b9fe90d3 100644 --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html @@ -64,7 +64,9 @@
- <%if state == 'Parsing'%> + <%if state == 'Cloning'%> + <%include tmpl='#cloning-repos-build-template'/%> + <%else state == 'Parsing'%> <%include tmpl='#parsing-recipes-build-template'/%> <%else state == 'Queued'%> <%include tmpl='#queued-build-template'/%> @@ -98,6 +100,31 @@
+ + +