Commit Graph

1292 Commits

Author SHA1 Message Date
Michael Wood afab95c649 bitbake: toaster: xhr Update the implementation of the build cancellation request
Update the implementation of the backend api for cancelling builds with
the new cancelling BuildRequest state and cancelled Build state.
Also added some docstring about general usage.

Co-Author: Sujith H <sujith.h@gmail.com>

(Bitbake rev: 0d76084f5d896e4199e1446e2d6d43190a4fcc3a)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Michael Wood eead032aca bitbake: toaster: Move xhr calls for starting and stopping builds
Move the backend xhr implementation of the build request changes
into it's own file and out of the ToasterTable definition.
It used to live in the views.py but in a hope of starting to collate logical
groups of views move this to a new file called api.

(Bitbake rev: 29572f0e6bd3b5e8315f3b93d55bdb8967b86bc3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Sujith H f5aa97067f bitbake: toaster: bldcontrol Add forceShutDown function to BitbakeController
Add forceShutDown function to BitbakeController class. This function
provides a mechanism to cancel the build from toaster. An API which
can be used safely to cancel build and hence shutdown running bitbake
server.

[YOCTO #6787]

(Bitbake rev: 89dc2ee8f5b7255538082ce4f6cb5277839875a8)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh c4ae028209 bitbake: toaster: use bash explicitly
Toaster can't run builds on Ubuntu as default /bin/sh points
to dash there. The reason is that oe-init-build-env can't
be sourced under dash for various reasons. It can be fixed
or work arounded, but it wouldn't fix builds for older releases.
Explicitly using bash to start builds should fix the issue.

(Bitbake rev: e4352603b21d43a8b5d9ee417c036fff0a263d40)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh 590a8159aa bitbake: toaster: stop bitbake server after the build
Bitbake server is used only during the build. There is no need
in keeping server running after the build.

Running bitbake -m in the subshell after the build should stop
the server.

(Bitbake rev: 062c68e3e7d00834118fe07ceb0899874be714ae)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh a8f6001e0f bitbake: toaster: add new parameter to _shellcmd
Added 'nowait' parameter to _shellcmd method to support
running chain of commands in a subshell.

This is going to be used to stop bitbake server after
the build.

(Bitbake rev: 89fae3c8712bfaac48686c58b480e40c1abdcfdc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh a43a16b9fd bitbake: toaster: reimplement triggerBuild
Reimplemented triggerBuild method to support one build directory
per project:
 - start bitbake server from the cloned repository
 - don't run observer
 - run bitbake build directly instead of triggering it
   through xmlrpc

[YOCTO #7880]
[YOCTO #9058]
[YOCTO #8958]

(Bitbake rev: aba8e19bf609196f749e185d43571f706707e408)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh ab18c208b2 bitbake: toaster: modified setLayers API
Removed updating of bblayers.conf. It will be done in runBuild method.
Changed return value: return list of layers.
Removed _updateBBLayers method.

(Bitbake rev: 198bf7e6b8d7f847f2619b71c6bd86a9a76156c9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh 22fba9b2b7 bitbake: toaster: add brbe parameter to triggerBuild
Called triggerBuild with brbe parameter instead of adding TOASTER_BRBE
variable to the database and fetching it in triggerBuild.

(Bitbake rev: 669bb3f6865d8bb89cd94ef9d0eba3346c47d7b2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh 829a0bdb48 bitbake: toaster: remove release API
This API is quite dangerous as it removes build directory.
It's not used anywhere and most probably will not be used in future
as toaster is going to have one build directory per project.

(Bitbake rev: ef9e126227d3bdee86c1592e2baa43d21e6a32df)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh 7068e8a056 bitbake: toaster: remove startBBServer API
We still will have to run bitbake server, but it will be done
different way and the code will be in triggerBuild function.

Removed startBBServer API from BuildEnvironmentController and
LocalhostBEController classes.

(Bitbake rev: a8f986d73a84f28fa8b116b91fb30c5d2cd4edbe)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Joshua Lock 158575c738 bitbake: toaster: orm better detect requires during CustomImageRecipe generation
We were doing a string search for the literal string "require" and
assuming that a match meant the recipe uses the require keyword to
include the contents of another recipe. This test isn't very smart (it
should at least have matched on "require ") and triggers on the word
require anywhere in the recipe, i.e. the word "required" in the
DESCRIPTION of core-image-lsb.bb, and then breaks as the much smarter
regex fails to match anything.

Instead always run the regex search and only try to update the
require entry when the regex matches.

(Bitbake rev: a6add0e95d3d1e9a6a9fcabd73543bc5c278915f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:44 +01:00
Belen Barros Pena c634473ed3 bitbake: toaster: Correct typo on build form help text
The help text said to append a semicolon and a task name to a target to
run a task other than do_build. What you need to append is a colon.

[YOCTO #9326]

(Bitbake rev: 691419e23a94a94129b177e71d2c728b12689139)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:43 +01:00
Elliot Smith 7dcb4c4127 bitbake: toaster: tests Migrate landing page tests to Selenium
(Bitbake rev: 20ce1e1b39a9b602eb51ca0ba3954ea3e999c874)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:59 +01:00
Elliot Smith 5b848fa727 bitbake: toaster: tests Migrate all projects page tests to Selenium
(Bitbake rev: 0e5f45d68e423f8462937879eed3253db31b2bb5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:59 +01:00
Elliot Smith f2a38ea4a1 bitbake: toaster: tests Migrate project builds page tests to Selenium
(Bitbake rev: 31204937f71a7e0aa08361c3e20d02d063788a86)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:59 +01:00
Elliot Smith 961cd90375 bitbake: toaster: tests Migrate all builds page and project page tests to Selenium
(Bitbake rev: 4fda6be831d10e6d266b11975a0e9a35a7f35a77)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:58 +01:00
Elliot Smith f859a3d40e bitbake: toaster: tests Migrate to Selenium for UI tests
Create a new folder for Selenium tests.

Add a new base Selenium testcase class and a helper which
instantiates a webdriver for a given browser.

Add a sample Selenium test case which can be used as a template
for creating new tests.

(Bitbake rev: b7a377aa2ab36390d619e2a0436ccb4b8d186c23)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:58 +01:00
Richard Purdie 31681346a7 bitbake: bitbake: Don't limit traceback lengths to arbitrary values
There appears to have been a lot of copy and pasting of the code
which prints tracebacks upon failure and limits the stack trace to
5 entries. This obscures the real error and is very confusing to the user
it look me an age to work out why some tracebacks weren't useful.

This patch removes the limit, making tracebacks much more useful for
debugging.

[YOCTO #9230]

(Bitbake rev: 5549748a200b5df259fc7352477ec59471b87b2f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 23:01:38 +01:00
Dave Lerner b036afb537 bitbake: toaster: get all dependents for pkg for removal
For customised image package removal change behavior.
From:
    Only display the immediate dependents of the requested package
    to remove, not the full dependent list, that is dependents of
    dependents ...
    Do not remove the displayed dependents, just notify the user
    of the list.
To:
    Display the complete dependent tree, traversing all reverse
    dependencies starting from the package to be removed and then it's
    dependents.
    Change the modal dialog to note that all of these dependents will
    be removed automatically.

[YOCTO #9121]

(Bitbake rev: 1185a5bfe1b05a1b63a927c9583dfc031fdac8a9)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Dave Lerner 9bf98a9351 bitbake: toaster: new customise package-remove modal dlg
For customised image package removal, show a different modal dialog that
lists ALL of the packages dependent on this package, with a Remove All
button - implying that all of the dependents will be removed.

[YOCTO #9121]

(Bitbake rev: 768e6bb90c433687b0d52f256b7115499ca3418b)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Dave Lerner d5a419d628 bitbake: toaster: show full list of dependents to remove
When a package is to be removed, show the full list of packages that are
dependent on that package, telling user that these packages will also be
removed.

[YOCTO #9121]

(Bitbake rev: f5cb59b6b10a714b18b1c00b9a8598dd855c84b5)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Michael Wood 1d1aaa2f56 bitbake: toaster: orm generate CustomImageRecipe contents try secondary path
Try a secondary file path if the first does not exist. When we get the
recipe paths and layer information from the layer index it is not a
complete path but we are usually able to reconstruct it. If the complete
real path has been discovered by building then use this instead.

[YOCTO #9206]

(Bitbake rev: 238db2e03405d259d48dfc477a276191e6a47698)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-23 17:53:56 +00:00
Michael Wood 5c49230deb bitbake: toaster: localhostbecontroller put generated layer in the builddir
Move the generated layer for custom recipes into the build directory.
The build directory makes more sense as this layer/recipe is generated
for a particular build/project.

(Bitbake rev: 77f3728ee6ea379bffcf73f33c26e982cb0795f4)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-23 17:53:56 +00:00
Michael Wood b60c9943bf bitbake: toaster: localhostbecontroller Allow file:/// uri type for git repo
We don't need to skip file:/// uri type locations for git repositories.
If you're using a file:/// uri you should know that it has to be a local
path.

[YOCTO #9200]

igned-off-by: Michael Wood <michael.g.wood@intel.com>
(Bitbake rev: 4d0e5804103c2d98d038b3c490cac37a73f3cc47)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-23 17:53:55 +00:00
Michael Wood 3025092142 bitbake: toaster: orm Add a constant for the CustomImageRecipe's layer name
Use a constant to define the name for the toaster custom images layer;
this constant is then used to identify this layer in various places.

(Bitbake rev: 2540969ec71612af7f9041cadcc401513e9b357b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-23 17:53:55 +00:00
Michael Wood 3df6551d8c bitbake: toaster: localhostbecontroller Don't clear out toaster custom layer dir
We may have a recipe which is based on a custom image recipe that has
already been built so keep the recipe file around so that it can be read
by the generate recipe function.

(Bitbake rev: 502148fe498fe0a41ae89c9f649d3cb1253b0487)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-23 17:53:55 +00:00
Michael Wood 0f0105932c bitbake: toaster: models List only have the specified project's imported layers
When returning the compatible layers make sure that we are only
listing: All the layers which are for this release && configuration
layers (i.e. aren't part of the build history) and which aren't an
imported layer OR are this project's imported layer(s).

[YOCTO #8944]

(Bitbake rev: de8baedaccb451c12bc3f642449db3f64aed6bf7)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:47:29 +00:00
Elliot Smith 0dcab0258e bitbake: toaster: rework task buildstats storage and display
The data available from buildstats is now more fine grained than
previously, so take advantage of that to enrich the data we save
against tasks:

* Store the CPU usage for user and system separately, and display
them separately.
* Disk IO is now measured in bytes, not ms. Also store the
read/write bytes separately.
* Store started and ended times, as well as elapsed_time. This
will enable future features such as showing which tasks were
running at a particular point in the build.

There was also a problem with how we were looking up the Task
object, which meant that the buildstats were being added to
new tasks which weren't correctly associated with the build. Fix
how we look up the Task (only looking for tasks which match the
build, and the task and recipe names in the build stats data) so
the build stats are associated with the correct task.

[YOCTO #8842]

(Bitbake rev: efa6f915566b979bdbad233ae195b413cef1b8da)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:45:16 +00:00
Sujith H cc74a8ae26 bitbake: toaster: use force_bytes to display non-ascii project names
When user enters a non-ascii character in the project
name of toaster, the build doesn't get triggered.
Use force_bytes to fix this.

Also deal with non-ascii project names when logging the
build request in runbuilds.

[YOCTO #9071]

(Bitbake rev: b6141c4d170885d3bdf63074afcb1e41fde0a8f0)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:45:16 +00:00
Ed Bartosh a71d32ac53 bitbake: toaster: remove sshbecontroller module
The code of this module is broken for a long time.
The functionality of it can be easily achieved by running
'manage.py runbuilds.py' on remote machine.

[YOCTO #8806]

(Bitbake rev: 975081eefdd7041a6b4bef6842c1bac9799a1b44)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Ed Bartosh 3db71b4087 bitbake: toaster: don't use sshbecontroller
Removed usage of sshbecontroller from bbcontroller, models, tests
and database schema.

(Bitbake rev: 3ee06eb7e96de5dba539ad52201867e77d06a53e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Ed Bartosh 790b2d1387 bitbake: toaster: raise NotImplementedError
Raised NotImplementedError instead of Exception to be
able to catch it.

This is a preparation for removing sshbecontroller module.
It has to be done as code in bldcontrol/tests.py imports custom
NotImplementedException from sshbecontroller.

(Bitbake rev: c243ab6c83fe12d84777e4c3a18fd393827b9327)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Belen Barros Pena 96535ba720 bitbake: toaster: bring back the strict directive
This patch e0fd96442a removed the
"use strict" directive from the projectpage.js file by mistake.

This patch makes amends.

(Bitbake rev: b8044ce60af3f0b064cfba76c577503cc896e358)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Belen Barros Pena 5b8b3993e4 bitbake: toaster: change 'revision' to 'Git revision'
I've received some feedback on the 'Revision' label we use in the import
layer page. It is not quite communicating that what's required is a Git
revision. Changing it to 'Git revision' to make it a bit more specific.

The change applies not only to the import layer page, but to all pages
showing revision information in the project configuration section.

For more on the feedback received, check

https://bugzilla.yoctoproject.org/show_bug.cgi?id=8429#c3

(Bitbake rev: 09392f36a4f115c2432302125e8cac48a9aa304f)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Michael Wood 07ead9869a bitbake: toaster: views api Package info return both kinds of RDEPENDS
As we do with the popover snippet which shows dependencies inline in the
table also show dependencies which have both TYPE_TRDEPENDS and
TYPE_RDEPENDS.

Also remove obsolete comment

(Bitbake rev: d3b5f3b7ba4550e7cd03a37ca19ccd2fc0042b2d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Dave Lerner 9cda2ab8d5 bitbake: toaster: fixup dependency excludes for customimage
[YOCTO #9156]

For a customized image when adding a dependent package X that depends on
dependency package Y, in addition to adding X to appends_set and Y to
includes_set, make sure that Y is no longer in the excludes_set. Y may
have been added to the excludes_set by a prior package removal.

(Bitbake rev: 6b29d3297de2ae48a3ac5529ba0d22f895276b56)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Belen Barros Pena e0fd96442a bitbake: toaster: change 'delete layer' to 'remove layer'
I have received quite a few complaints about the use of the word
'delete' for layer removal, so change it to 'remove'. That also matches
the language we use for packages in image customisation.

[YOCTO #9165]

(Bitbake rev: 3c5ac2ddfb3f5ecd3f3218de0d6564e5f3842b98)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:38 +00:00
Belen Barros Pena 6e8282063f bitbake: toaster: rename 'run again' button
I quite dislike the 'Run again' label we use in the button that rebuilds
things. Changing it to 'Rebuild', which is shorter and more specific.

(Bitbake rev: 865a2015e86a1bc5cc7d63308f27c292d1ca98eb)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:36 +00:00
Dave Lerner c8dd72c797 bitbake: toaster: fix banner after customimage package add
Correct formatting of the banner message after adding a package to a
custom image.

[YOCTO #9101]

(Bitbake rev: da233005eb8cfa7842cd1a768c16e42aaaa55fad)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:35 +00:00
Belen Barros Pena 149f57470c bitbake: toaster: custom breadcrumb for the default project
The default "Command line builds" project does not have a Configuration
page. It therefore needs a custom breadcrumb where the project name goes
to the project builds page, instead of the project configuration page.

(Bitbake rev: 5545acf6703a25ee46776138bbbd804615add89c)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:33 +00:00
Dave Lerner bdb51abb3c bitbake: toaster: remove custom images from Image Recipes
Fix the view of 'Image Recipes' under 'Configuration' to only show
image recipes that are not customised since custom images have their
own page.

[YOCTO #9111]

(Bitbake rev: 18a93b360301a5497d5c8ef74ab71f374f2ad210)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:29 +00:00
Elliot Smith 98d462c8e6 bitbake: toaster: show suffix for image files and basename for artifact files
The build dashboard doesn't show image and artifact files correctly,
as it shows the full filename for images and the filename plus
path relative to DEPLOY_DIR for artifacts.

Instead, show just the suffix for image files, and the basename
for artifact files.

(Bitbake rev: 8084dcdc283b4dc170f066c202f89d56ce1abbef)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:28 +00:00
Belen Barros Pena 88b56603ce bitbake: toaster: add missing link to image recipe details
In the 'New custom image' page, each image recipe name listed should
link to the corresponding image recipe details page, so that users can
look into what packages are installed by a certain image, and decide
based on that if they want to customise it or not.

This patch adds that missing link.

(Bitbake rev: a481af693bfef0171732c18c298e285986b82de3)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:26 +00:00
Belen Barros Pena 25b179d5c3 bitbake: toaster: adjust the search field width
The search field at the top of our tables was using one of the Bootstrap
classes for text field sizing. Those classes are a bit rigid, resulting
in text fields too wide that made other table controls wrap.

Setting a maximum width to the search form using one of the span classes,
combined with a % width css declaration, make for text fields that
adapt a bit better to the horizontal space available in each table.

(Bitbake rev: 7833fab2e03f2d9a01ab9ad0a13c190382098b5e)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:24 +00:00
Belen Barros Pena a97081ba55 bitbake: toaster: make 'configuration' the first tab
Our project pages have 4 tabs: builds, configuration, import layer and
new custom image. Even though we treat the 'configuration' as the
default tab, it comes second after the builds tab.

That's a bit strange: the default tab should be the first one listed.
This patch changes the tab order to put 'configuration' first.

(Bitbake rev: ccb90019489c2c324c2a5a60295e02280a2ec18f)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:23 +00:00
Belen Barros Pena e1fc3190b7 bitbake: toaster: link to configuration in all breadcrumbs
The existing breadcrumb does not always provide a link to the project
configuration page. When you are in the build history pages, you must go
back to the builds information first, and from there access the project
configuration. That feels very long.

Change the breadcrumb so that the project name item always provides a
link to the project configuration.

(Bitbake rev: 9910f3f292d35fc91215d550c5f123dcf18ab35d)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:21 +00:00
Belen Barros Pena df2808f5f6 bitbake: toaster: reduce max height of modal dialogs
Now that we use modal dialogs to display dependency information for
packages, we are hitting their maximum height relatively often. It is set
by default to 400px, which makes it a bit tight at a 1280x800 viewport
size.

Reduce the maximum height to 300px to make things a bit more
comfortable.

(Bitbake rev: e36001d61768979d66cba0f3d4f5a2aaf4af2cb7)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:18 +00:00
Belen Barros Pena 6c51f0850f bitbake: toaster: disable add layer button on click
The 'add layer' button in the project configuration page remains enabled
after you add a layer. If you click it again, the same layer you just
added is added again.

This patch disables the 'add layer' button on click, to avoid this bit
of weirdness.

[YOCTO #8905]

(Bitbake rev: 63705f60035884a810fdd36e5a3fe10e411f23c7)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:16 +00:00
Belen Barros Pena d4a663a701 bitbake: toaster: apply error class to name field
The form for naming new custom images shows you an error message when
the name already exists or you include an invalid character in it. But
when an error appears, the input field was missing the red highlight.

This patch applies the right class to the form controls whenever an
error message is shown.

(Bitbake rev: df342e7662179410467c47cd870180ea75f863d4)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:15 +00:00
Belen Barros Pena 48f0ae2c12 bitbake: toaster: fix custom image name form
The placeholder text in the form where you name your new custom images
didn't display fully. This patch fixes the styles so that the text shows
properly. It also changes the text itself to make it a bit shorter.

[YOCTO #9122]

(Bitbake rev: 9df802182b0b96295b148a1681c2265e72d8306b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:12 +00:00
Belen Barros Pena 07eb4f274c bitbake: toaster: comment out project release change
Although the support for building more than one release and how we
handle the build directories is the subject of lively discussion, we all
seem to agree on removing the ability to change the release of a
project. The feature is currently not working but exposed to users,
which is not a happy state of affairs.

This patch comments out the controls that give access to the release
changing functionality to hide them from users, but does not touch
anything else. Once all moving pieces start to settle down, we can make
a final decision regarding this feature, and clean up the code
accordingly.

[YOCTO #8917]

(Bitbake rev: 3a8c6f7155517cd61a160595b81e7bed84ba4eaf)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:11 +00:00
Michael Wood 8c0ba8d9af bitbake: toaster: toastergui Fix invalid char test and implementation
This test was passing but because the assertion was the wrong way round
and should have expected the first one to pass and second one to fail,
in reality both were failing as the method for checking the invalid char
was incorrect.

(Bitbake rev: 932a92b8130d4815656dc885f0c6e4afa4502022)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:49 +00:00
Michael Wood 913e9b1cbc bitbake: toaster: PackagesTable show only installed packages
When showing the package list for the image recipe details only show the
packages which are installed in the image rather than all the packages
which are produced.

[YOCTO #9108]

(Bitbake rev: be7dca6c7607c0d13151c2d3f7ad7adcdf365076)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:48 +00:00
Michael Wood 94bca58067 bitbake: toaster: toastergui unit tests convert to use fixtures
Instead of having to manually write up in the setUp function all the
different objects to create in the database, just specifiy them in a
fixture and load it. This has the advantage that it can be used on a
live server by using the ./manage.py loaddata command and can then
be inspected.

(Bitbake rev: 8a653ad8b075892d24d15696b3070c5a28a4fbe2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:48 +00:00
Michael Wood 8796ac8a55 bitbake: toaster: SoftwareRecipesTable apply default order_by
Make sure the default orderby for the SoftwareRecipesTable is applied

(Bitbake rev: 1688608b537d8de840c6d1e4802ae41ca872e5bf)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:48 +00:00
Michael Wood 8469e58025 bitbake: toaster: orm migrations Sort out migrations mess
We messed up the migrations by squashing some of the image
customisation model definitions into the initial migration which
has meant some irreversible operations on mysql took place.
This deletes, re-orders and fixes the migrations.

If your schema is up to date you may want to use ./manage migrate
with --fake or --fake-initial to avoid re-applying migrations.

[YOCTO #9116]

(Bitbake rev: 19bd63fc3a28dcbd0f531a5b06a037da34568bac)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:48 +00:00
Elliot Smith 1f7f077466 bitbake: buildinfohelper: unset brbe variable when build finishes
The brbe variable is set on the bitbake server when the Toaster
UI starts. This enables Toaster to associate events with the
correct build and build environment.

However, the brbe variable is also used when a build starts to
identify whether a new build needs to be created, or an existing
one looked up. This causes a bug for command-line builds which
happen after a Toaster-triggered build: because the brbe variable
is never unset on the server or the buildinfohelper, the new
command-line build events are treated as originating from the
previous build.

Ensure the brbe variable is reset when the buildinfohelper "closes"
a build, so that each build then either sets the brbe variable
(Toaster-triggered builds) or leaves it blank (command-line builds).

Also modify the localhostbecontroller so that the brbe variable
is not set on the server and not looked up from the server. This
ensures that it is only set when the triggerBuild() method is
called, and that it remains as None for command-line builds.

[YOCTO #9021]

(Bitbake rev: 4a6a8d0074f62208d843b06344be31ae73d9b745)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 22:34:19 +00:00
Mihail Stanciu 19045bab71 toaster: tests Remove symlinks from toasteruitest folder
Remove symlinks in the UI tests folder as they are causing
problems for bitbake upstream.

[YOCTO #8787]

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 17:07:39 +00:00
Michael Wood e0eb2ea488 bitbake: toaster: models Remove manual transaction control from lsupdates
Revert "toaster: models.py do not use transactions".
This reverts commit e248a503ba
(Bitbake rev: 48d0d510816346073f135bb86fb7904fdb50bb27)

Manually managing the database transactions caused more
problems than it temporarily solved so we return control back to
Django's orm.

[YOCTO #8796]

(Bitbake rev: 25c531915b6f8f79a0822996ceb97f90483e359f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:33:40 +00:00
Belen Barros Pena 48622e1d6b bitbake: toaster: build section Improve display of builds when > 1 targets
* Display always the first target in alphabetical order to match what we
do in the breadcrumbs and the build dashboard heading

* Remove the extra space between the '+' and the additional number of
targets

* Make sure the tooltip with the full target list takes the Bootstrap
tooltip styles

* Replace the word 'targets' in the tooltip with 'recipes', since that's
how we call build targets everywhere else in Toaster

(Bitbake rev: 3b8747d0af4b9164e973940ed97751c951e74110)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:33:40 +00:00
Belen Barros Pena 4d0ba0fca8 bitbake: toaster: templates make build data breadcrumb consistent
The pages in the build data section of Toaster showed different
breadcrumbs: in some pages the machine was displayed, but not in others.
For builds with more than one target, some pages showed the first
alphabetical target (the correct behaviour), others didn't.

This patch removes the inconsistencies, showing exactly the same
breacrumb across all pages in the section.

The patch also removes the extra space between the '+' and the number of
targets when the builds have more than one target.

Remove an unneeded debug message

(Bitbake rev: 9cdbb543311b6f4a8a88c27fc157d998242444ee)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:33:40 +00:00
Michael Wood 30c132bc47 bitbake: toaster: Enable Image Customisation feature
Remove environment variable to toggle Image customisation feature

(Bitbake rev: 2e9c86229b8f924a5b62987f4b166f63392f12e8)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:22 +00:00
Michael Wood 5e14a8f2fe bitbake: toaster: xhr_customrecipe_packages Add dependencies to included packages
Add the dependencies of packages which are added to the
CustomImageRecipe. Currently just handle the first tier of dependencies
as this is what we show in the UI.

(Bitbake rev: 5c44609a9bf9fb23241b7dd7c58b08901d75008d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:22 +00:00
Michael Wood 749f5a6f1f bitbake: toaster: orm generate_recipe_content only exclude locale packages
Allow package groups in our custom image recipe. Excluding them creates
more undefined behaviour than including them at this stage. Also update
to use convenience method for returning all packages.

(Bitbake rev: 8c2e8a13badacb816c4b1178b6661600008b38af)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:22 +00:00
Michael Wood 626941104f bitbake: toaster: customrecipe page Add last successful build link and conditionals
Add link to the last successful build if there is one and add
conditionals for the ancillary recipe metadata.

(Bitbake rev: 4660aaf1c6775270f8f3d0afbb7fa2ee7a2a1563)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:22 +00:00
Michael Wood 8d5b61e495 bitbake: toaster: models Add update_package_list for CustomImageRecipe
Add a method to update the packages included list from the last
build, this effectively "synchronises" the package list from what
we think will happen at the Customise image stage with what
actually was produced with a build. It's not ideal to have this
function here but we also need to make sure that no race condition
of the user accessing this list and it being updated occurs.

(Bitbake rev: 8cf6e67a955574b33856a082bdadf3194f2b6ba4)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:22 +00:00
Michael Wood 86db0bd7f2 bitbake: toaster: orm Add last_updated field to CustomImageRecipe
Field to keep track of when the package list for the CustomImageRecipe
was last updated from a build.

(Bitbake rev: 4bd4e49f13a7625997a43f3b2e67ed42c3c8e08b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood 18d8b17052 bitbake: toaster: models add get_last_successful_built_target method
Add a convenience method to get the last successful build
target for a CustomImageRecipe.

(Bitbake rev: 4dde3d830cd38bbe306d83629dcb80da5fc9b027)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood 8885b7bfd3 bitbake: toaster: pkg_dependencies_popover just show direct dependencies
In the dependencies popover just show direct dependency in the list
rather than recommends, conflicts etc

(Bitbake rev: e69b00532b011327bc2495a6fb52cfe98f0f897d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood 40f6effec4 bitbake: toaster: models add all_depends method for Package_DependencyManager
This convenience method returns just the Package_Dependency for
the package which are regular dependencies i.e. not RECOMMENDS or
any other types.
(Bitbake rev: bd76c22fe2aa06690b4ee25de69219ac0bf6b4d6)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood 0fee829932 bitbake: toaster: newcustomimage_modal add frontend name validation
Add front end handling of validation response from create new
CustomImageRecipe api.

(Bitbake rev: eff66b502df8e001cd0abc25bcbd742687169619)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood cb6d290d0b bitbake: toaster: API CustomImageRecipe check the recipe name supplied is valid
Check that the name for a new CustomImageRecipe doesn't already exist in
the project or in the database of existing recipes (e.g. from the layer
index). Also restrict the characters entered for the recipe naming
convention.

(Bitbake rev: f290d428460a07e73050ff613bc222cc8c04f5ec)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood 5634a251ce bitbake: toaster: views CustomRecipe API add size information to the package lists
Add the file size of the packages and the total to the JSON response.

(Bitbake rev: bbbd304c49b0940a695d15273934edff95d70836)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood 6fbceb0f12 bitbake: toaster: models Invalidate ToasterTables cache when a m2m field changes
Whem a m2m field changes we need to clear the ToasterTables cache as
this can affect the state of items in ToasterTables.
For example the CustomImagePackages being added or removed from a custom
image recipe.

(Bitbake rev: c9d7b68ee0186a71e8e75a5d87122a0328001515)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood 998f9af193 bitbake: toaster: customrecipe Add dependency tracking to package selection
Update the states of the packages in the package selection UI to reflect
whether it's likely that 1st level dependencies for the package will be
also added.

(Bitbake rev: 119569d83c3fb1d1bd162624819b3f9c63a791c4)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:21 +00:00
Michael Wood 9976e4f169 bitbake: toaster: tables move template logic into the pkg_add_rm_btn
Instead of defining this as a string it's sufficiently large enough to
warrant its own file.

(Bitbake rev: 6b39423fe5a3ed30289a8b303329a5725f7d273b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Michael Wood d77c247230 bitbake: toaster: CustomImageRecipe generate overwrite IMAGE_FEATURES
If we're breaking up an image recipe's packages we will also need to
override IMAGE_FEATURES to make sure the customisation is not altered

(Bitbake rev: 9fd7b05dc0cf9240f7c8e3dc77b009064fd2b0cb)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Elliot Smith 481dc11547 bitbake: toaster: make locale packages uneditable in custom image page
When the packages associated with a custom image recipe are
shown in the customrecipe editing page, locale packages are
shown in the same way as all other packages. This gives the false
impression that these packages can be removed, when in fact
they are automatically added due to the IMAGE_LINGUAS build
variable.

Modify the customrecipe page so that locale packages cannot be
removed, and provide some help text explaining why.

[YOCTO #8927]

(Bitbake rev: b2208e53c00a67a7d0345e7378e6806b8ae40fb4)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Elliot Smith a757d397db bitbake: toaster: include locale and packagegroup packages in custom image
The custom image editing page doesn't show locale and packagegroup
packages: they are filtered out of the queryset used to populate
the ToasterTable.

Rather than filtering these packages out, include them in the list
of packages which are shown.

(Bitbake rev: 38a753e7b2e9ede326856b830b25e13bdd6d0d9b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Elliot Smith baac4589ae bitbake: toaster: update custom image package table filters
The custom image package selection filters were using the old
ToasterTable filter approach, which caused the table filter to fail.

Amend the table to use the new ToasterTable filtering API to fix
this.

(Bitbake rev: 72a4cb30842fd053e46dc56df222729cbe735162)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Elliot Smith efbffe3c29 bitbake: toaster: move recent builds query to model
The progress updater for the recent builds section makes a JSON
call to the project view URL to get progress for each build.
However, conversion of the builds pages to ToasterTable broke this,
as the JSON response no longer contained the data necessary to
populate the progress bars.

Move the recent builds query to the Build model, so that it is
accessible to the ToasterTables using it ("project builds" and
"all builds"), as well as to the "project" view.

Modify the code in the recent builds template to use the slightly
different objects returned by the recent builds query on Build.

(Bitbake rev: 5189252635ddc7b90c9a43aaed9f196c31e1dcad)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Elliot Smith b51478582f bitbake: toaster: update customimagerecipe migration
When applying migrations, Django shows this warning:

"Your models have changes that are not yet reflected in a migration,
and so won't be applied."

This is because the customimagerecipe model has changed, but those
changes are not covered by a migration.

Add the missing migration to clear this warning.

(Bitbake rev: df8185fcbd84061976d91b03b2a9268b319a6184)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Elliot Smith df58f5b70b bitbake: toaster: add merge migration to resolve conflict
Django detects a conflict between a migration added to support
image customisation and another migration which supports PROVIDES.

Add a merge migration to resolve the conflict (as suggested by
Django).

(Bitbake rev: a26bfd9d2490dc0fd90bf6d1690e63ac26001559)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Michael Wood 38f4913270 bitbake: toaster: orm generate_recipe_file_contents Handler for require recipe
Add a special case for when the recipe we have based a custom image
recipe on requires another recipe.
In this case we need to adjust the file location to be able to
require
the recipe when we're in the toaster-custom-images layer.

For example:
"require core-image-minimal.bb" is changed to:
"require recipes-core/images/core-image-minimal.bb"

(Bitbake rev: 26025e1ea49b3ebfcfd508d1608fa8c9e722ad03)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Michael Wood 769017e477 bitbake: toaster: project builds Poll the server to get latest progress for build
Poll the server for the project build progress value. This is something
that will need to be re-done once we have a proper API for this on the
server side.

[YOCTO 8328]

(Bitbake rev: ec467e43c39eadf02412b89db10c09ed78a5a9f5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:20 +00:00
Michael Wood 971d65c614 bitbake: toaster: localhostbectrl Update the dirpath of customrecipe's base layer
We need to know the location of the based_on recipe's layer on the
file system before we try and generate the custom image recipe. As
we read the recipe to make the custom version.

(Bitbake rev: e6a7cacbddd1df5bac0b79384199cf7264c5bbd5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood 6d9f342e12 bitbake: toaster: tables Check layer presence in project for customise_btn
Make sure we send the current list of layers to the customise button to
be able to know whether it should be set as an add layer button or a
customise button on the New custom image page.

(Bitbake rev: 5ddb35c98b609d85f97d482b54cabe3a2812afe6)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood 76c0008014 bitbake: toaster: toastergui tests Add addtional data to the setUp for new tables
Add additional data to the setUp to be able to test all the tables for
Image Customisation. Also add the name of the table being tested to the
num of rows assertion.

(Bitbake rev: dfcbcf789cf3f0733ca26b0601fdf97ce4291674)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood 70a078ee85 bitbake: toaster: tables SelectPackagesTable rename recipe_id to custrecipeid
Rename the recipe_id to custrecipeid to avoid confusion about which type
of object we're going to be accessing. This means that in the unit tests
for tables we can pass a different kwargs for custom recipes vs normal
recipes.

(Bitbake rev: ae3301a1047b3efb4b340b50a10d5d585b7333da)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood 7e4c231ca2 bitbake: toaster: toastergui tests Update package test to use CustomImagePackage
Update test for adding and removing a package from a CustomImageRecipe
so that it uses the CustomImagePackage and correct fields for the packages
included. Change the test for error condition to use an invalid package
id as ManyToMany remove() on package that isn't in the relationship does
not throw an error.

(Bitbake rev: daccb2978f833a9e7af270160331da3e9a158219)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood 4b3c9d61dc bitbake: toaster: customrecipe Add further front end features using new API
This adds some basic package dependency hint modals when you add and
remove a package. It also makes sure that if the CustomImageRecipe has
no current included packages that we go and check this with the server
to see if a relevant build has taken place which will provide this
information.

[YOCTO #8082]

(Bitbake rev: 418f5509e74d46d36a8eb966a245083006e5f4ba)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood b213907afe bitbake: toaster: xhr_customrecipe_packages add GET info for package response
Add response for GET to the xhr_customrecipe_packages ReST API

/xhr_customrecipe/<recipe_id>/packages/<package_id>
Thie response includes the id, name, version and dependency information
for the package.

(Bitbake rev: c45791fc85d26c43b0a3b0a459111d2ff5583540)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood a9668eeb74 bitbake: toaster: xhr_customrecipe_id change to use CustomImagePackage
Instead of doing a shallow copy of the package into the
CustomImageRecipe when we add packages we can now use the
CustomImagePackage as a M2M field on the Package to CustomImageRecipe.
Also switch to using Target_Installed_Package as the method to retrieve
the package list from the build.

(Bitbake rev: 4ebc81823b3aec6ecf38835acad5263a81eb41c5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood 439314c1b2 bitbake: toaster: API allow CustomImageRecipe to be updated after creation
When we create a CustomImageRecipe we create a Layer_Version and
Recipe for that Recipe to be in, we only need one Layer_Version for our
Recipes so if that Layer_Version is updated by building it we need
a slightly more custom version of get_or_create to take into account the
fields which we expect can change but still mean that the object we want is
valid and doesn't need to be created.

In the Recipe case this is when we're updating an existing
CustomImageRecipe as we allow people to create a recipe even when the
based on recipe hasn't been built so we need to update it once a build
has happened.

(Bitbake rev: 0fe2c72ab82c6de2825a390fbb460b892a7a9cfc)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:19 +00:00
Michael Wood 9ea4de6d80 bitbake: toaster: tables Change SelectPackagesTable to use ProjectPackage
This changes the SelectPackagesTable to use the ProjectPackage table
instead of very large expensive queries to retrieve a list of currently
available packages for the project.

(Bitbake rev: 4b4b7e28d602ac5283659f806d695cc0451d292e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood 20f400b7bd bitbake: toaster: tables add recipe download link to CustomImagesTable
Add the download recipe link and fix the package count field.

(Bitbake rev: 85891e5320014f363dba093ac2db681d55375ee3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood 1c9ce1ca73 bitbake: toaster: newcustomimage_modal use libtoaster method for new CustomRecipe
Use libtoaster.createCustomRecipe rather than own implementation of this
function.

(Bitbake rev: 74fa98752b1cf1ad18d35ab6dd25fe7e409133c5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood 8b1d0438bc bitbake: toaster: libtoaster Add createCustomRecipe method
This adds the function to call the ReSt API to create a custom image
recipe.

(Bitbake rev: 03e7949f538733f682a05d0c318cf2f4cd64cbf5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood 32048fa71f bitbake: toaster: orm Add convenience method to get all pkgs in a CustomImageRecipe
Returns a queryset of the all the packages that we expect to have in a
CustomImageRecipe.

(Bitbake rev: 8b03bbae12ec077151c97579e329d89667040a78)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood c80b7dfee2 bitbake: toaster: orm get_project_layer_versions to return layer_version objects
Instead of returning layercommits return the actual Layer_Version objects
for the layercommit as these are the useful objects which contain the
metadata.

(Bitbake rev: 480f0d307a3183df16fd383c7a3f96f00d09fbd4)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood 796e3481ad bitbake: toaster: toastergui tests Add unit test for download custom recipe
Add unit test to test downloading end point and the basic content of the
custom recipe that is generated.

(Bitbake rev: 1e78d1ca2f5b02d80ab037c6f5f81d18195fc817)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood 04d8c94564 bitbake: toaster: toastergui tests Update to reflect changes to CustomImageRecipe
Now that CustomImageRecipe inherits from Recipe make sure that the
accessors and the required values for Recipe are now setup correctly.

(Bitbake rev: e958921e15a3c3e5a6b7c27ebe37fdf1f551f198)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood 4e8a0aa66e bitbake: toaster: views xhr_customrecipe_packages clean up API
- Fix generic variable names such as "object" and "values" when not
  needed.
- Use try catch instead of a queryset filter to return the custom recipe
  object
- Be explicit about the fields returned for the custom recipe info field
- Remove redundant new_package field

(Bitbake rev: a1a69903a94264377666730b1eb4599e6f3b4398)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood 66b5608ffe bitbake: toaster: toastertable remove title from Show all in table
Title is often very long so this is not a great property to use here.

(Bitbake rev: 541ff2b5e9c6ebec0d0ced59b3f61cbd37bd37c2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:18 +00:00
Michael Wood ce7289613b bitbake: toaster: Add recipe details page
This page provides the details of recipes, showing their packages and
additional metadata. It also allows you to build the recipe or customise
the recipe if it is an image recipe.

[YOCTO #8070]

(Bitbake rev: b6023619397f679791b7eff1faac06f4246133ce)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood 5f52614a87 bitbake: toaster: newcustomimage Move modal dialog out of newcustomimage template
Move the modal template and JS out of the newcustomimage page so that it
can also be used by the image details page.

(Bitbake rev: c310bc6bab1a33124906dd57b3c63462a773ff25)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood 2a3dd32d66 bitbake: toaster: Continue front end features to custom image recipe page.
Continuation of the work on the custom image recipe page, this brings
in:

- Basic notification of having added/removed a package.
- Connect up Build button
- Download recipe feature
- No packages states
- Project bread crumb
- Display additional recipe metadata
- Update accessors for recipe object inheritance changes

[YOCTO #8082]

(Bitbake rev: a656756a9255ec5882686ce9563d17f2eb3136e3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood d6e7e4ad43 bitbake: toaster: tables Add table for Packages and update SelectPackagesTable
Create a Packages table for use as the image details page.
Change the SelectPackagesTable table to inherit from the Packages table.
Remove the need for a separate view by adding the additional template
context items to the Table's page context.

(Bitbake rev: 336b1d8369d9e86ece78b63cb0e140e653216011)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood 43f0a05fa4 bitbake: toaster: views Add view to download custom recipe
View to provide the custom recipe download feature. The recipe is
generated on-demand to make sure that it is the most current version of
the Custom recipe.

(Bitbake rev: 2101c854bb2d7ff1e3a4f00ad4d33d77859439ed)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood 2cf55afb97 bitbake: toaster: move CustomImageRecipe generation to API entry point
Use the CustomImageRecipe generate_recipe_file_contents to generate the
recipe that we build from. Move creation of the dummy layer and recipe
object to the point of recipe creation as we need these objects before
the build time. Also update the methods to add and remove packages to
account for the CustomImageRecipe inheriting from Recipe.

(Bitbake rev: f3322567378d6038a00da0fab6c5641a1a8e5409)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood c402ac2654 bitbake: toaster: orm add CustomImageRecipe generate contents function
Add function generate_recipe_file_contents to dump the custom image
recipe instance to a string for use either to push to the user as a
downloaded version of their custom image recipe or to use to generate
the recipe that we build.

(Bitbake rev: 6863343c3434ce19aa4b609c83f48a06e6943366)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood e1bfe1ceb6 bitbake: toaster: orm: Add db migration for new CustomImagePackage table
(Bitbake rev: c7da71fe8509439656f482c16ed081cf442f4030)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood f760a78e3c bitbake: toaster: orm Add CustomImagePackage table
This table is used to track all the available packages in the current
toaster. Many of these packages belong to many CustomImageRecipes.

(Bitbake rev: c1bd4f760cd35535e44f488250e0a56b99cad680)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:17 +00:00
Michael Wood 4117af29c6 bitbake: toaster: orm: Add db migration for new CustomImageRecipe inheritance change
(Bitbake rev: 2831d74201abba68c301d85ee583d706a51d5a5f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:16 +00:00
Michael Wood 1f102890d6 bitbake: toaster: orm make CustomImageRecipe inherit from Recipe
This allows us to re-use the properties of a recipe for the custom image
recipes as well as re-using the existing templates and logic that deals
with recipe objects.

(Bitbake rev: bb8120b56be7eee6ed2e4434d8477282a01e0c00)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:16 +00:00
Michael Wood 648753b30d bitbake: toaster: orm Add sum of dependencies size function to PackageDependencyManager
Add function that returns the Sum of the size of all the packages which depend on a package.
Access get_total_source_deps_size via a packages's dependency
manager.

(Bitbake rev: e4c86d2f6c2e86ad054b37d0a5bf7464a4de4f9a)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:16 +00:00
Michael Wood a92fc3025b bitbake: toaster: tablejs Add an event handler to manually trigger a data reload
Allow users of ToasterTable to manually trigger a refresh of the data.
This can be useful if an action has happened in-page and the data is now
invalid. Such as new data being added or removed from the model.

(Bitbake rev: 6e42070d8abc80dacd8094c4f5019577453a9d49)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:16 +00:00
Michael Wood 4c82878225 bitbake: toaster: ToasterTables simplify filter function move common part to widget
Move part of the functionality of the filter functions to the Table
widget. We don't need to implement it in each subclass.

(Bitbake rev: 16e48829f6fd96c1d21339253871f2a9b2446f87)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:16 +00:00
Michael Wood 3e1e8e6a99 bitbake: toaster: models fall back to a sensible string for no vcs reference
Fall back to a 'n/a' string for the vcs reference, not all our source
has to be in a vcs and therefore it is legitimate for this to be none.

(Bitbake rev: 1739b509e9efc4b016fc73c2d4399f1f9d3d285f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:16 +00:00
Michael Wood 14d09c8b22 bitbake: toaster: localhostbecontroller CustomRecipe now base_recipe is Recipe
Update the reference to the base_recipe. It is now a Recipe object
rather than an intermediate AvailableRecipe object.
Therefore doesn't need an extra traverse down the object hierarchy.

(Bitbake rev: 8056ec65bd93005ecb7b0ed12dcb21b3b60df22c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:16 +00:00
Elliot Smith 6228cf8166 bitbake: toaster: reinstate ID on edit columns button
The ID was omitted from the "edit columns" button on the
"projects", "all builds" and "project builds" tables when they
were converted to ToasterTable. This caused the QA tests to fail.

Reinstate the ID so the tests can identify the "edit columns" button
correctly.

[YOCTO #9051]

(Bitbake rev: 934b82badcf063c8ff252d806c2fb019f7a2e55f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-06 23:13:47 +00:00
Daniel Istrate 72f98ba577 bitbake: toaster: Update UI test runner
Add new runner options:
    --run-all-tests: finds all tests, ignores config
    --run-suite <suite> (from cfg)

Without arguments, run tests from current os section (config), e.g.:
    1. ./run_toastertests
    2. ./run_toastertests --run-all-tests
    3. ./run_toastertests --run-suite darwin

Update toaster logging to meet QA CI requirements.

(Bitbake rev: 5685feb51fbb6d54fde6027cc765b9edd8eda65a)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-25 16:29:10 +00:00
Ed Bartosh f130033856 bitbake: toaster: write variables to toaster.conf
With the resent change in rootfs creation code setVariable
rpc calls don't set variables for bitbake workers anymore.

Writen variables to toaster.conf should solve this issue.

[YOCTO #8910]

(Bitbake rev: d6dfe40320ff6ca420d9f9016b4d1d83d10f1d59)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:38:51 +00:00
Elliot Smith f98e11c809 bitbake: toastergui: make artifact download more robust
When an artifact download is requested, Toaster goes through a
convoluted series of conditions to decide which file to push
to the response. In the case of build artifact downloads for
command line builds, this caused an ugly exception, as command
line builds don't have a build request.

To simplify and catch more corner cases, remove the code which
fetches files via the build environment (we only support the local
build environment anyway). Then push all requests along a single
path, catching any missing file errors, missing object errors
or poorly-formed URLs in a single except clause which always returns
a valid response.

Also modify the text on the "unavailable artifact" page so it
says that the artifact doesn't exist, rather than it "no longer"
exists (exceptions may occur because an invalid artifact was
requested, rather than an artifact which was removed).

[YOCTO #7603]

(Bitbake rev: 24e20db55c2933de5e58ca754b8fd5b624f47820)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-18 22:06:46 +00:00
Elliot Smith 798e8b8d03 bitbake: toastergui: code formatting and clean-up
Minor fixes to code formatting and small improvements from
code review.

(Bitbake rev: 2c97f3a5c6ae37de910deb90390c5b856a600c5f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:01 +00:00
Elliot Smith c4b50111e9 bitbake: toaster tests: fix Django tests for new ToasterTable pages
The Django command-line tests can no longer test the content
of the projects/, builds/ and projectbuilds/ pages, as
ToasterTable pages are populated by JavaScript.

Fix/remove affected tests by converting them to tests on the
JSON returned by the ToasterTable.

[YOCTO #8738]

(Bitbake rev: 85efa9530fa6181855e051bfd14de1c15db9c3b7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:01 +00:00
Elliot Smith 88a262cbd2 bitbake: toastergui: remove unused views and template code
The code in views.py for setting up the template context for
old non-ToasterTable views is no longer necessary, as this
is now implemented in tables.py.

The template files for these views have also been removed.

[YOCTO #8738]

(Bitbake rev: 2b5a13afb068c85466436914d8d4ac3b31bc5c02)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:01 +00:00
Elliot Smith 059a274aa9 bitbake: toastergui: fix error and warning counts for builds
The error and warning counts displayed for builds were counts of
the errors and warnings objects associated with a build. Because these
values were being derived on the fly, it was not possible to sort by
them.

Previously, the 3rd party django-aggregate-if library was used to
add aggregate fields to Build objects and should then have been
used to populate the "all builds" and "project builds" tables. However,
at some point the templates had changed so that the error and warning
counts were coming from the properties on the Build model and not from
these aggregates. This meant that it was not possible to sort by these
fields.

Django 1.8 supports conditional aggregates in annotation fields on
querysets. This means we can remove django-aggregate-if, use the new Django
1.8 feature to derive errors_no and warnings_no fields as annotations,
then use those annotation fields in the templates. This makes the "builds"
tables sortable again.

[YOCTO #8738]

(Bitbake rev: 9be7c5c18b325f6ed40bc431ac408db242007eb1)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:01 +00:00
Elliot Smith 4103e0cb74 bitbake: toastergui: make "Apply" button state depend on filter range
If a range filter action had an empty from/to field, the range
filter could still be applied. This was confusing, as an invalid
filter range caused all records to display, even though a filter
appeared to have been applied (by the highlighted state of
the filter button).

Change the state of the "Apply" button, disabling it if the radio
button for a range filter action is selected but the range is
incomplete (from or to field is empty).

When a non-range filter is selected, the "Apply" button always
enable the "Apply" button.

[YOCTO #8738]

(Bitbake rev: 168184b28165d7aa354b9092b5986f91c58d550d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 6c2d88fda5 bitbake: toastergui: mute label for filter actions with no records
The radio button for a filter action is disabled if that filter
action has no associated records. However, the label retains
the normal font styling, so it's unclear that the action is
not available.

Add the "muted" class to the label for a filter action (and still
disable its radio button) if it has no records associated with it.

[YOCTO #8738]

(Bitbake rev: b7f7ff095c9c4c922e608f776713f17acc1f150d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith f08730ab4d bitbake: toastergui: set default visible and hideable columns
Incorrect columns were shown by default in the "all builds",
"project builds" and "all projects" pages.

Set the "hidden" property on columns in these tables to hide the
correct columns.

Add a set_column_hidden() method to ToasterTable so that the
"hidden" property can be overridden for the machines column
in the project builds page (it shares a superclass with
all builds).

Make the time column on all builds page hideable.

[YOCTO #8738]

(Bitbake rev: be3982c71703eaa51e7f3352e0cb5b3af11c9ead)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 112f3746cd bitbake: toastergui: serialise decimals correctly
The conversion of some ToasterTable Build object querysets to
JSON caused a serialisation error. This is because one of the
fields in the queryset was of type decimal.Decimal, and our
serialiser didn't know what to do with it.

Add a clause to check for decimal fields and serialise them
so that correct JSON can be generated.

(Bitbake rev: fa6229d4edf5904ccaa9dc323d0ab2318d1ef314)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith e024aab39c bitbake: toastergui: streamline construction of filter objects
In line with comments from review, remove the QuerysetFilter
class (redundant) and convert ProjectFilters into a class
with static methods.

[YOCTO #8738]

(Bitbake rev: 59379bf6467029223045c5ebef868729d8e02c86)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith fcb20f9dfd bitbake: toastergui: ensure filter_value updates
Clicking on the radio button for a date range filter action
populates the from and to fields for that action if they are empty.

However, because this doesn't fire "change" events, clicking on
the radio button doesn't update the filter_value hidden field. This
means that the date range action's filter_value parameter isn't
set correctly when the filter popup is submitted.

Manually call the changeHandler() to set the filter_value whenever
the radio for a date range filter is clicked.

[YOCTO #8738]

(Bitbake rev: 1a3038cf8d9b32532f1fe92cd3472b4473ffc0c4)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith f9c46f5e5e bitbake: toastergui: don't hide all elements with .col class
Disabling the "project" column in a ToasterTable for builds
causes the recent builds area to be hidden. This is because
the column hiding code hides all elements with a class matching
".<column>", regardless of where they occur on the page; and
the recent builds area was using the ".project-name" class,
which means it is included in the set of elements which are hidden.

Scope the element search to the table so that only elements
within the table are hidden or shown.

[YOCTO #8792]

(Bitbake rev: 151bc20daf51e0ab8baf11ea29244b7fec1f8a22)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith eaae82a19a bitbake: toastergui: convert project builds page to ToasterTable
Use the all builds ToasterTable as the basis for the project builds
ToasterTable.

[YOCTO #8738]

(Bitbake rev: 87bcfb740dd2d9944e35a2a1f71cbf8ff3b266e9)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 33b011c158 bitbake: toastergui: implement "today" and "yesterday" filters
Add the "today" and "yesterday" filters to the started_on
and completed_on columns in the builds table.

During this work, some minor adjustments were made to the
behaviour of the builds table:

* Amend filter action variable names so they're more succinct.
* Retain order in which actions are added to a filter, as this
ordering is used in the UI when displaying the filter actions.
* Always show the table chrome, otherwise it's not possible
to edit the columns shown until there are 10 or more results.
* Because date range searches may return no results, make sure
that the search bar and "show all results" link are visible
when the query returns no results.

[YOCTO #8738]

(Bitbake rev: f17cfa009e58833e0e55884fa04de8abd522b6bc)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith f8d383d87f bitbake: toastergui: implement date range filters for builds
Implement the completed_on and started_on filtering for
builds.

Also separate the name of a filter ("filter" in the querystring)
from its value ("filter_value" in the querystring). This enables
filtering to be defined in the querystring more intuitively,
and also makes it easier to add other types of filter (e.g.
by day).

[YOCTO #8738]

(Bitbake rev: d47c32e88c2d4a423f4d94d49759e557f425a539)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith b929889cdd bitbake: toastergui: show recent builds on all builds page
The recent builds section was disabled while converting the
all builds page to ToasterTable.

Re-enable the recent builds area and add the data it requires
to the ToasterTable context.

[YOCTO #8738]

(Bitbake rev: d6df4545bd134a23c9bd3cd1ba3b61ddb26545e4)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 1a4b203ca5 bitbake: toastergui: switch off filter highlights when inactive
In ToasterTables with multiple columns which allow filtering
(e.g. all builds), selecting one filter, then a second filter
(e.g. selecting "failed builds" then "outcome" for all builds),
would result in both filters being highlighted at the same time.

Fix this by removing the "active" highlight on all column filter
buttons when a new filter value is submitted (via the filter modal).

NB to enable this, added a data-filter-on attribute to all
column filter buttons to make them easy to select.

[YOCTO #8738]

(Bitbake rev: 7347ad0d4baace593751b44a86ab8e11a04a02b6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 809046c6fb bitbake: toastergui: refactor ToasterTable filtering
The filter code for ToasterTable was difficult to follow
and inflexible (not allowing different types of filter, for example).

Refactor to a set of filter classes to make the structure cleaner
and provide the flexibility needed for other filter types
(e.g. date range filter).

[YOCTO #8738]

(Bitbake rev: 94031bb30bdaf665d0c8c68b591fcb7a17b6674d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 294579b531 bitbake: toastergui: convert all builds page to ToasterTable
For better long-term maintainability, use ToasterTable instead
of Django template and view code to display the all builds page.

NB the builds.html template has been left in, as this will
otherwise cause conflicts when merging the new theme.

[YOCTO #8738]

(Bitbake rev: e0590fc8103afeb4c5e613a826057555c8193d59)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 6c12ca7f93 bitbake: toastergui: use event delegates for hover help elements
libtoaster.js binds to hover help elements via their hover() and
mouseout() methods. However, any elements added to the DOM after
libtoaster has initialised will not have these bindings added.
This causes a problem for ToasterTables which have hover-help
elements (e.g. the builds/ table).

Use the on() method instead. This uses event delegation to bind
a handler to any th or td elements already in the DOM, or
which will be added to the DOM in future. ToasterTables can
now reconstruct the table DOM and still have the correct handlers
attached once the table is done.

[YOCTO #8738]

(Bitbake rev: 1f3ff01fed0b4de8721191f108033ad044cdc26a)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith ef93dce7e1 bitbake: toastergui: switch projects/ view to ToasterTable
Remove the old projects page and replace with the new
ToasterTable-based version.

NB although the projects.html template is no longer required,
it's been left in as there will be changes applied to it for
the new theme. These changes will have to then be transferred
from the projects.html template to projects-toastertable.html.

Similarly, the code for the projects page in views.py has been
retained.

[YOCTO #8738]

(Bitbake rev: ebe7831ef65e78a9d100f29a63311518577fc838)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 417f1d3f53 bitbake: toaster: check inferred file suffixes against list of known types
The algorithm for finding the suffix for image files produced by
the build doesn't reference a list of known file suffixes, so
could be prone to error.

Modify how file suffixes are parsed from the file path so that
they are compared against a list of known types; if this fails,
use the part of the basename of the file path after the first
'.' character.

Also rationalise the places in the views code where we
extract the file name extensions for builds, so they both use
the same algorithm (before, the same code was duplicated in
two places).

[YOCTO #8417]

(Bitbake rev: dd1c509696b8ab5e593cc64637060a58e95fcd1f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith c02ee05857 bitbake: toaster: move image file suffix list to model
Image file suffixes are used in the project configuration page to
show a list of available image file types. This list is stored
as a function in the views code.

However, this list is also needed when parsing image file paths,
so that the suffixes can be shown in the "all builds" and "project
builds" tables.

Move the list of valid image file suffixes to the Target_Image_File
class to make is accessible in other places where it may be needed.

[YOCTO #8738]

(Bitbake rev: c2f20232077917552623fd0726d0820e50b04cae)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith d29e4cd040 bitbake: toastergui: use ToasterTable for projects page
The projects page uses the old approach for showing tables,
which means a template for each table. This means that applying
changes to ToasterTable (which is used for most tables) has
no effect on the layout, styling and behaviour for these older
tables, and requires additional duplicated effort.

Move the projects page to use ToasterTable instead, to remove
the duplication of effort.

[YOCTO #8738]

(Bitbake rev: df56a35bc71639457329c4b58839976c5ee40106)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Michael Wood 7b905caf60 bitbake: toaster: settings Add uid to the toaster cache dir
Make the default toaster cache dir unique to the user running
toaster. If we have multiple users running toaster we previously
got a permission denied exception on saving a cache file.

[YOCTO #8782]

(Bitbake rev: 5207abdf58019271bf92bff4bcce3911b8691508)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Ed Bartosh dff7a277e3 bitbake: toaster: show 'satisfied via' text for reverse deps
Showed '<dependency> satisfied via <provider>' text and
help tooltip for the reverse build dependencies provided
through 'PROVIDES' in the 'Reverse build dependencies' tab.

[YOCTO #6169]

(Bitbake rev: c7bb98e2e2111790ded86087b13c8b49462d6b75)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Ed Bartosh 89f493261a bitbake: toaster: show 'satisfied via' text for build deps
Showed '<dependency> satisfied via <provider>' text and
help tooltip for the build dependencies provided through
'PROVIDES' in the 'Build dependencies' tab.

[YOCTO #6169]

(Bitbake rev: de77e338fe70341fe98561e2e40b534f5c88db10)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Ed Bartosh febb898a06 bitbake: toaster: show list of provides for the recipe
Showed list of names that recipe provides.

(Bitbake rev: 60318c9a049292bd33322d8446a629d778337e8a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Ed Bartosh 16a81fb97a bitbake: toaster: add Provider model
Added new model Provider and a foreign key 'via' to link
Recipe_Dependency to it.

[YOCTO #6169]

(Bitbake rev: e45fff6314741d46e2549b2f72ed380cbbb95593)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Ed Bartosh 847b93596d bitbake: toaster: implement checksocket command
Implemented new management command to check if it's
possible to listen on specified address:port.

[YOCTO #8775]

(Bitbake rev: 0339b90842fd7c878c511b4b89ebcaee9a431bba)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 13:51:53 +00:00
Belen Barros Pena 03d715e541 bitbake: toaster: tables Set a default order for the software recipes table
Add default order by recipe name, so that the table content is sorted
when the page loads.

[YOCTO #8791]

(Bitbake rev: 36cc814b64bcf3825ed096ade0b8c590e497259f)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:16:13 +00:00
Ed Bartosh 4a78416943 bitbake: toaster: monkey patch Queryset
Fixed 'database is locked' issue by monkey patching django QuerySet
methods.

The actual patching places were found by bisecting Django codebase.

This commit should be removed after Django is fixed if it's fixed
at all.

(Bitbake rev: 175411bf05423b1892c7928c2b928843b39645f0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh 507aafbd7a bitbake: toaster: work around 'database is locked' error
When sqlite can not cope with a stream of 'insert' queries it throws
'database is locked' exception.

Wrapping model.save in transaction.atomic context and repeating the call
should solve this issue.

(Bitbake rev: eb305308ca8f6228c6f52dac1bd941f29c7e5eb6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh 322b4709d8 bitbake: toaster: fixed format strings
Printing id as a number breaks toaster if object is not saved
yet as id/pk is None in this case.

Changed format spec to print id as a string in __str__
and __unicode__ methods of Build, Task and LayerVersion models.

(Bitbake rev: d5ca2bae623db214764324da5c9e4dac6beef760)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh 84daa40bc7 bitbake: toaster: use OneToOneField instead of ForeignKey
Used OneToOneField to reference BuildRequest in BRBitbake model.

Fixed django warning:
WARNINGS: Setting unique=True on a ForeignKey has the same effect
          as using a OneToOneField.

(Bitbake rev: aaa4319ebbb06facb77b4ba936cf3aa2068ff238)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith c464f34d5b bitbake: toaster: Amend regex for MySQL database URLs
The database URL detection doesn't admit a MySQL URL without a port.

As this is a common case (e.g. you would set the HOST to a mysql.sock
path if pointing at a local MySQL server, with no port setting),
amend the regex so it will correctly recognise paths, as well
as HOST:PORT URLs.

(Bitbake rev: 89386aab888f806d5aa4a8083c06566e48d9445b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith f001a4ac3c bitbake: toaster: Remove compatible_layerversions() method
Remove compatible_layerversions() and replace calls to it with
calls to get_all_compatible_layer_versions().

The sorting done in compatible_layerversions() is not relevant,
and the code can be simplified by using get_all_compatible_layer_versions().

[YOCTO #8364]

(Bitbake rev: 7bca51277314f7c0b6ee0e0d470327dfd60d37fe)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith 717c636d71 bitbake: toaster: Prevent deprecation warnings for RedirectView
The API for RedirectView is due to change in Django 1.9, which
means that Toaster generates deprecation warnings.

Set the "permanent" flag when constructing RedirectView instances
to prevent this warning.

[YOCTO #8364]

(Bitbake rev: 4aa09488bfe65cb365356b320cd9865643bb4fe5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith 0f602c1a22 bitbake: toaster: Update API used to make runbuilds methods run in transactions
runbuilds previously had its methods decorated with
transaction.commit_on_success, which is now deprecated. transaction.atomic
is an (almost) drop-in replacement for this, so use this instead.

[YOCTO #8364]

(Bitbake rev: c4804b84eaaef6a81027bae5cf8bfe63d949c293)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh 93f573836c bitbake: toaster: rename get_query_set -> get_queryset
Renamed get_query_set to get_queryset as get_queryset causes
deprecation warning in Django 1.7 and is deprecated in Django 1.8

(Bitbake rev: ef8b399dccd413070e32ce05e013337ea01fa64d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Elliot Smith 7a0c45e478 bitbake: toaster: Create default project with get_or_create* method
Rather than maintain data as part of the migrations (as was
done for the default project previously), create the default
(cli builds) project on demand as a by-product of getting
it from the database.

[YOCTO #8364]

(Bitbake rev: 5fd8e90ab9b81d1bd0d301bc1c91228ecbbea74b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Ed Bartosh 535fc9b6fb bitbake: toaster: Remove South migrations
South has been deprecated in favour of Django's own migration framework,
so remove the old South migrations and replace them with Django ones.

[YOCTO #8364]

(Bitbake rev: 427d8bc02d1aa00a19057602d592d58334514804)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Elliot Smith 8ca46641ef bitbake: toaster: Upgrade to Django 1.8.6 and remove South
Upgrade Django to long-term support version.

Django now provides its own migration framework, so remove
requirement for South.

[YOCTO #8364]

(Bitbake rev: 648b62654c52116451c6a68a46d7264db3a34d09)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Ed Bartosh 0274b68450 bitbake: toaster: trigger SetBRBE event
Triggered MetadataEvent "SetBRBE" when TOASTER_BRBE variable
is set on bitbake server. This should make buildinfohelper
aware of the build request id, which is used to properly
report build status and failures back to Toaster.

(Bitbake rev: 8b136fb093020bc912a7b21d5163e1cd5fb12124)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Ed Bartosh fdb8e7433c bitbake: toaster: implement BitbakeController.triggerEvent
This API will be used to pass data from Toaster to
toaster_ui and buildinfohelper.

(Bitbake rev: 6dca6fd47c5e8d66687fb07177e98cd531cd971d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Ed Bartosh dd282d475c bitbake: toaster: return back 'New project' button
The button was removed by mistake in merging modes patchset.

(Bitbake rev: f7b33a95b5d53973bc673373bdd2652f4d32f0c2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:39:08 +00:00
Mihail Stanciu 2a8e970d42 bitbake: toaster: tests Update UI tests to work with 2.0 changes
Update tests that were referencing items removed in 2.0.

Update most xpath elements left to use IDs.

(Bitbake rev: c4dda67dd3773d02b760d96dd9c6f26bff93533d)

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:39:08 +00:00
Mihail Stanciu fe8a0a3697 bitbake: toaster: tests Automated build-mode backend tests
Add tests to check various backend scenarios that
require UI interaction.

Add necessary files for above tests (the sqlite file
and the default config json).

(Bitbake rev: 8dcad75ad1d9b8adddeca57e996b8d904b209df5)

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:39:08 +00:00
Ed Bartosh 556b8b6156 bitbake: toaster: remove SDKMACHINE from project variables
Removed SDKMACHINE from predefined set of variables
for the project as it causes bitbake build error:
   SDKMACHINE is set, but SDK_ARCH has not been changed as a result

This variable does not need to be predefined as it's not used by
toaster.

It's still possible to specify it in project configuration
if needed. SDK_ARCH variable should be set too to avoid above
mentioned build failure.

(Bitbake rev: a6ab2a38ab666376b4a5e796d3a88929e8cbfb22)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:11 +00:00
Ed Bartosh 361faa3e6c bitbake: toaster: remove writeConfFile API
This API is not used anymore as toaster doesn't write variables
to configuration files anymore. It sets variables through its
connection to bitbake server.

(Bitbake rev: 6dda2916b75d688874d208192d5c7cdb302eec35)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh fcbba5a89b bitbake: toaster: set varibales on bitbake server
Set project variables using connection to bitbake server
instead of writing them to toaster configuration files.

This is a way to avoid rewriting configuration files before
and after every build, triggered by toaster UI.

(Bitbake rev: 3f77c69b867735b5d27c6ab7c62e39ac8d5cb2b5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh 993bc7eacd bitbake: toaster: implement BitbakeController.getVariable
Added new API to get value of bitbake variable from bitbake server.
The API will be used to update INHERIT variable instead of writing
it to the toaster configuration files.

(Bitbake rev: effc371e3a4a2262e53e9e560c7c08cffad195da)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh 4c1e5ec29a bitbake: toaster: remove usage of BUILD_MODE variable
As both modes can be used at the same time we can't have any
difference in UI between modes.

Removed all conditional statements that used BUILD_MODE.

(Bitbake rev: 4ce1559c2558bd0fd278ff02a1a93bec03c4156b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh 58765a8719 bitbake: toaster: remove stopBBServer API
Removed stopBBServer API from build controller as toaster
doesn't stop bitbake server anymore. It's reused for both
types of builds: triggered by UI and started manually.

(Bitbake rev: 0cad802da171d51814f22cc9383f496a63cd0c75)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh 95a3cf7549 bitbake: toaster: reimplemented startBBServer method
Rewritten LocalhostBEController.startBBServer to use
'toaster restart-bitbake' and read bitbake port number from
bitbake.lock.

Removed complicated logic of running oe-init-memres and looking for
bitbake port number in the logs.

(Bitbake rev: 4b065353c3454923a1ef88e9f0a8702e5626060e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh 76d53b5856 bitbake: toaster: remove _setupBE function
This function is not needed as build environment is always created
because of the new way to run Toaster. It can be only sourced after
oe-init-build-env is sourced.

(Bitbake rev: 27a59b4373a449f17e46ab93e0eba15cf75967ae)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh 28e8ccf437 bitbake: toaster: make runbuilds to loop
Made runbuilds to loop to avoid having a loop in shell code and
initialize heavy Django init machinery every second.

Ignored exceptions to prevent exiting a loop.

(Bitbake rev: e04da15556ca0936de652b8c085e4199e5551457)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:08 +00:00
Ed Bartosh a464bf23b4 bitbake: toaster: implement get-dburl command
Implemented management command to call getDATABASE_URL API.
It will be used to get database url from toaster shell script
by running 'manage.py get-dburl'

(Bitbake rev: fabe9c8f14fd7b8ab204a2b610c64ac5b62135ac)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:07 +00:00
Michael Wood 71ede7b689 bitbake: toaster: toastergui tests Add generic test for ToasterTables widget
For each of the ToasterTables defined test:
 - Data returned
 - Search
 - Order by
 - Limit
 - Paginate
 - Filter

These tests test that the functions on all tables work, it does not
validate the content of the data in the tables themselves, this needs
to be done in table specific tests.

(Bitbake rev: 649d563f95ffc57d0fe3dbf494e7dbffcc99a1b4)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:20 +00:00
Michael Wood 34b22cf897 bitbake: toaster: tables Fix invalid field name on NewCustomImagesTable
Correct the field name in the NewCustomImagesTable as it is a Recipe
object it's self and not a container.

(Bitbake rev: ebd1c493d8b7fb9ee7b3e40c17165dc9c22ca795)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:20 +00:00
Michael Wood 1c59846fc0 bitbake: toaster: tables Add default_orderby field where it was missing or unset
This value is used to set the default ordering of the model that is used
for ToasterTables, it is picked up client side to set the ordering
indicator.

[YOCTO #8695]

(Bitbake rev: f1c91bff810a579b169c46b7710e22f5553b484e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:20 +00:00
Michael Wood d82c541147 bitbake: toaster: CustomImageRecipe add search_allowed_fields to this model
In order to search the model from the UI some fields must be nominated
as searchable.

(Bitbake rev: 2558729b4c248a2fa5a11d877bc42cb05a30602e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:20 +00:00
Michael Wood bdf62414f2 bitbake: toaster: machines table Fix missing layers information needed for filter
The current layers information wasn't being passed to the template for
the Select/Add button for the Compatible machines filter.

(Bitbake rev: 559102984d3f62a7675899e058166bdf4d552c46)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:20 +00:00
Michael Wood b90a8dca99 bitbake: toaster: tablejs Make sure click handlers consume click event
Avoid the click event from propagating and causing strange side effects
in toaster tables.

[YOCTO #8527]
[YOCTO #8148]

(Bitbake rev: f23e54292a673b2fd3f17d317c21984c753727c7)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:20 +00:00
Michael Wood c075bcf545 bitbake: toaster: projectpage Make sure build targets are space separated
Make sure the build targets are space separated when building multiple
targets. Also fix error path now that YOCTO #7995 is resolved.

[YOCTO #8450]

(Bitbake rev: e9719eb2e8249f0d10b39bfdd4aef563368b5ffd)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:20 +00:00
Belen Barros Pena 88f9310ce0 bitbake: toaster: builds pages Fix the download cooker log link
The 'all builds' page was missing the download icon next to the outcome
icon, which allows you to download a build log from the 'all builds' page.

This patch brings it back. It also adds a check in the project builds page
to make sure the download icon only appears if the build generates a cooker
log, since builds that fail at the build request stage do not generate a
cooker log.

(Bitbake rev: 50d7ffa697764d84d96f26a3ae58a9dacde7b31e)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:08 +00:00
Belen Barros Pena d04af8b571 bitbake: toaster: project pages Link to image recipes table in notifications
The project created notifications and the 'Choosea recipe to build' link in
the project page are linking to the software recipes table. Changes them to
link to the image recipes table instead, which is bound to be more useful.

(Bitbake rev: 10e1fbee0d79dbbf15b89ebc155bb2c0092a71f2)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:08 +00:00
Ke Zou 70465c717a bitbake: toaster: tests: Re-write some cases to make them more maintainable
(Bitbake rev: c3c7e94cadb3a3a2d8ef33ed456f439c106018c1)

Signed-off-by: Ke Zou <ke.zou@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:08 +00:00
Elliot Smith 9d8e36a6c9 bitbake: toaster: localhostbectrl Pass DATABASE_URL in via the process environment
Instead of putting the DATABASE_URL as part of the command for launching
the bitbake observer process set it as part of environment.

This fixes two issues 1. Where the value isn't quoted and therefore will be
interpreted in the shell and 2. Anyone being able to see the value of
DATABASE_URL in the process tree.

[YOCTO #8669]

(Bitbake rev: 832a8523067606b180c02f0d1544e8a23219bb08)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:07 +00:00
Michael Wood 4677d8b4fb bitbake: toaster: Remove the new-build-input button widget
The button required a lot of state maintenance to make sure it
showed up when the project was configured properly, showed correctly
according to the projects known to Toaster, displayed correctly
according to the mode Toaster was in, and was able to be
used to change the current project.

(Bitbake rev: b644514a96f3947ad3f307a26301c064c8ae18f8)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:07 +00:00
Michael Wood 55f44943d7 bitbake: toaster: projecttopbar Use the project in context to get num builds
Use the project in the template context rather than ajax request to get
the number of ended builds.

(Bitbake rev: 1f6bfa876b17a600fc83c789af8aaa2639a463b2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:07 +00:00
Michael Wood e9d4962a0c bitbake: toaster: projectpage Disable/Enable build input if we have 0 layers
If we've removed all the layers in the configuration, disable the build
button and build input.

(Bitbake rev: 872bd5ccf58236f5146b1640cc1c465b58371e44)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:07 +00:00
Michael Wood 5fa4c73603 bitbake: toaster: orm Fix get_number_of_builds to count all apart from IN_PROGRESS
The count of a project's builds should not include those which are
currently in progress.

(Bitbake rev: a981700701c41c7bbb6a9778e95f691278c5c294)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:06 +00:00
Belen Barros Pena 66d3c353f8 bitbake: toaster: templates Add meaningful title tags
Our title tags are all over the place, and have no relation to the page
content. This commit adds a meaningful title tag to each Toaster page.

(Bitbake rev: 1ab8827d684a19a70f3b788aed2327bf30edffe2)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:32:10 +00:00
Michael Wood 62e200e3e3 bitbake: toaster: orm Fix restrictive LogMessage message length
Log messages can be quite long so use a TextField rather than a char
field with max length of 240. mySQL is especially picky about field
lengths and will cause an exception if the log is too long.

[YOCTO #8475]

(Bitbake rev: 349119f44cdad240dda7f4db45992e2539e1416f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith 78f935df8f bitbake: toaster: Remove all navigation when not in build mode
The user is redirected to the all builds page or all projects
page from the landing page, regardless of mode.

In build mode, this makes sense; but in analysis mode, we are
restricting the view to just the cli builds project. This means
that "all projects" and "all builds" only contains items relating
to this one project.

Modify the landing page so it redirects to the project builds page
for the cli builds project when not in build mode. Also remove
navigation elements which are irrelevant when not in build mode.

[YOCTO #8514]

(Bitbake rev: ae754655fa1bc5168f43e8821773e7b7b9440a5d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith c5f147b4ab bitbake: toaster: Run tests in build mode
Now that the UI content is conditional on whether BUILD_MODE
is active, modify the existing tests so that they run in
this mode by default.

[YOCTO #8514]

(Bitbake rev: 991712f3f88759e2d68af5a3fe83c1395c4f67f6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith 1d17109d62 bitbake: toaster: Hide builds for non-cli projects in analysis mode
The "latest builds" sections of the "all builds" page
show builds for all projects. This is not appropriate
for analysis mode, where we can only affect the command-line
builds project.

Modify the "latest builds" section to only show builds for
the command line builds project if in analysis mode.

Also rationalise where we get the queryset of latest builds from:
we have a _get_latest_builds() function which was being used
to get the latest builds in most places, but not all.

Also modify _get_latest_builds() to sort by started_on, rather
than primary key, as assuming that a higher primary key value equates
with later start time is incorrect.

[YOCTO #8514]

(Bitbake rev: 52de2c8cd11fa743f8fd7cb0cf776eea622ac474)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith a580479452 bitbake: toaster: Hide top bar buttons in analysis mode
The "new build" and "new project" buttons are irrelevant in
analysis mode, as you can't start a build or a project.

Hide these buttons if not in BUILD_MODE.

[YOCTO #8514]

(Bitbake rev: b1858653c22eb6d51fc23f75ccad69b76523eb41)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith 1ec2ec3429 bitbake: toaster: Show mode-appropriate landing page
The same landing page is shown for both analysis and
build modes. This means that users in analysis mode can see
options which are not available or broken in that mode.

Modify the landing page template to show a simple "run a build"
message if the user is in analysis mode and has no builds yet.

Also clean up the landing page HTML, because the indentation was
a mess and the HTML was invalid.

[YOCTO #8514]

(Bitbake rev: 86b4a10cc817abb5e3e63360dc8b3c550337f17c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith bbac0f092a bitbake: toaster: Add BUILD_MODE flag to context
We set a TOASTER_MANAGED env variable in the startup script,
which has a value of "1" if Toaster should run in build mode.

Add a BUILD_MODE variable to settings.py which is True if
TOASTER_MANAGED is set to "1", False otherwise.

Add this to the context for every template, so we can use this
information to conditionally alter the content of pages
according to the mode we're in.

[YOCTO #8514]

(Bitbake rev: f9cf4739fc85c9760ce748323dc7c8de3fa7eaec)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith a9053ac082 bitbake: toaster: Add tests for error message display on the build dashboard
Add tests to ensure that log messages with CRITICAL level and
with EXCEPTION level are shown in the main errors display
on the build dashboard.

[YOCTO #8320]

(Bitbake rev: 7b3ed62800cb7352154897c1c5ad2440a54df198)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 15:00:00 +01:00
Elliot Smith 2517987f8d bitbake: toaster: Modify "New build" button behaviour for cli builds project
The "New build" button should only be displayed if there are
user-generated projects, not if there is only the command-line
builds project. (Toaster can't run builds on behalf of the
command-line builds project.)

The "New build" form should also display as if no project has
been set (i.e. show the project and recipe text entries).

Add a variable which tracks the number of non-command-line projects,
then use this to hide the button when appropriate.

Also track whether the current project is the default one, and
use this to add extra conditions to when the "New build" text
entries are shown.

[YOCTO #8231]

(Bitbake rev: 07e7bc29a7d976941eeae997f78a25ed6edddfc8)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith 56d4c84cec bitbake: toaster: Clean up template code
Some errors in the HTML template didn't show up until
they were rendering command line builds.

One useless conditional was lingering in another template.

Clean up these issues to display the latest builds section
correctly.

(Bitbake rev: c781d6be94a25f942946d3a406e07791385e4596)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith d96cedf51f bitbake: toaster: More linting of tests
Fix some more lint errors on the tests for toastergui.

(Bitbake rev: a31710db562a91da8ef37f5cd2231132474f46da)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith 7c8877efde bitbake: toaster: Show tooltip next to cli builds project name in all builds
In the all builds page, show an icon with tooltip next to the
command line builds project name.

[YOCTO #8231]

(Bitbake rev: 0240d92c6a508e0b22f37b3ea804171dd3dea5a6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith 76702347a8 bitbake: toaster: Hide tabs and add info popups for command line builds
Command line builds don't have a configuration or
layers which can be modified through Toaster.

Change the project builds page for the command line builds project,
to hide the tabs and add some info popups in appropriate places on
that page.

[YOCTO #8231]

(Bitbake rev: 565611749d47c915035890db60d19ab2fca7c42e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith da4c6144f1 bitbake: toaster: Make the builds view the project page for "command line builds"
Command line builds don't have configuration or layers which can
be manipulated in Toaster, so these pages shouldn't be visible.
However, the configuration page is the default page for the
project view (/project/X/), which isn't correct for the
command line builds project.

Modify all project page links across the application so that
the command line builds project (aka the "default" project)
always displays the builds tab.

Add a project_url tag for templates which contains the logic
determining where the URL for a project links to, based on
whether it is the default project or not.

[YOCTO #8231]

(Bitbake rev: 3ea10f4c16a557e94781251f6776b13acb8e9eba)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith ef6fc2bc1a bitbake: toaster: Replace "Run again" button with help text for cli builds
It's not possible to run a command-line build again, as Toaster
doesn't have access to the data used for that build.

Replace the "Run again" button with an icon which pops up some
help text to that effect.

Add test to check that the run again button is hidden and the
help icon displayed instead for command-line builds.

[YOCTO #8231]

(Bitbake rev: b67ac9e7cbab50951847dd1a63b12f41bb345dbb)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith 7467b6802d bitbake: toaster: Exclude "command line builds" project from projects typeahead
The "New build" drop-down provides autocomplete for Toaster projects.

However, it should not include the default project (for command
line builds), as it should not be possible for the user to
select this project as the container for a Toaster build.

[YOCTO #8231]

(Bitbake rev: d6210cd75b0cd8b6d24d5e99f607ba5cc45daf97)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:16:17 +01:00
Elliot Smith b5624c77ed bitbake: toaster: Show 'not applicable' for default project machine and release
The machine and release for the default project should show as
'not applicable' on the all projects page, as that information
isn't available for command-line builds.

Modify the templates with some conditionals to check for the
default project row, plus some data-* attributes to mark
where that data is to make testing possible.

Add some tests for the all projects page to ensure that
the correct machine/release are still shown for non-default projects,
and 'not applicable' for the default project.

[YOCTO #8231]

(Bitbake rev: ce27b3fd728f0373aa1adc0d47baace264529b45)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:16:17 +01:00
Elliot Smith 3c4c984e33 bitbake: toaster: Reorganise and lint tests
Get test suite ready to accommodate new tests for how command line
builds are shown on various pages.

(Bitbake rev: 1ee1fc5dcdbb26c9f6e04b7719d7196083212d4c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:24 +01:00
Michael Wood 5effe8f632 bitbake: toaster: Allow any text input to machine configuration variable
Allow any text input to the machine variable; as we may not have discovered
all the available machines until after a build.

[YOCTO #8418]

(Bitbake rev: f44b34833f164daf34c57703429ed8f122888037)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Elliot Smith eb8b2b9ec8 bitbake: toaster: Guard against builds with no targets
Although this probably can't happen in practice (builds without
targets), this constraint is not currently enforced in the data model.

In the unlikely event that a build has no target (e.g. in test cases),
this causes a template rendering error.

Rather than rework the data model, add a guard to the template
to prevent it from rendering the target name if there are no
targets associated with the build.

(Bitbake rev: 4f409d8c01bae898ea142bd1417db99e12067753)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Elliot Smith 65e8bde9f1 bitbake: toaster: Remove Toaster exceptions section of build dashboard
Fatal build errors were displayed as exceptions, and highlighted
with less severity than they deserved.

Roll back to treating Toaster exceptions as errors by removing
the toaster_exceptions member on Build objects and displaying
EXCEPTION events in the errors section on the dashboard.

[YOCTO #8320]

(Bitbake rev: 59197320bdcefddf06084e871f1b5b21b21cbb63)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Elliot Smith 93f0b61749 bitbake: toaster: Record critical errors
Critical errors (where a build failed for reasons of
misconfiguration, such as a machine being specified which is not
in a project's layers) were being ignored (only log records
up to ERROR level were being logged to Toaster's db). This meant that
the build would fail but would not correctly report why.

Add support for CRITICAL error levels to the LogMessage model,
include errors at this level in the errors property for a build,
and show errors at this level in the build dashboard.

[YOCTO #8320]

(Bitbake rev: b6eacbca9cacb607de864ab7d093deb296da8226)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:22 +01:00
Elliot Smith 069a611097 bitbake: toaster: Test that exception isn't thrown by project page
Add a test which checks that an exception is no longer thrown
for the /toastergui/project/X page for the default project.

Note that we still get a spinning dialogue box on this page
because the default project has no configuration to display,
but at least it doesn't fail altogether.

[YOCTO #8277]

(Bitbake rev: 8795667d03bd8705d7e13c5d3d6bb6da371fa91d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:22 +01:00
Elliot Smith 026e981264 bitbake: toaster: Check whether buildrequest exists before using it
Builds initiated from the command line don't have a buildrequest
associated with them. The build.buildrequest association is
only added if a build is triggered from toaster.

Some of the code for displaying the status of a build refers
to build.buildrequest without checking whether it has been set,
which causes an error to be thrown.

Add a guard to check whether the buildrequest has been set.

[YOCTO #8277]

(Bitbake rev: af33409612139ab2347baf6b847b23faea19752d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:22 +01:00
Belen Barros Pena 596c219bf4 bitbake: toaster: Disable add layer button when input is empty
The 'add layer' button in the project configuration page
is enabled when you select a layer from the type ahead.
However, if you delete the layer name, the 'add layer'
button remains enabled, and if you click it, the last
selected layer from the type ahead will be added to the
project.

It is probably better to disable the 'add layer' button
when the input field is empty.

[YOCTO #8449]

(Bitbake rev: d4820f16c76398400ddd573db03c654c51d40c1b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:22 +01:00
Belen Barros Pena 24e5a178e1 bitbake: toaster: Have 'Version' next to recipe name
In all Toaster tables we show the version next to the recipe
or package names, with one exception: the recipes table in
the layer details page, where we are showing the version
next to the recipe description.

This patch moves the version column next to the recipe name,
for consistency with all other Toaster tables.

(Bitbake rev: b5af7084b28158a8a9eaf78db463555ae8e0f620)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:22 +01:00
Belen Barros Pena c895838189 bitbake: toaster: Improve directory structure layout
File names in the directory structure often wrap
due to big indenting for nested files and directories,
unnecessary width in certain columns, and not using
colspan when the symlink and package cells are empty.
The wrapping makes the table harder to read.

This patch reduces the amount of indenting, limits the
width of the 'Size', 'Permissions', 'Owner' and 'Group'
columns, and sets colspan to use the white space of the
symlink and package names when empty.

(Bitbake rev: 6167ee5a7569d8f841c340e672645cc133ea5a31)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:21 +01:00
Ed Bartosh 2f52ef4b2f bitbake: toaster: importlayer Update property names for importlayer api calls
Update the property names used in checking for existing layers. The
server side API changed but not all references were updated.

[YOCTO #8300]

(Bitbake rev: 1cbf0cf77a638257e18066f911fe4c4e13c278c6)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:21 +01:00
Michael Wood d302c98822 bitbake: toaster: Fix missing tooltips from layers on project configuration page
Re-enable the layer tooltips on the project configuration page.
This adds the required fields to the API used for the layer dependencies
to be able to show the metadata needed.

Also fixes link hrefs which were missing in the add layers confirmation
dialog (bug 8251).

[YOCTO #8295]
[YOCTO #8251]

(Bitbake rev: c7cb8255d0ab1fd7715e878c1c83ef0cd920387e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-13 15:35:49 +03:00
Ed Bartosh 7e5464b451 bitbake: toaster: Fix broken test case
Fixed test_show_tasks_in_projectbuilds broken by latest changes in
project build view.

(Bitbake rev: 3c72c7634ab69a5eb18aa20a5c6d16a3e2666f62)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:57 +01:00
Ed Bartosh 2e375e63bf bitbake: toaster: exclude recipes with empty names
Modified get_all_compatible_recipes function to exclude recipes
with empty names from the result queryset. This should stop UI
to show recipes with empty names in compatible recipes page.

[YOCTO #7969]

(Bitbake rev: f7c1bd49e2e28d12c6604f5ae54bc96e1e7b6946)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:57 +01:00
Ed Bartosh fa3e82d952 bitbake: toaster: delete recipe if it can't be saved
Due to Recipe model constraints some recipes can't be
saved. However, they still can create incomplete records in
the database. This causes all sorts of errors when Toaster
operates with those objects. Removing them should fix those
issues.

[YOCTO #7969]

(Bitbake rev: 4d76a9e418fd98a7882aa29f974a7389f9689314)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:56 +01:00
Belen Barros Pena 82675fc4ed bitbake: toaster: Remove project name from latest project builds
The 'latest builds' list in the project builds page does not
need to show the project name, since it lists only builds
for the selected project.

This patch removes the redundant project name.

(Bitbake rev: 065652b9c649135f9e2fc5d9ba90e98f560dccdd)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:56 +01:00
Ed Bartosh 6aeaca1c83 bitbake: toaster: test get_alldeps API
Added test case to test Layer_Version.get_alldeps API.

(Bitbake rev: 159aa333c2f6344b5b37911c3f09601b9f0df6d8)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:56 +01:00
Ed Bartosh 0fb6be01fe bitbake: toaster: fix orm tests
Cleaned up and fixed orm tests. Removed test_build_layerversion as
it's not needed due to changed compatible_layer_versions API.

(Bitbake rev: 73ea29ed065bfaa80ee368b2a38c157e36fe1676)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:55 +01:00
Ed Bartosh dea679af1a bitbake: toaster: fix NameError
Fixed exception: NameError: global name 'DoesNotExist' is not defined

(Bitbake rev: eee5311b867d3c8c33e06d04e103bfd3647146f4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:55 +01:00
Ed Bartosh 6e0c0fd835 bitbake: toaster: use get_alldeps in layerdetails renderer
Used Layer_Version.get_alldeps api in layerdetails template
renderer to get list of layer dependencies.

[YOCTO 8004]

(Bitbake rev: 077d0f41a3bd9cf2802a1488f1d6156ccac7df1d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:54 +01:00
Ed Bartosh bd2ec77510 bitbake: toaster: implement API to get full list of deps
Implemented Layer_Version.get_alldeps API to recursively get
full list of dependencies for the layer. Dependencies that are
already in the project are filtered out from the result.
Result list of Layer_Version objects is sorted by layer name
for UI to look consistent.

This API is going to be used to show amount and list of
dependencies for the layer in the list of compatible layers
for the project.

(Bitbake rev: 7d853a3054a9ae3d18eb6f5bc13ba27d2795c31a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:54 +01:00
Michael Wood e35c404537 bitbake: toaster: Don't descend into directories for cached_layers
As toaster makes use of clones of itself we have a mechanism to just
clone the current checkout and use that as a basis for the git clone for
the layers inside. For instance, in poky, if we're running in that directory,
we don't ever want to change the current checkout so we make a copy of
ourselves to do this work in.

This steps through cached_layers and previously-traversed directories
inside the current checkout to find any pre-existing checkouts.

This was ending up traversing too many directories down, so remove
the traverse and only deal with the current directory.

[YOCTO #8463]

(Bitbake rev: 9c40b3b6377ab8f5d6ac9b8e00585b71de00bf74)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 08:12:58 +01:00
Michael Wood 2d6701f190 bitbake: toaster: Update JS unit tests
Update JS unit tests.
- Expand the add remove layer check to make sure that the layer is
  actually added to the project.
- Remove some unused vars
- Make sure that the layers/project ids will always exist at the point
  of running the test.
- Add the missing typeahead input fields to the dom to fix the failing
  typeahead test.

(Bitbake rev: 46af40b95f842aa14ef7e3f0d516aef3899d5e42)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 08:11:30 +01:00
Michael Wood ab896df63b bitbake: toaster: Fix stale layer state buttons
Move the "is available to the project" state computation to the template
for the Layer add/remove buttons, Recipe build/Add layer as done for the
Package add/remove. This is more reliable as we can get an inconsistent
state on the front end JS as there are many opportunities for hitting
out of date project information.

[YOCTO #8294]

(Bitbake rev: 43469c3360566ad4897785f14f8717a9bc8b6078)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 08:11:29 +01:00
Michael Wood 41a5f82b4a bitbake: toaster: tables Add the recipe filter back into the Recipe table
Add the "Is recipe currently available in the project" filter back to
the Recipe table which was removed when we had intermediate
AvailableRecipe tables.

(Bitbake rev: b3682d1d851e616efa0715f9d43815a92e259432)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 08:11:29 +01:00
Michael Wood 2bebcd4995 bitbake: toaster: Fix typo in returning pk list of layer versions in current project
This was accidentally returning the primary key of the ProjectLayer
rather than the ProjectLayer.Layer_Version.pk

(Bitbake rev: b20f3626148e89af0e9fcfca911a5a1e4e355a41)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 08:11:29 +01:00
Michael Wood d6d680d2e5 bitbake: toaster: layerdetails update build recipe button class name
Update the class name which we are using for the recipe build button.
This fixes a regression in the buttons being enabled/disabled when
adding and removing the layer being viewed from the project.

(Bitbake rev: cc63f10f69105205e65b5f9647232b2b4b23ad48)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 08:11:28 +01:00
Elliot Smith 7794b5728d bitbake: toaster: Hide "Download build log" button if log doesn't exist
Our builds pages show all builds, but also include build requests
which may have resulted in a build failure, before the build
started (e.g. at the recipe parsing stage).

In such cases, the BuildStarted event is not captured by Toaster,
so we have no idea where the log file for the failed build is.

The result is that a build is shown by the Toaster UI /builds/ pages,
but it is really a pretend build which never went beyond being a
build request, and which has no associated log file. In turn, this
breaks the "Download build log" button on the build dashboard,
as there's no log file associated with the build.

Fix this by hiding the "Download build log" button for builds
which don't have a cooker_log_path.

[YOCTO #8373]

(Bitbake rev: 89e6cd03aa11c886f28520557af6c7ad51827b0e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 08:11:28 +01:00
Ed Bartosh 8c695393cd bitbake: toaster: fix naming for clone directory
Toaster uses git url and branch to make a clone directory
name. Current code leaves '@' and '%' characters unchanged,
which can cause generation of wrong directory names.

Fixed this issue by replacing '@' and '%' with underscore.

(Bitbake rev: e076888a2120a37c388930073694750735d86507)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:39:50 +01:00
brian avery 8068aa3b0f bitbake: toaster: get rid of interactivity in bldcontrol
removed layer dir questions and base off TOASTER_DIR

removed build dir questions and base off TOASTER_DIR

base configuration file off of TOASTER_CONF

fixed some pylint issues

[YOCTO #8217]

(Bitbake rev: d5811968b5f22093365f381fb7e75ab46e5269c2)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:06 +01:00
Michael Wood c7d1dab1c4 bitbake: toaster: orm Machines filter don't pass self in as parameter
Fix typo don't pass self in as a parameter, this evaluated to true
giving the wrong results meaning the machines typeahead did not return
valid results.

(Bitbake rev: 55ba889ef8900c95447861fa3985ca9cfe06afdf)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:04 +01:00
Elliot Smith dd957fe0f2 bitbake: toaster: Rationalise mimetype guessing to fix artifact downloads
Artifact download links were broken because the function to
get the mimetype for the artifact was incorrectly using the
underlying mimetype library. The function was also attached
to the build environment controller, which was unnecessary, as
we only support local controllers anyway.

Remove the mimetype getter on the build environment and
use the one in the view code instead. This works correctly
and prevents the download error from occurring.

[YOCTO #8369]

(Bitbake rev: 805fb2a9388c728600596e9b845a5c7eeaebd99c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:04 +01:00
Elliot Smith ce9011a9de bitbake: toaster: Use Python's mimetypes module
filemagic is used to guess the mimetype of files when a user
requests a download. However, this adds a dependency on an
external library.

Python does have a mimetypes module, though this guesses the
mimetype rather than doing anything clever with the actual
file content. But for our purposes, it's more than adequate.
(NB Django also uses this module when serving static files.)

Use this instead of relying on any external code, and remove
the filemagic dependency.

(Bitbake rev: 0dd0ac25d54c73f13812db04826b57b3d16ea43f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:03 +01:00
David Reyna 466bbec242 bitbake: toaster: display warnings for bad "IMAGE_FSTYPES" values
Display warning message for IMAGE_FSTYPES when no value is selected or
when the filter does not have any matches

[YOCTO #8126]

(Bitbake rev: 9a825eb928cb35096d2c1563788310fb6a13e93e)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:03 +01:00
Belen Barros Pena 8b7d846c68 bitbake: toaster: Set default columns in recipes tables
The compatible image recipes and software recipes tables
show pretty much all their columns by default. That's a few
too many columns. The default columns in both tables should
be: recipe, version, description, layer and build.

This patch sets the above as the default columns. It also
changes the table heading 'Recipe Version' to just 'Version',
which is shorter and self-explanatory.

[YOCTO #8421]

(Bitbake rev: 1f7bfe5e13bc39bb7eb6e039fe4b6291fc95d531)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:03 +01:00
Belen Barros Pena 9daf6ef908 bitbake: toaster: Comment out broken sorting and filters
YOCTO #8131 records that the sorting by 'errors', 'warnings'
and 'time', and the filtering by 'errors' and 'warnings',
are broken in the 'all builds' and 'project builds' pages.

To avoid exposing broken functionality to users, comment
out the sorting and filtering in those columns until we
we have a fix for YOCTO #8131.

(Bitbake rev: 1f15557efc922bf460640eeaf1622453419bc9a6)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:02 +01:00
Elliot Smith b661f535e6 bitbake: toaster: Don't HTTP cache ToasterTable responses
Django allows generated pages to be cached by default by the
browser. This can result in stale data displaying for some pages.

Instead, disable HTTP caching of ToasterTable responses, so that
each time a ToasterTable view is displayed, its data is
refreshed. This carries a performance penalty, but ensures that
ToasterTable views (e.g. compatible layers) are correctly
refreshed if the user navigates their history with forward/back.

[YOCTO #7660]

(Bitbake rev: 44dccd3018554915868d6c8fe5e22624a2fcdec5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:02 +01:00
Elliot Smith a3742a0f68 bitbake: toaster: Don't add new history entries when table data loads
When ToasterTable data is loaded into the UI, a new entry is
added to the browser history. This means that pressing the back
button appears to have no effect, as you end up at the same page,
possibly with slightly different data.

Instead, use replaceState(), so that the browser history doesn't
grow, but the page context still gets updated.

[YOCTO #7660]

(Bitbake rev: 70c5e40a0f77ae4835fb95275621c345f8190240)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:02 +01:00
Ed Bartosh 4bc3f0994e bitbake: toaster: move clones into subdirectory
By default Toaster clones layers to the same level where
poky clone is. This can look messy if a lot of layers are
used for Toaster builds.

Moving them into _toaster_clones/ subdirectory should make
directory structure looking cleaner. It also safer to isolate
toaster clones from what user might create.

(Bitbake rev: 139e851831eea682aba0f9403dcc2eea7c1b05bd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:39 +01:00
Ed Bartosh 9e1516d2bf bitbake: toaster: make clone directory name unique
Changed naming scheme for clone directory. Used full git url and branch to
make it unique. This should fix the issue with using the same git
repository, but different protocols, e.g. git://some.git.repo and
http://some.git.repo.

[YOCTO #8101]

(Bitbake rev: a9baf856a1ef7d84a47fa6615353f5b3fdb8a73b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:39 +01:00
Ed Bartosh 552fd83d82 bitbake: toaster: fix reimporting module
removed second 'import re' from localhostbecontroller.py

(Bitbake rev: 30a9271ffa2834d9a4ffafe5c03ef9e874460419)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:39 +01:00
Ed Bartosh 55dc9279c8 bitbake: toaster: fix bug in resetting git repository
git reset --hard should be given either commit id or
origin/<ref name> to work properly. Without this fix git will
complain that origin/<commit id> does not exist.

[YOCTO #7505]

(Bitbake rev: ec05beff7d1b06e4df98199925c7102f5684f4e0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:39 +01:00
Ed Bartosh 693934031a bitbake: toaster: use git reset --hard instead of rebase
Replaced 'git checkout <ref> && git rebase' with 'git reset --hard' as
with git checkout repository ends up with detached HEAD. Rebase makes
things even worse as it can cause conflicts. git reset --hard resets
repository to the required state in a most straightforward and
reliable way.

[YOCTO #7505]

(Bitbake rev: f3641a8422e67890410594453b8baf362c27df2b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:39 +01:00
Ed Bartosh 3d73dfa223 bitbake: toaster: don't use --single-branch when cloning
git clone --single-branch works only with ref names. It fails if
commit sha1 is set in layer configuration with this error:
fatal: Remote branch <commit sha1> not found in upstream origin

Cloning repository without using --single-branch should work for
refs and commit sha1.

[YOCTO #7505]

(Bitbake rev: edac7b7533d50455baaaf05a46b7ace49bb24b95)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:38 +01:00
David Reyna d48b7ef607 bitbake: toaster: display most recent builds for projects
Display the most recent builds in the given project's build page.

[YOCTO #8186]

(Bitbake rev: ce9a7f1819a1897878ce154b3ee7e727a76165b0)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:38 +01:00
Michael Wood f902dc646d bitbake: toaster: orm remove the complicated querying on the ORM
We no longer need to compute each layer_version and all the recipes
which belong to this.

[YOCTO #8147]

(Bitbake rev: 505979ab931e3a2a218d7030d6064987e8f9ff14)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:38 +01:00
Michael Wood e6d967dba2 bitbake: toaster: buildinfohelper Create a copy of the built layer and recipe
Create a copy of the built layer and the recipes associated with it.
This is so that the user can view the historical information about a
build. i.e. a snapshot of the layer version and artifacts produced at
that build.

(Bitbake rev: 0683d9a2b15e3234a94437aaebac84bfcca1420b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:38 +01:00
Michael Wood 17fe16bbf4 bitbake: toaster: tables show all recipes in the layerdetails even duplicates
For some layers we have multiple recipes for the same software with
differing versions. Change to showing all versions and add a version
column to the table instead.

(Bitbake rev: 8480e275e87275921d0dd54f2a7a445b1cd40203)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:38 +01:00
Michael Wood aed6d2e8c0 bitbake: toaster: Prioroitise the layer more generic vcs reference over the sha
When we do a build we update the last commit value that the layer was built at
However in future builds we do want to use the named reference rather
than the commit sha, e.g. master/fido

(Bitbake rev: a3d47eb923dd2cb5259f387c79549822807eca49)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:38 +01:00
Michael Wood 922503f4c1 bitbake: toaster: Create a relationship between build information and toaster layers
Previously this layer relationship was done by trying to match path
information that came back to the buildinfohelper with trying to query for
data in toaster's layers table. This rarely matched due to the lose coupling.

(Bitbake rev: 838e77c7c3c4006abd1327343a004590ab652de9)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:38 +01:00
Michael Wood 0bc0a44aff bitbake: toaster: Special case the openembedded-core layer to avoid duplicates
If the openembedded-core layer is specified in the toasterconf we need
to treat it differently because we may also get this layer either from
the layerindex source or I can also be provided locally.

(Bitbake rev: 8e36b6848c14f2708e1f87d12fb533ca0b596c65)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Ed Bartosh e68f63a1bd bitbake: toaster: Add test cases for new Image customisation features
- Adds tests for new ToasterTables
- Adds tests for new ReST API

co-author: Elliot Smith <elliot.smith@intel.com>
           Michael Wood <michael.g.wood@intel.com>

(Bitbake rev: 69f4ece18d70825d620f1d360749d587ea16f2a0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Michael Wood d98c771a9a bitbake: toaster: Add Image customisation frontend feature
Add the Image customisation front end feature to Toaster.
Caveat - This feature is currently in development and should not be
enabled by default.

(Bitbake rev: 543586462b66434741f47f2884b4ccdeda5397b5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Michael Wood 37948cc5d0 bitbake: toaster: Add ToasterTables for Image customisation feature
- Split up the recipes tables into Image recipes and Software Recipes
- Add CustomImageRecipe table
- Add SelectPackagesTable table
- Add NewCustomImagesTable table

(Bitbake rev: 4e5472e9ba6850081baa9d56fabc4ddb1aa24846)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Ed Bartosh a3ff4b28ba bitbake: toaster: Add new ReST API for Image Customisation feature
Implemented xhr_customrecipe API. To create a custom recipe from a
base recipe.
Implemented xhr_customrecipe_packages API to add/remove packages
to/from custom recipe.

co-authored see Signed-off-by

(Bitbake rev: 84be400237173970716616eeab6a37d776aa011b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Michael Wood 28153acb0a bitbake: toaster: Fix indentation of jsunittests view
Fix indentation to 4 spaces

(Bitbake rev: 076945ea026091dc709f7cfea01ef119d0572bf3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Ed Bartosh 60f3ddb2fb bitbake: toaster: implement decorator for REST responses
Implemented xhr_response decorator to decorate responses
from REST methods into Django HttpResponse objects.

This decorator should reduce amount of repeated code in
REST methods and make them more readable.

(Bitbake rev: bb0696f343aca44207581f15ff2b4f0045f7530c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Michael Wood a7f43bd532 bitbake: toaster: add toggle for enabling image customisation feeature
This feature is currently under heavy development and should be used
with caution.

(Bitbake rev: ffc11b2c6c6bac4643233cc46418b025c94607c8)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Michael Wood 3ff6401723 bitbake: toaster: Add CustomImageRecipe model
This model lists custom image recipes for the project.
It is populated when new custom image is created.
It holds reference to the base recipe and list of packages
included into custom image.

For CustomImageRecipes the packages will be copied in and
therefore not associated with a build so Remove the requirement
for the package to have a Build.

co-author: Ed Bartosh <ed.bartosh@linux.intel.com>

(Bitbake rev: 33cbf4cd3b4ca47c4901501f5f1eafdfdfdae023)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:37 +01:00
Michael Wood 8948d04bfd bitbake: toaster: ToasterTable remove unused class definition
Remove ToasterTemplateView as this isn't used by anything.

(Bitbake rev: aa0b2dc6789cb6ae12511a4a930a4118337a162e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:36 +01:00
Michael Wood c1157cff9f bitbake: toaster: add nocache option to the ToasterTable widget
Useful for skipping the cache mechanism when debugging.
Simply append nocache=true to the end of the url with the table in
it.
Also adds a debug message if the table is using cached data.

(Bitbake rev: 3492c1570db9ecd728d9901bda1f02a2d7495f19)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:36 +01:00
Michael Wood 1cafc39e96 bitbake: toaster: widgets ToasterTable Add more info to search field exception
If we get a search fields exception then also print out the model name

(Bitbake rev: 8152db1e35b9a3f35a25f801008f6fc61a6b11c4)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:36 +01:00
Michael Wood c71bbad38a bitbake: toaster: widgets ToasterTable add logger to notify when cache hit
Useful for debugging to remind you if you're hitting a cache or not

(Bitbake rev: 68b9c2d95ab17ee2d16325862342126eb5c3c1a7)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:36 +01:00
Ed Bartosh 934f8d7b23 bitbake: toaster: create custom layer and recipes for Image customisation
When building customised recipes toaster creates custom layer directory
and puts layer.conf and custom recipes to it.

[YOCTO #8075]

(Bitbake rev: f81b48c30a548bee946d34c56aa1872785bcec30)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:36 +01:00
Michael Wood 340b3983db bitbake: toaster: tables Move the title and name into the widget
For historical reasons this was being set in the urls definition. We
can set this in the actual definition of the table and defaults in the
widget.

(Bitbake rev: 2f7949caec3c9194328c35b2e075eaae85409efe)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:36 +01:00
Ed Bartosh e1851fe04c bitbake: toaster: make a workaround for old style index
For a new style indexes 'inherits' field is used to determine if
recipe is an image recipe.

As old style indexes don't have 'inherits' field this can be
guessed from recipe name. Let's consider recipe an image recipe
if recipe name contains '-image-'.

(Bitbake rev: d769d3f54faaf1a3091b1eb6ed1d17a8a108210a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-29 14:11:36 +01:00
Belen Barros Pena fb26ea3605 bitbake: toaster: remove time from builds in progress
In the 'latest builds' section of the all builds page,
completed builds show the time they completed at. Builds
in progress should not display such time, since they
haven't completed yet.

This patch removes the time information that was showing
for builds in progress, whatever that time actually was.

(Bitbake rev: 0df02c87573bf9a66df2e424cd9534e67a8ab3dc)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 22:44:56 +01:00
Michael Wood 767fe69fd0 bitbake: toaster: layerdetails Fix back button tab behaviour
This completes the behaviour fix of the back button in the layerdetails
page as we not only have parameters in our history we also have the hash
to indicate which tab is active. As we pop our history we need to show
the corresponding tab.

[YOCTO #8252]

(Bitbake rev: 8fc7f94af19cd8489a944b02d9a406bd62d001fa)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 22:44:55 +01:00
Ke Zou 4c0320ffc0 bitbake: toaster: UI test improvements
* Add decorator in logging mechanism
* Add more debug information

(Bitbake rev: ab94f4bbef38d23e7e8be0663781eaecf84f0172)

Signed-off-by: Ke Zou <ke.zou@windriver.com>
Signed-off-by: Stanciu Mihail <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 22:44:54 +01:00
brian avery 4c5af777ea bitbake: toaster: support selenium testing from mac OS X
* added a mac section to the cfg file
* added mac specific screenshot code

(Bitbake rev: bf8748aafc2291bb814fe0ec8a28d5eed9a1d5f0)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 22:44:54 +01:00
Ed Bartosh e6c497097f bitbake: toaster: add 2 UI tests
Tested that UI shows task names for the builds in
both all-builds and projectbuilds views.

(Bitbake rev: 092b1a9eebbd3f0747f6152c63182f18bccb2054)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 22:44:54 +01:00
Ed Bartosh f6a70adcfb bitbake: toaster: change UI to show tasks
Changed toaster UI to show tasks if they're specified for the
builds and use them when restarting builds.

[YOCTO #7442]

(Bitbake rev: 3c196c15f0ae4c6ac2b92e0a75562962f3da0089)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 22:44:53 +01:00
Ed Bartosh ea373586d3 bitbake: toaster: store task name in Target objects
Information about a task is not stored in Target objects.
This makes it impossible to correctly operate with the builds
where task is specified.

Storing taks name is an enabler for other fixes in UI and backend
related to restarting builds.

(Bitbake rev: 0a69a8a18075c976ed8681d9d75529f8c2f48514)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 22:44:52 +01:00
Alexandru DAMIAN e993aa6705 bitbake: toaster: hide irrelevant builds in the project builds view
This patch fixes the project builds view so it doesn't show
"in progress" builds or builds for other projects.

Note that this also modifies the "all builds" view to use
the same queryset filtering as the project builds. This is
to avoid excluding "in progress" builds more than once, which
is what was happening before.

The patch also has a minor change to ensure that when
displaying the project builds page, only builds for that
project are in the results.

The queryset filtering is now split over several lines so
you can see what's going on.

[YOCTO #8236]
[YOCTO #8187]

(Bitbake rev: 771c08b9be1f7875e0216e381ab0a81ef0d26256)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-19 11:31:59 +01:00
Elliot Smith 441f04ce97 bitbake: toaster: Simplify redirects when build page parameters are missing
A RedirectException is used to redirect the client to the
correct page when their original request is missing the
required parameters (page, orderby etc.). However, the code
is difficult to follow.

Rather than catching RedirectExceptions and rethrowing them with
different view URLs, ensure that the RedirectException has the
correct URL in it when thrown by passing the original page
name to the _build_list_helper() method.

Modified from an original patch by
David Reyna <david.reyna@windriver.com>.

(Bitbake rev: 38f935647dd768a912b933adebfc9cb225a01a54)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:36 +01:00
Elliot Smith 30f9f79fb9 bitbake: toaster: Fix date range pickers on the project builds page
These were referring to the old HTML elements with ids
"date_from_created" and "date_from_updated", but their
ids have changed to "date_from_started_on" and
"date_from_completed_on". This meant that they weren't
functional.

This fixes the references.

Modified from an original patch by David Reyna
<david.reyna@windriver.com>.

(Bitbake rev: fe9a554249b623ef515502043fdbf50e1ac62a3a)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:35 +01:00
Elliot Smith 047245fff4 bitbake: toaster: Show correct builds count on project pages
The counter for completed builds on the project pages
includes builds in progress.

Instead use the completedbuilds queryset to count the
number of completed builds for display on project pages.

Modify how the completedbuilds queryset is constructed so
it only excludes builds with status "in progress".

(Bitbake rev: 455a0087e0dcd74998abd02a110942f25da127be)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:35 +01:00
Alexandru DAMIAN 5528f3a8fd bitbake: toaster: hide irrelevant builds in the project builds view
This patch fixes the project builds view so it doesn't show
"in progress" builds or builds for other projects.

Note that this also modifies the "all builds" view to use
the same queryset filtering as the project builds. This is
to avoid excluding "in progress" builds more than once, which
is what was happening before.

The patch also has a minor change to ensure that when
displaying the project builds page, only builds for that
project are in the results.

The queryset filtering is now split over several lines so
you can see what's going on.

[YOCTO #8236]
[YOCTO #8187]

(Bitbake rev: 09079f15c0511a6d17ce1cc29be6de5387e45f09)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:35 +01:00
Elliot Smith 460e4c2c2c bitbake: toaster: Don't def a function for each call to build_artifact()
Cache the mimetype object and only define the function for
getting a mimetype once.

Also ensure that filemagic is listed as a requirement of
toaster. Doing this also means we can remove the code
which tries multiple different "magic" libraries, as we know
we have the right version available.

(Bitbake rev: 8d3aa2d46ebab7a59e57234f0b3f6fc3225a13e8)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:33 +01:00
Elliot Smith b6d1d2acd5 bitbake: toaster: Avoid unnecessary local to local copy of cooker log
The cooker log is copied from its original (bitbake) location
to an artifact directory chosen by the user (chosen when
checksettings.py runs as part of the managed mode;
it's one of the annoying questions you're asked at startup).
The copy happens as part of the runbuilds script run, which
is started in a loop from the toaster startup script
in managed mode.

When a user requests the log for a build via toaster, they
are getting the log which has been copied to the artifact
directory, not the original bitbake log.

This works for the managed case, where the runbuilds command is
running in a loop and copying log files for completed builds to
the artifact directory. However, in analysis mode, there are two
problems:

1. checksettings isn't run, so the artifacts directory isn't
set. toaster is then unable to figure out where the log files
should have been copied to.

2. The log files aren't copied to the artifacts directory
anyway, as runbuilds isn't running in analysis mode.

To fix this, just point the user to the local bitbake log file
in its original location. This avoids the copy step, and means
we can remove a whole question from the toaster startup sequence,
as we no longer need an artifact directory.

The only downside to this is that it's not appropriate for
remote bitbake servers. We will need to revisit this and
possibly reinstate the copy step once we have to reconcile
local and remote builds and make their logs available in
the same way.

[YOCTO #8209]

(Bitbake rev: 5697bbcc88edad85891f66d28b8803a9c9d27ff2)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:33 +01:00
brian avery 013c030c42 bitbake: toaster: delete multiple builds cleanup
This patch cleans up the multiple delete. It:

1) skips build id's that don't exist rather than giving a traceback.
2) let you pass in the ids as a space separated list
3) fixes the usage to match the space separated list format

[YOCTO #7726]

(Bitbake rev: a065f7e5e9c07dbd71a98e7db1d7f711607716f3)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:32 +01:00
Ed Bartosh aaa48b69f3 bitbake: toaster: increase waiting time
Increased waiting time for toasterUI from 10 to 25 seconds. Bitbake
takes longer time to start, so toaster should wait longer.

[YOCTO #8240]

(Bitbake rev: 224ee3685fe20915b21d299ab80f7b289a916dca)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:50:14 +01:00
Belen Barros Pena 446070074e bitbake: toaster: Changes to navigation
This patch:

* Changes the breadcrumb to provide access to either
the project builds or the project configuration, as
appropriate

* Changes the left navigation in the project configuration
to reflect the hierarchical relationship between the
basic configuration and all other configuration pages

* Changes the left navigation in the build history to bring
it in line with the changes in the project configuration

This way the breadcrumb explicitly exposes the hierarchy
of the application, which is its correct behaviour, making it
easier to move around within Toaster.

(Bitbake rev: 135dff67216759286f584e501583584a9cb09f27)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:57 +01:00
Belen Barros Pena db92bc2388 bitbake: toaster: replace ETA with % of tasks done
The ETA we show for builds in progress is woefully
inaccurate. In the 1.8 release we replaced it with
the % of tasks completed. Somehow, we regressed to
the ETA, so bringing the task % back.

(Bitbake rev: a841dc85770ea5c6fa8cf06ba5fdfe214e69afb2)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-08 23:54:15 +01:00
Belen Barros Pena c386abc89e bitbake: toaster: fix project names in latest builds
Make sure that the project name we show for each build
in the latest builds section of the all builds page:

* Has the same styles as the build, depending on the
build status (in progress, failed or success)

* Links to the project page

(Bitbake rev: 09abcf3199b2e86758a974a47ebe31f5fb79440a)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-08 23:54:15 +01:00
Belen Barros Pena a4dbd4bfa1 bitbake: toaster: remove unnecessary white space
There was too much white space above the first
heading in the all builds page. This patch removes
the class that was adding the extra space.

(Bitbake rev: c9b20009c5e161987a143b00ee22218a4c9c0692)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-08 23:54:15 +01:00
Richard Purdie 1e9ac4c5cc bitbake: toastergui: Add missing files from 1c2f6b9b7b9e700146944b9d6d2114e0d014ee81
(Bitbake rev: cf2b6b621cb483aa1a1a66c09fc431efc207c91e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-08 23:54:14 +01:00
Belen Barros Pena ccc1d9ac0c bitbake: toaster: improve explanation of checkout dir
Improve the explanation we show to users during set up
when asking them to set the layers checkout directory.

The patch also makes minor changes in text formatting to
improve legibility.

[YOCTO #7740]

(Bitbake rev: dd9284944ae0f0feecb70adab880fed636f7cd59)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:57 +01:00
Elliot Smith bc6a1a23e3 bitbake: toaster: Add tests for pages which show the default project
Test that the correct landing page redirect is applied, depending
on the state of the default project.

Test that the default project is only shown on the /projects page
if it has at least one build.

[YOCTO #7932]

(Bitbake rev: 85a65d2b652c2ccc6cfb90fd8bc9048d0e72341e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 16:52:50 +01:00
Elliot Smith 3b6d193cd7 bitbake: toaster: Fix test for projects page JSON
The tests expect data to be returned in a particular format,
which doesn't include is_default or the num_builds fields
added to support default project improvements.

Add the extra fields so the tests pass again.

[YOCTO #7932]

(Bitbake rev: 66f965b68dda76a755d88879191a0f340ba19142)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 16:52:50 +01:00
Elliot Smith 3b233fca49 bitbake: toaster: Exclude default project unless it has builds
Don't include the default "command line builds" project in
the projects view unless it has builds associated with it.

[YOCTO #7932]

(Bitbake rev: b37318057ccbfb3889d28fd593cc1602febf1ae9)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 16:52:49 +01:00
Elliot Smith c9a05be1ff bitbake: toaster: Only redirect to projects page if user has added projects
The landing page currently redirects the user if there are any
projects in the db. Because we now always have at least one
(the default one added by a migration), we always get the redirect.

Change this so that when the user hits the landing page,
we only redirect them to the projects page if there is at least
one user-added project and there are no builds.

[YOCTO #7932]

(Bitbake rev: 316a70da93055b63eff7d40b7fd8bd07299074af)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 16:52:49 +01:00
Elliot Smith 214ba674d0 bitbake: toaster: Improve how default project is identified and fetched
Command line builds are associated with a "default project"
(as we currently require a build to have a project). This
acts as a container for builds initiated outside Toaster.
Currently, this project is marked as the default by its ID
being 0. However, this doesn't work with MySQL, as MySQL
won't allow 0 in a foreign key which references an
autoincrement field.

Instead, use an is_default field to track the default Project
for builds initiated outside Toaster.

Add a method to fetch this default project, rather than fetching
a project with a magic ID.

Add this default project in a migration, rather than as a side
effect of a get_or_create() style method.

Also ensure that builds always have a project explicitly assigned
to avoid any magic with a build's project foreign key defaulting to
0 (as it no longer does).

[YOCTO #7932]

(Bitbake rev: 71b709a1bbc26d89d61873763b467d21e625b274)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 16:52:48 +01:00
Elliot Smith 5b26bbdfe1 bitbake: toaster: Make 0021 migration compatible with MySQL
Two issues prevent this migration from working correctly
with a MySQL back-end:

1. MySQL won't allow a default value to be set for an
AutoField, which is what the migration tries to do
for project_id ("ValueError: The database backend does not accept
0 as a value for AutoField.")

2. When migrations are applied to a MySQL back-end, Django
(via South) attempts a dry run of the migration first: it
applies the forward migration then rolls it back. However, this
migration raises an exception on roll back, which causes the
whole series of migrations to fail.

This commit fixes both issues.

[YOCTO #7932]

(Bitbake rev: 12f6278d56d7dec57308adc17411802f15d395d7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 16:52:48 +01:00
Belen Barros Pena 24d6d3fda8 bitbake: toaster: show incomplete configuration warning
In the new build button form, make sure we show a
warning when you select a project with an incomplete
configuration that cannot be built.

(Bitbake rev: 9e970bd7a3e8a7d6ec26265b2e5863624db8a77f)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 16:52:47 +01:00
Belen Barros Pena 249f36660f bitbake: toaster: disable build button as needed
Make sure that the 'build' button in the 'new build'
form is disabled whenever the 'recipe(s)' text
field is empty.

(Bitbake rev: 4daaaf63a26b7dd1c1f035d43c45abffe7b62d76)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 16:52:47 +01:00
Belen Barros Pena e8769bf7c3 bitbake: toaster: new Toaster image
Add a new black and white image of Toaster for use
in the landing page, so that nobody can confuse it
with the real interface.

[YOCTO #7743]

(Bitbake rev: 6db00cace690f39ace3a0556db7b5d4e2911d5d7)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-01 11:40:04 +01:00
Belen Barros Pena 3e27f92652 bitbake: toastergui: remove old screenshots
Remove the Toaster screenshots we no longer use in the
landing page.

(Bitbake rev: 531fbbf8c0a826ece5c2ed86babc7b866c925686)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-01 11:36:35 +01:00
Michael Wood 14d44456ad bitbake: toastergui: Add frontend javascript unit tests
Use Jquery's Qunit tests to create some unit tests for javascript
components used in toaster.

(Bitbake rev: 1c2f6b9b7b9e700146944b9d6d2114e0d014ee81)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:52 +01:00
Belen Barros Pena ab9644f7ac bitbake: toaster: fix global navigation
The "All builds" item in the global navigation should
only be active when you are in the "all builds" page.

The global navigation should not appear at all in the
landing page and in the new project page.

(Bitbake rev: 120816b133b9c160c68c911a9f4c612ce2f8a9ed)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:52 +01:00
Belen Barros Pena ae329b7633 bitbake: toaster: adjust spacing in project pages
Mainly in the top of the page, by adjusting some classes
and the headings.

Also, it removes the commented out tab for the 'My image
recipes' section, since the final designs for image
customisation do not need it.

(Bitbake rev: 945746f21916eb64a0b4344bcf7e7e0dd75b9547)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:52 +01:00
Belen Barros Pena 7957e1f15f bitbake: toaster: fix show / hide columns in all builds table
The classes errors_no and warnings_no were removed from the
td tags in the builds.html template. That broke the show / hide
columns functionality, which would hide only the table heading,
but not the data cells.

This patch brings back those classes so that you can hide
and show the errors and warnings information.

(Bitbake rev: da5310f05f8573b2138da98a64749269d0711c18)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:51 +01:00
Bian Naimeng 8e1f080c04 bitbake: toaster: Support environments which have proxies set
In an environment with a proxy which requires authentication, e.g. with
$http_proxy = 'http://user:password@ip:port', the following error
occurs when running Toaster:

  EE: Using proxy http://user:password@ip:port
  EE: could not connect to 'url', skipping update: 'error message'

This prevents Toaster from fetching layer, recipe and machine information
from remote repositories.

This patch allows Toaster to use the proxy settings from the
environment for HTTP/HTTPS requests.

(Bitbake rev: e7a85031fd05a46ef60b380883da4cc372acf89b)

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:51 +01:00
Sujith Haridasan ce2a827086 bitbake: toaster: Remove Log column from All builds page
This patch removes Log from All build table.

[YOCTO #8010]

(Bitbake rev: 12459211671772905a3e88310b0421b6014f0c20)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Sujith Haridasan <Sujith_Haridasan@mentor.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:50 +01:00
Sujith Haridasan f454fc50a3 bitbake: toaster: Fix extra checkbox in most recently built recipes section
This patch fixes an extra checkbox which is due to an extra space
in the target.

[YOCTO #8202]

(Bitbake rev: 742d15beaf7e2bb8b61ed61b1a26909d16de0eac)

Signed-off-by: Sujith Haridasan <sujith.h@gmail.com>
Signed-off-by: Sujith Haridasan <Sujith_Haridasan@mentor.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:50 +01:00
David Reyna d45ab491d0 bitbake: toaster: update directory tree expansion
The ajax query that fetches the directory data on an expand request
is now returning the response data already in an object form. so the
parseJSON() call is no longer needed (and is currently returning a
parse error).

[YOCTO #7810]

(Bitbake rev: e237d231d52ef71e0f369d1af34f214e6c2359f2)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:50 +01:00
Belen Barros Pena 7ee503e7c5 bitbake: toastergui: change image in landing page
Change the Toaster screenshot we use in the landing page
to make sure it cannot be confused with the real interface.

Also, remove the MANAGE conditional we were using to set the
screenshot. We no longer have different applications for the
two modes, so it should no longer be needed.

[YOCTO #7743]

(Bitbake rev: 099c1af869a6cd52a2cdb87465a05893d60c8f38)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 14:03:49 +01:00
Alexandru DAMIAN 6f176d4c7b bitbake: toastergui: fix projectbuilds page
This patch fixes the redirection projectbuilds page and
the template layout in the projectbuilds page.

* The _build_list_helper now returns an empty RedirectException
that is properly customized by the caller and re-raised
to achieve redirection to the original page (poor man's overloading)

* The template for ProjectBuilds is updated as to properly display
Build objects instead of BuildRequest objects.

[YOCTO #7995]

(Bitbake rev: 5982b5df9288a5773c7314234e2e0432f85678f2)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:56 +01:00
Alexandru DAMIAN ab13498eb9 bitbake: toastergui: do not show in-progress builds in the table
This patch fixes the all-builds table as not to show
in-progress builds.

(Bitbake rev: 60fdc834d386dbace0a158123afd68df3ffbff90)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:56 +01:00
Alexandru Damian c9455a7484 bitbake: toaster: fix pylint errors
Prompted by issues discovered during running pylint on
the toaster sources, this patch fixes:

* missing import in toaster ui
* improper call of function in toaster ui (logger.debug)
* improper function definitions in bbcontroller
* invalid references to objects in bldcontrol.models
* proper initialization of object fields in ToasterTables

Also inhibiting specific pylint errors in files where
the problems are mis-identified.

(Bitbake rev: 1c71955c416fb68455f7f70669aba4202c411807)

Signed-off-by: Alexandru Damian <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:55 +01:00
Alexandru DAMIAN 07b58c9734 bitbake: toaster: fix updates on failed build requests
The patch to fix the original mistake is wrong, in the sense
that a constant from the BuildRequest class is used on the build
object.

Fixing the patch to bring in the correct constant in.

(Bitbake rev: a740c17efc0ccc9f89a428ead08f9739af3c6de4)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:54 +01:00
Alexandru DAMIAN 242603e9b4 bitbake: toaster: replace raising Exceptions in loadconf
This patch replaces throwing Exceptions in toaster loadconf
command with proper explicit error messages. This allows
the user to properly understand and debug what went wrong when
loading a config file.

Additionally we change a bit the logic around auto-detecting relative
giturl handling so the user gets proper error messages when
trying to load an invalid toasterconf.json file.

[YOCTO #7945]

(Bitbake rev: 3d14cc033a855bf5b20e799438548b6d8f29d9b8)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:54 +01:00
Alexandru DAMIAN c159b3c117 bitbake: toaster: do not stop data import on bad data
The layer data update in Layer source needlessly stops
processing by throwing an Exception when bad layer data cannot
be inserted in the database (e.g. invalid dependencies).

This patch changes the behaviour to ignore bad data, and
continue with data import after detailed logging through the
logging system.

[YOCTO #7955]

(Bitbake rev: e0911e408db4fa07086738fe11121b173b4d1cf5)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:54 +01:00
Alexandru DAMIAN be4636aef2 bitbake: toastergui: rename variables in views.py
Renaming various variables in the views.py file to make
the code more readable, and prevent overshadowing of global
variables with local variables that have a different name.

(Bitbake rev: 5fe0c42ca9d34fa34b65b9fe0ff474200b78efe6)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:53 +01:00
Alexandru DAMIAN 12c9cca5b1 bitbake: toaster: use loggers instead of prints
Switching debugging from using print statement to using
loggers, as it uses the logging infrastructure to process
the messages.

The messages are logged with the "toaster" logger which
is defined in the toastermain/settings.py.

(Bitbake rev: adf3bdcbe8b0b0bbe9de2800f2d20a53e8d88543)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:53 +01:00
Alexandru DAMIAN d18e6303a0 bitbake: toaster: models field initialization
As prompted by pylint, the object fields need to be
initialized properly, so this patch fixes that.

Also adds some casts to int, because, sometimes, the IntegerField
is not returning an int, but a string.

(Bitbake rev: cc9ac01d0726203fbe916cec51cc464eaeae9305)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:53 +01:00
Alexandru DAMIAN 504396f6a3 bitbake: toaster: improve exception handling
This patch improves exception handling, fixing issues
as prompted by pylint, including exception renaming.

(Bitbake rev: 652fad64864703cb1bbeede8d5bfc4208974be68)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:52 +01:00
Alexandru DAMIAN 99730d64d4 bitbake: toaster: checksettings: fix TEMPLATECONF detection
Improving the TEMPLATECONF detection by verifying the return
code and dumping extra debug information in case of exception.

(Bitbake rev: bdc00755993aa37e7669c3859ef4ea9b1fc3e680)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:52 +01:00
Alexandru DAMIAN 3a1af07177 bitbake: toaster: checksettings: fix guesspath initialization
Object fields need to be instantiated in the constructor.
Fixed prompted by pylint.

(Bitbake rev: 40db75c6117c3226c27d278d2acf0cd3ba61a167)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:51 +01:00
Alexandru DAMIAN 98dfa27050 bitbake: toaster: pylint fixes
This patch fixes imports, default parameters to functions,
incorrect overloading and exception handling issues
highlighted by pylint. There are no functional changes.

(Bitbake rev: 066e096b80dcb0e93e1a088acf5d914184361769)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:51 +01:00
Mihail Stanciu c8df84777b bitbake: toasteruitest: Updated UI tests cases to use dom IDs and 1.9 UI changes
Updated existing tests to use dom IDs where necessary.
Updated tests to use 1.9 specific UI changes:
    - removed deprecated columns(log and layer directory)
    - changed expected names for table header("Recipe" instead of "Target")
Added tests for TC 942 and 943 which were missing
Removed test for TC 959 which was deprecated under 1.9

(Bitbake rev: d8c37780609571e95edef9a220225927eb94b174)

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:51 +01:00
Michael Wood 55f13d4556 bitbake: toastergui: Call csrf function in all pages to ensure cookie is sent
Not all pages call the csrf token template function so django does not
bother to send the cookike, this meant that all subsequent ajax calls
fail. So add this to the base template.

[YOCTO #8175]

(Bitbake rev: baed115081f888e027f92f37e12dc2dd2b874bf0)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:50 +01:00
Paul Eggleton 715d857174 bitbake: Fix default function parameter assignment to a list
With python you should not assign a list as the default value of a
function parameter - because a list is mutable, the result will be that
the first time a value is passed it will actually modify the default.
Reference:

http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments

(Bitbake rev: 7859f7388f2e3f675d0e1527cfde18625f36f637)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:44 +01:00
Ed Bartosh c348fa5018 bitbake: toaster: move code from setup_lv_tests to setUp
As ProjectLVSelectionTestCase was removed there is no point
to keep this function. Moved code back to setUp method.

(Bitbake rev: 8e9bd559c8ef0ebc9e8babbada06e710908bae08)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:45 +01:00
Ed Bartosh e5956a6b85 bitbake: toaster: remove ProjectLVSelectionTestCase
Moved code from ProjectLVSelectionTestCase.test_single_layersource to
LayerVersionEquivalenceTestCase.test_compatible_layerversions.

Removed ProjectLVSelectionTestCase.

(Bitbake rev: b322cb6f5fec0b979a646605ed0d7646764c07a7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:44 +01:00
Ed Bartosh 5638321f03 bitbake: toaster: add header to orm/test.py
Added header and module docstring.

(Bitbake rev: f393d3b8943375d18ebd6bc5e00dec5f288b46ec)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:44 +01:00
Ed Bartosh 50f9e203bb bitbake: toaster: simplify testcase code
Replaced 2 asserts with one in test_single_layersource method
of ProjectLVSelectionTestCase.

(Bitbake rev: 54131366ac2a8fc7866fb1293f5cd0e3da13ea46)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:43 +01:00
Ed Bartosh 552b1feeef bitbake: toaster: remove duplicated code
Removed test_dual_layersource method from ProjectLVSelectionTestCase
as identical method presents in LayerVersionEquivalenceTestCase.

(Bitbake rev: 5611c6b911e8a638f462e80e924ac9265a2199f5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:43 +01:00
Ed Bartosh 1f7d7bf216 bitbake: toaster: reuse common code
Moved setup code of LayerVersion tests to a function
and call it from setUp methods of 2 classes.

(Bitbake rev: 65121e71078499ba585cc6a42018339d7884322e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:43 +01:00
Ed Bartosh 958696f560 bitbake: toaster: reformat LayerVersionEquivalenceTestCase
Reformatted to increase readability and satisfy pylint.
Added docstings.
Shortened variable names.

(Bitbake rev: 01e6fb74b60b1a66873f33866a35bdf6b2f807bd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:42 +01:00
Ed Bartosh d637b91639 bitbake: toaster: rewrite LILSUpdateTestCase
Reformatted code. Added docstings.

(Bitbake rev: 0d1a9038b0cface75d3c858543e411f519b4ef5e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:42 +01:00
Ed Bartosh 344ad2e128 bitbake: toaster: rewrite test for LayerSource model
Rewritten LayerSourceVerifyInheritanceSaveLoad class from scratch.

(Bitbake rev: 34ea4c661ee48e1986fe2375b94e5b1c5c16c8ee)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:41 +01:00
Ed Bartosh 11668e24e7 bitbake: toaster: fix test_build_layerversion test case
The reason of test failure is that Django querysets are
different even if they contain the same objects.

Fixed by converting querysets into lists.

(Bitbake rev: c1abc6f0905e4321668a483a3d5be7cef3c25401)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:41 +01:00
Ed Bartosh 77ca551813 bitbake: toaster: remove prints from the test code
Removed prints as they make test output harder to understand.

(Bitbake rev: 922d37bfee7cc75aa7a3fd5b76abc33df57d3704)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 14:41:40 +01:00
Mihail Stanciu 645435a645 bitbake: toastergui: Added IDs to elements used in testing
Added static IDs to elements commonly used in the testing process so
that future UI modifications would not break tests as easily.

[YOCTO #7380]

(Bitbake rev: 04e896d7fb170271fb09dae5c2a42acb4b68f513)

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17 08:48:28 +01:00