From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id D569DE00F06; Fri, 22 Jul 2016 04:04:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [23.83.212.6 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] X-Greylist: delayed 7525 seconds by postgrey-1.32 at yocto-www; Fri, 22 Jul 2016 04:04:30 PDT Received: from aye.elm.relay.mailchannels.net (aye.elm.relay.mailchannels.net [23.83.212.6]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 0A0FDE00EF6 for ; Fri, 22 Jul 2016 04:04:30 -0700 (PDT) X-Sender-Id: wwwh|x-authuser|elliot@townx.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 926431C0BCF; Fri, 22 Jul 2016 10:55:00 +0000 (UTC) Received: from uscentral428.accountservergroup.com (ip-10-107-69-155.us-west-2.compute.internal [10.107.69.155]) by relay.mailchannels.net (Postfix) with ESMTPA id 1780D1BC59C; Fri, 22 Jul 2016 10:54:59 +0000 (UTC) X-Sender-Id: wwwh|x-authuser|elliot@townx.org Received: from uscentral428.accountservergroup.com (uscentral428.accountservergroup.com [10.132.194.146]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.7.1); Fri, 22 Jul 2016 10:55:00 +0000 X-MC-Relay: Good X-MailChannels-SenderId: wwwh|x-authuser|elliot@townx.org X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1469184900164:655961371 X-MC-Ingress-Time: 1469184900163 Received: from [176.249.240.35] (port=58242 helo=localhost.localdomain) by uscentral428.accountservergroup.com with esmtpa (Exim 4.87) (envelope-from ) id 1bQY6b-0003Fq-TC; Fri, 22 Jul 2016 06:54:58 -0400 From: Elliot Smith To: toaster@yoctoproject.org Date: Fri, 22 Jul 2016 11:54:51 +0100 Message-Id: X-Mailer: git-send-email 2.7.4 X-AuthUser: elliot@townx.org Subject: [PULL][v2] Improvements to build dashboard and most recent builds area X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2016 11:04:34 -0000 NB Because this contains a new JS file (jsrender) which has lines too long for git send-email, I'm sending it as a pull request. The branch containing the work described below is: poky-contrib, elliot/toaster/9631-recent_builds_states CHANGES IN V2 In response to Belen's feedback on v1, these fixes were made: * Fixed an issue where the state of builds on the project builds page never updated (due to missing project_id querystring parameter). * Replaces "...targets unknown..." with more optimistic "Fetching recipes...". * Fixed formatting of warnings which were the colour of errors (missing CSS classes). * Made sure that warnings are shown for failed builds. * Show build summary for builds with task failures. OVERVIEW This is a rewrite of the "most recent builds" area. The most recent builds area (on the all builds and project builds pages) now shows state for a build as follows: * Queued (not shown for cli builds): build request created but not actioned * Parsing recipes: shown as progress bar, using ParseProgress events to drive it * Tasks starting: shown while bitbake is constructing the runqueue and before any tasks have been completed * Task progress: as tasks are being completed, shown as progress bar * Completed or failed state If a build is cancelled, you will see: * Cancelling state, while waiting for bitbake to exit (note that this is also persistent across state reloads, and not just temporarily visible after the cancel button is clicked) * Cancelled state In addition, because this area also impacts and overlaps with fixes for other bugs in the build dashboard which I had hanging around, the following pieces are also on this branch: * Addition of a BuildInit event to capture failed builds (with bad targets) earlier. This was required as we need to make a Build object earlier, so that we have something to attach recipe parse progress to. * Changes to buildinfohelper so that the Build can be created on ParseStarted, but later embellished as BuildInit and BuildStarted trigger. * Hiding the left-hand menu and build summary area for builds which fail before the BuildStarted event occurs. This entailed adding a started() method to Build so that we can tell when BuildStarted has occurred. * Remove build time links for builds which have no time data (because they failed early). IMPLEMENTATION NOTES I added a BuildInit event to cooker, which I have tried to do (unsuccessfully) in previous patches. However, I have amended where this event is fired so that tasks have been sanitised before they are sent with the event. I added a new get_state() method to the Build model. This puts the logic for determining the state of a build in the business logic, instead of partly in the front end and partly in the UI code. I also added a /mostrecentbuilds JSON API which the most recent builds area uses to fetch the build data. This provides a clean separation between server and client, meaning that the server doesn't have to generate much HTML. Finally, I moved a lot of templating code to the client so that we don't have such an unwieldy mix of client-side and server-side templating. The templating library I used is jsrender (http://www.jsviews.com/), as this integrates simply with jQuery. This makes it much easier to add new state transitions to that area of the page (such as the git checkout progress we want to add later). RELATED BUGS https://bugzilla.yoctoproject.org/show_bug.cgi?id=9631 (add state transitions to most recent builds area) https://bugzilla.yoctoproject.org/show_bug.cgi?id=8443 (custom dashboard for builds which fail at the build request stage) https://bugzilla.yoctoproject.org/show_bug.cgi?id=8440 (better display of builds which fail at the build request stage) CHANGES (I've kept a record of the commits in this pull request for reference, but "toaster: move most recent builds templating to client" can't be handled by git send-email.) Related bugs: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9631 https://bugzilla.yoctoproject.org/show_bug.cgi?id=8443 https://bugzilla.yoctoproject.org/show_bug.cgi?id=8440 The following changes since commit 1826de5234aadb9aa51c83f86471cdd7e88b48cf (toaster-next): toaster: loadconf Partially add back some of the layerSource parsing (2016-07-21 11:23:00 +0100) are available in the git repository at: git://git.yoctoproject.org/poky-contrib elliot/toaster/9631-recent_builds_states http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/9631-recent_builds_states Elliot Smith (12): cooker: add BuildInit event toaster: move most recent builds templating to client toaster: show progress of recipe parsing in recent builds area toaster: show "Tasks starting..." until the first task completes toaster: tweak styling and typos in recent builds area toaster: remove links from time field on failed builds toaster: add started property to Build toaster: adjust build dashboard for failed builds toaster-tests: add tests for build time links in the all builds page toaster-tests: add tests for build dashboard menu and summary visibility toaster-tests: add tests for most recent builds state changes toaster-tests: fix erroneous message when test fails bitbake/LICENSE | 2 + bitbake/lib/bb/cooker.py | 4 + bitbake/lib/bb/event.py | 6 +- bitbake/lib/bb/ui/buildinfohelper.py | 118 ++++--- bitbake/lib/bb/ui/toasterui.py | 31 +- .../migrations/0005_reorder_buildrequest_states.py | 19 ++ bitbake/lib/toaster/bldcontrol/models.py | 12 +- .../0010_recipe_parse_progress_fields.py | 24 ++ .../orm/migrations/0011_allow_empty_buildname.py | 19 ++ bitbake/lib/toaster/orm/models.py | 87 ++++- .../toaster/tests/browser/test_all_builds_page.py | 93 +++++- .../tests/browser/test_builddashboard_page.py | 127 +++++-- .../browser/test_builddashboard_page_artifacts.py | 7 +- .../tests/browser/test_layerdetails_page.py | 8 +- .../browser/test_most_recent_builds_states.py | 211 ++++++++++++ bitbake/lib/toaster/toastergui/api.py | 115 ++++++- .../lib/toaster/toastergui/static/css/default.css | 1 + .../toaster/toastergui/static/js/jsrender.min.js | 4 + .../lib/toaster/toastergui/static/js/libtoaster.js | 16 + .../lib/toaster/toastergui/static/js/mrbsection.js | 180 ++++++---- bitbake/lib/toaster/toastergui/tables.py | 8 +- bitbake/lib/toaster/toastergui/templates/base.html | 6 + .../toastergui/templates/basebuildpage.html | 176 +++++----- .../toastergui/templates/builddashboard.html | 158 +++++---- .../toastergui/templates/buildrequestdetails.html | 64 ---- .../toaster/toastergui/templates/mrb_section.html | 371 +++++++++++++-------- .../templates/projectbuilds-toastertable.html | 2 +- .../toaster/toastergui/templatetags/projecttags.py | 8 - bitbake/lib/toaster/toastergui/urls.py | 3 + 29 files changed, 1329 insertions(+), 551 deletions(-) create mode 100644 bitbake/lib/toaster/bldcontrol/migrations/0005_reorder_buildrequest_states.py create mode 100644 bitbake/lib/toaster/orm/migrations/0010_recipe_parse_progress_fields.py create mode 100644 bitbake/lib/toaster/orm/migrations/0011_allow_empty_buildname.py create mode 100644 bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py create mode 100644 bitbake/lib/toaster/toastergui/static/js/jsrender.min.js delete mode 100644 bitbake/lib/toaster/toastergui/templates/buildrequestdetails.html