I have just updated this branch, as for some reason the migrations decided
to clash when I ran the test suite again. (They hadn't been doing this
earlier in the day when I'd run them, inexplicably.)

As this is a pull request, it won't affect my request for a review, but
note that the file diff is slightly different from the one advertised in my
v2 overview email.

Elliot

On 22 July 2016 at 11:54, Elliot Smith <[email protected]> wrote:

> 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
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>


-- 
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
-- 
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Reply via email to