diff options
| author | David Reyna <David.Reyna@windriver.com> | 2017-06-27 13:44:29 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 16:02:15 +0100 |
| commit | 43aaa802c35ecc9d972f3b9adcd060033de1d9de (patch) | |
| tree | bd8e0fd2ec8c01df2316538ac07527fe67823e6b /bitbake/lib/toaster/toastergui | |
| parent | d74bcbeaf241a67871d62b7e2c17900ae900642e (diff) | |
| download | poky-43aaa802c35ecc9d972f3b9adcd060033de1d9de.tar.gz | |
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 <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/mrbsection.js | 15 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/mrb_section.html | 29 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/widgets.py | 4 |
3 files changed, 47 insertions, 1 deletions
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){ | |||
| 61 | return (cached.recipes_parsed_percentage !== build.recipes_parsed_percentage); | 61 | return (cached.recipes_parsed_percentage !== build.recipes_parsed_percentage); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | // returns true if the number of repos cloned/to clone changed | ||
| 65 | function cloneProgressChanged(build) { | ||
| 66 | var cached = getCached(build); | ||
| 67 | return (cached.repos_cloned_percentage !== build.repos_cloned_percentage); | ||
| 68 | } | ||
| 69 | |||
| 64 | function refreshMostRecentBuilds(){ | 70 | function refreshMostRecentBuilds(){ |
| 65 | libtoaster.getMostRecentBuilds( | 71 | libtoaster.getMostRecentBuilds( |
| 66 | libtoaster.ctx.mostRecentBuildsUrl, | 72 | libtoaster.ctx.mostRecentBuildsUrl, |
| @@ -100,6 +106,15 @@ function mrbSectionInit(ctx){ | |||
| 100 | 106 | ||
| 101 | container.html(html); | 107 | container.html(html); |
| 102 | } | 108 | } |
| 109 | else if (cloneProgressChanged(build)) { | ||
| 110 | // update the clone progress text | ||
| 111 | selector = '#repos-cloned-percentage-' + build.id; | ||
| 112 | $(selector).html(build.repos_cloned_percentage); | ||
| 113 | |||
| 114 | // update the recipe progress bar | ||
| 115 | selector = '#repos-cloned-percentage-bar-' + build.id; | ||
| 116 | $(selector).width(build.repos_cloned_percentage + '%'); | ||
| 117 | } | ||
| 103 | else if (tasksProgressChanged(build)) { | 118 | else if (tasksProgressChanged(build)) { |
| 104 | // update the task progress text | 119 | // update the task progress text |
| 105 | selector = '#build-pc-done-' + build.id; | 120 | 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 @@ | |||
| 64 | </div> | 64 | </div> |
| 65 | 65 | ||
| 66 | <div data-build-state="<%:state%>"> | 66 | <div data-build-state="<%:state%>"> |
| 67 | <%if state == 'Parsing'%> | 67 | <%if state == 'Cloning'%> |
| 68 | <%include tmpl='#cloning-repos-build-template'/%> | ||
| 69 | <%else state == 'Parsing'%> | ||
| 68 | <%include tmpl='#parsing-recipes-build-template'/%> | 70 | <%include tmpl='#parsing-recipes-build-template'/%> |
| 69 | <%else state == 'Queued'%> | 71 | <%else state == 'Queued'%> |
| 70 | <%include tmpl='#queued-build-template'/%> | 72 | <%include tmpl='#queued-build-template'/%> |
| @@ -98,6 +100,31 @@ | |||
| 98 | </div> | 100 | </div> |
| 99 | </script> | 101 | </script> |
| 100 | 102 | ||
| 103 | <!-- cloning repos build --> | ||
| 104 | <script id="cloning-repos-build-template" type="text/x-jsrender"> | ||
| 105 | <!-- progress bar and parse completion percentage --> | ||
| 106 | <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info"> | ||
| 107 | <!-- progress bar --> | ||
| 108 | <div class="progress"> | ||
| 109 | <div id="repos-cloned-percentage-bar-<%:id%>" | ||
| 110 | style="width: <%:repos_cloned_percentage%>%;" | ||
| 111 | class="progress-bar"> | ||
| 112 | </div> | ||
| 113 | </div> | ||
| 114 | </div> | ||
| 115 | |||
| 116 | <div class="col-md-4 progress-info"> | ||
| 117 | <!-- parse completion percentage --> | ||
| 118 | <span class="glyphicon glyphicon-question-sign get-help get-help-blue" | ||
| 119 | title="Toaster is cloning the repos required for your build"> | ||
| 120 | </span> | ||
| 121 | |||
| 122 | Cloning <span id="repos-cloned-percentage-<%:id%>"><%:repos_cloned_percentage%></span>% complete | ||
| 123 | |||
| 124 | <%include tmpl='#cancel-template'/%> | ||
| 125 | </div> | ||
| 126 | </script> | ||
| 127 | |||
| 101 | <!-- parsing recipes build --> | 128 | <!-- parsing recipes build --> |
| 102 | <script id="parsing-recipes-build-template" type="text/x-jsrender"> | 129 | <script id="parsing-recipes-build-template" type="text/x-jsrender"> |
| 103 | <!-- progress bar and parse completion percentage --> | 130 | <!-- progress bar and parse completion percentage --> |
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py index 6b7b981f3b..67c1ff9615 100644 --- a/bitbake/lib/toaster/toastergui/widgets.py +++ b/bitbake/lib/toaster/toastergui/widgets.py | |||
| @@ -511,6 +511,10 @@ class MostRecentBuildsView(View): | |||
| 511 | int((build_obj.recipes_parsed / | 511 | int((build_obj.recipes_parsed / |
| 512 | build_obj.recipes_to_parse) * 100) | 512 | build_obj.recipes_to_parse) * 100) |
| 513 | 513 | ||
| 514 | build['repos_cloned_percentage'] = \ | ||
| 515 | int((build_obj.repos_cloned / | ||
| 516 | build_obj.repos_to_clone) * 100) | ||
| 517 | |||
| 514 | tasks_complete_percentage = 0 | 518 | tasks_complete_percentage = 0 |
| 515 | if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED): | 519 | if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED): |
| 516 | tasks_complete_percentage = 100 | 520 | tasks_complete_percentage = 100 |
