Commit Graph

1292 Commits

Author SHA1 Message Date
Ed Bartosh aa6894a436 bitbake: toaster: fix wrong usage of print_exc and format_exc
First parameter of traceback.print_exc and traceback.format_exc APIs is
a 'limit' - a number of stracktraces to print.

Passing exception object to print_exc or format_exc is incorrect, but
it works in Python 2 and causes printing only one line of traceback.

In Python 3 comparison of integer and exception object throws exception:
TypeError: unorderable types: int() < <Exception type>()

As these APIs are usually used in except block of handling another
exception this can cause hard to find and debug bugs.

(Bitbake rev: c5a48931ac8db9e56f978c50861c19d0d0c808e3)

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-06-15 08:35:06 +01:00
Ed Bartosh eb634f9e13 bitbake: toaster: changed python version in shebang
Changed python to python3 in shebang to ensure that
manage.py is always run by python3.

(Bitbake rev: 3638b8e5390c36076e14c181e955505750031571)

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-06-15 08:35:06 +01:00
Michael Wood 0a7bd539fa bitbake: toaster: toastergui tests Use new BeautifulSoup syntax
Fix deprecation warning specify the parser used for creating the
BeautifulSoup object.

(Bitbake rev: d34546e88881e89588206877ebaea506cda4f6c2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Elliot Smith eba5321786 bitbake: toaster: open image files in binary mode when sending in response
The view code for downloading image files used the "r" flag
to read the file, then used the open file object to form the
HTTP response.

While this worked in Python 2, Python 3 appears to be more strict
about this sort of thing, and Django throws a UnicodeDecodeError
when a file opened this way is used in a response.

Open the file with the "b" flag (binary mode) so that Django can
correctly convert the binary file handle to an HTTP response.

(Bitbake rev: c4d67968d0ec1d5ff53cdc0dccf6a7869c89597b)

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-06-15 08:35:06 +01:00
Elliot Smith 16df75d49d bitbake: toaster-tests: fix tests for latest Selenium version
Previously, we didn't specify a specific version of Selenium.
When upgrading to Python 3 and installing Selenium to work with it,
the JS unit test broke, as the report format produced by Selenium
had changed.

Modify the test so that it works with the latest Selenium report
format.

Add a note to the README that the given Selenium version should
be used to prevent unexpected test failures.

(Bitbake rev: 571c2b70d3c123614618672ce7532bb5f4c36630)

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-06-15 08:35:06 +01:00
Elliot Smith 6eefd9c1e5 bitbake: toaster: fix broken reference to urllib
The code previously imported urllib to make use of querystring
quoting, but was modified to support Python 3. During this
process, the reference to urllib was not fixed, which resulted
in table filters breaking.

Remove the reference to urllib (which is no longer imported)
and instead reference the imported unquote_plus() function.

(Bitbake rev: f66ee686d4e3002a4a38a7424bcc605a6df9db0b)

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-06-15 08:35:06 +01:00
Ed Bartosh 79a3954afc bitbake: toaster: fix test_toaster_tables
Removed unneeded code as it causes the following error in Python 3:
    TypeError: expected bytes, bytearray or buffer compatible object

(Bitbake rev: 1626e986820da626c19aa8c664155a2cb1db8fd9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Ed Bartosh 4422d26dd6 bitbake: toaster: fix incorrect file mode
Python 3 complains about 'wa' mode this way:
 ValueError: must have exactly one of create/read/write/append mode

Fixed by using 'a' mode.

[YOCTO #9584]

(Bitbake rev: eb23a84e079125a08d0c8e910f7035ad9584c432)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Ed Bartosh c28f918e5d bitbake: toaster: decode response content
Decoded response content to str to pass it to json.load as it breaks
in Python 3 with this error:
   TypeError: expected bytes, bytearray or buffer compatible object

[YOCTO #9584]

(Bitbake rev: 3566ecc3ae682358d1fc58bdc0bed5cbed5e9608)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Ed Bartosh 1fd160016d bitbake: toaster: fix migrations
(Bitbake rev: bfb44886c3bec8320e4f845c9ff24ae2a795aa9f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena e23faacd6f bitbake: toaster: BuildTasksTable filters remove outcome NA option
In the 'outcome' filter for tasks, remove the 'not applicable' option,
since it should not be exposed to users.

(Bitbake rev: 4e21817b0d7a91e634bdb2069850627c38fde053)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena 0db23ae759 bitbake: toaster: BuiltPackagesTable format empty state in packages table
The explanatory message in the empty state of the packages built table
was missing some spaces.

(Bitbake rev: 70f600f86ec4d536004d968919e86d2afa58d585)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena 1a00cdbcb1 bitbake: toaster: build data Fix left navigation
Make sure the current page is always highlighted in the left navigation.

(Bitbake rev: 3d7f5d6ae843bcc3b5af1a9414ab5cb2759d0853)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena a7d498dfd3 bitbake: toaster: port all build analysis pages to bootstrap 3
Port all the pages in the build analysis area to bootstrap version 3.

(Bitbake rev: f963b73f0bf32db2df39dd79d8d85184c280cda0)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena 46271833be bitbake: toaster: buildtables Remove links from non name fields
Design change to have no links for non-named fields in BuiltPackagesTable.
BuiltRecipesTables and BuildTasksTable.

Additionally:
- Fix class and elements for Bootstrap3 in help text.
- Change title of InstalledPackages table to Packages Included.
- Change which columns are default shown/hidden columns.

(Bitbake rev: 7c377e161a90184a4786e33951d8c0e30688ba3b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Elliot Smith de3984ccdb bitbake: toaster: fix typo which prevents filters from working
'k' was replaced by 'key' at some point but not fixed in the
body of the loop. This caused a failure when the the query
was constructed for a filtered queryset, due to the variable
not being defined.

(Bitbake rev: 37fb9a364e645baadda30cc74a18baa565f39857)

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-06-15 08:35:04 +01:00
Elliot Smith ef72321fe4 bitbake: toaster-tests: maximize browser window when running UI tests
In some pages of the UI, the UI tests failed because parts of
the UI which should be visible were being reported as not
visible by the Selenium PhantomJS driver.

On investigation, it turns out that PhantomJS uses a very narrow
default window. This meant that some parts of the UI were being
clipped and were thus not "visible" to the driver, causing test
failures (specifically, on the new custom image page).

Ensure that the window is maximized before running tests to
prevent this happening.

(Bitbake rev: 3f61bef9359926211be7a3177a2071963726ead5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood dd764003ea bitbake: toaster: Rework displaying package dependencies across Toaster
After porting the build table to a unified mechanism for showing
dependencies in tables it highlighted that the dependencies selected to
be shown were un-filtered. i.e. all dependencies from all contexts were
shown. The context for a package's dependencies is based on the target
that they were installed onto, or if not installed then a "None" target.

Depending on where the template for the dependencies are show we need to
switch this target which is why a filter and utility function on the
model is added.

Additionally to use the same templates in the build analysis we also
need to optionally add links to the build data for the packages being
displayed as dependencies.

Customising a Custom image recipes may or may not have a target
depending on whether they have been built or not, if not we do a best
effort at getting the dependencies by using the last known target on
that package to get the dependency information.

[YOCTO #9676]

(Bitbake rev: 31e7c26cc31a7c8c78c1464fa01581683bfd2965)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood 89433a35e6 bitbake: toaster: widgets ToasterTable Catch template rendering exceptions
If a cell template rendering causes an exception catch it and carry on,
this at least allows the table to show the rest of the data if nothing
else. Also improve the error logging so that it's possible what the
offending template snippet was.

(Bitbake rev: 566b4fbe9cfe4c6c0605c4f6444083ee4cf8b958)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood 82722cb564 bitbake: toaster: tests Add new build tables to tests
- Add new build tables to be tested
- Add required data into the fixture and clean up a few empty fields
- Fix the SoftwareRecipesTable specific test so as not to rely on two
  particular defined recipes

(Bitbake rev: 7cf23671659666b27b5629fecd5f947f9bdb94e0)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood c42f1cc81d bitbake: toaster: table.js Add the ability to highlight a particular row
As in the old build tables it's useful to jump and highlight a
particular row in the table using the #hash in the URL.

(Bitbake rev: 927bfc26ffcb0eb6c0a5b3c0905b7efc2f19b9a2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood caae3b6206 bitbake: toaster: port Installed packages table to ToasterTable
(Bitbake rev: 2418c092abd9a503becf5e786125f8cdddd8652c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood b2a68f5511 bitbake: toaster: port Task tables to ToasterTables widget
Port the Task based tables to ToasterTable. This is the Task, Time, CPU
usage and Disk I/O tables.

(Bitbake rev: bebcef7a4bf08b10e472475435ddc7a524364adb)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood 32d1e2dd25 bitbake: toaster: port Built recipes table to toastertables
(Bitbake rev: 9434d3925bb7768876aae8d649ea00b8d849c6e9)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood a786ac14f1 bitbake: toaster: port table for Built packages to ToasterTable
This is the table that displays all the packages built in the build.
Build -> Packages. Adds a template snippet for the git revision popover.

(Bitbake rev: df62f38ff4e634544c9b1e97c5f6ca45e84a4f1e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood b63f9518e7 bitbake: toaster: ToasterTable widget add an 'a' to Name in Exception class
(Bitbake rev: 4c0e07b8379381cfe887a4c65d2f61af05914082)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Belen Barros Pena 0bd6095d92 bitbake: toaster: toaster tables Enable complex empty states
Make sure we can create empty states for toaster tables that include
actions for users to get out of the empty state. Allows a template to be
used as an empty state.

(Bitbake rev: 9f21a1781345a2d2757616a9ab6f34ec48e9e93d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Belen Barros Pena 443f7b3915 bitbake: toaster: Migrate project configuration from bootstrap 2 to bootstrap 3
Convert all the HTML templates, JS and CSS in the project parts of
toaster to use bootstrap 3.

(Bitbake rev: 69527a731eada699d3f604ff8f3ae9410981ba9b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Elliot Smith 79e0eb9e52 bitbake: toaster: work-around our lack of a synchronous fetch for typeaheads
The Twitter typeahead.js library expects the developer to use
a source which does a local search for matching suggestions, then
falls back to a remote search if that doesn't return enough
results.

However, in Toaster, we don't do any caching of the suggestions
for a typeahead, so our source only works in asynchronous mode.

Consequently, we see fewer than the expected number of suggestions
if the typeahead has already shown suggestions matching a query.
For example, searching for "meta-n" in the layers typeahead will
show the results for this query; but when the query changes to
"meta-ne", a new set of results is fetched, which mostly overlaps
with the results for "meta-n". The typeahead assumes that the
overlapping items are locally cached and have been delivered
synchronously, and just appends the new results which don't
overlap with the previous query. But because we don't provide any
results synchronously, we just end up with the single
non-overlapping result in the drop-down.

This can be fixed by hacking typeahead.js so that instead of
appending asynchronous results, we always overwrite and redraw
the whole typeahead menu.

This is a temporary fix, and should be properly fixed (when we
have time), perhaps by using typeahead.js's associated Bloodhound
library.

Added a note about the hack to the license file as an explanation
of why the unminified JS file is included in Toaster.

(Bitbake rev: afbaf326e1123c92952fa71e0e820a4ff83488ca)

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-06-15 08:35:03 +01:00
Elliot Smith cd7b48cd0d bitbake: toaster: migrate typeahead library
Migrate from Bootstrap 2's built-in typeahead to Twitter's
typeahead library.

This is to facilitate moving to Bootstrap 3, which doesn't have
a typeahead.

(Bitbake rev: 0748177b40188a6fb735fe1ba1c17294afa4a3d0)

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-06-15 08:35:03 +01:00
Michael Wood 64622029d7 bitbake: toaster: tests Add a BuildTest helper class
Add a helper class for running build tests. Subclass this and call the
build method to get setup for running tests on the resulting data from a
build.

(Bitbake rev: 2cafb16033b2f38156e6e0a74c02120f87a4fa92)

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-06-15 08:35:03 +01:00
Belen Barros Pena 6f924f394a bitbake: toaster: tweaks to recipe file downloads
* In the custom images table, show the recipe file and download icon
only when the recipe file exists and can be downloaded.

* Also in the custom images table, make sure the download icon tooltip
shows on hover.

* In the custom image details page, show the correct icon (download)
next to the recipe file in the right hand column.

* In the custom image details page, show the recipe file and download
icon in the right hand column only when the recipe file exists and can
be downloaded

* Also in the custom image details page, simplify the help text we show
when the 'download' button is disabled: it gave so much information about
what's actually happening under the hood that it was a bit hard to
follow.

(Bitbake rev: 5d4172bc005efe209de595f6a151ae9ed062d051)

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-06-15 08:35:03 +01:00
Michael Wood abfd095a05 bitbake: toaster: testsjs Add call back to append elements on completion of tests
When the tests are complete add some marker elements to the test page
DOM which can then looked at for a selenium browser test.

(Bitbake rev: 81798ab046b0717614e28e0a339172f3803e451b)

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-06-15 08:35:03 +01:00
Ed Bartosh 2b362f6342 bitbake: toaster: fix urllib imports
Some functions have been moved from urllib to urllib.parse
in python 3. Modifying the code to import unquote, urlencode and
unquote_plus from urllib.parse if import from urllib fails should
make it working on both python 2 and python 3.

(Bitbake rev: b91aa29fa20befd9841678a727bb91100363518f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:05 +01:00
Ed Bartosh 2de58c97a5 bitbake: toaster: don't use mru.count in the template
mru is a list. It has a count method, but it differs from the
one for the queryset. Using mru.count causes 'Latest project builds'
section to silently disappear when toaster runs on python 3.

(Bitbake rev: c3ff90c9f028bff5733ebac7b5e72a4688addd3e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:05 +01:00
Ed Bartosh ce9cff5b28 bitbake: toaster: use // operator instead of /
Division operator works differently in Python 3. It results in
float unlike in Python 2, where it results in int.

Explicitly used "floor division" operator instead of 'division'
operator. This should make the code to result in integer under
both pythons.

(Bitbake rev: 0c38441ed99b49dae8ef9613e320f0760853d6aa)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 7cd768061b bitbake: toaster: use knotty when working with bitbake server
Using empty BITBAKE_UI environment variable causes bitbake server
to fail with the error:
    FATAL: Unable to import extension module "" from bb.ui
           Valid extension modules: knotty or toasterui\n'

Used BITBAKE_UI="knotty" when starting and stoping bitbake
server to solve above issue.

(Bitbake rev: b9a9ddfb6f53259be214032fb93812149d0cce19)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh de21205d3d bitbake: toaster: moved import bb.server.xmlrpc
Moved import xmlrpc module to the place where it's used
to avoid toaster crashes when importing bitbake code.

NOTE: This patch is made to be able to partly test toaster
with bitbake from master. It can be removed as soon as bb.server.xmlrpc
is ported to python 3.

(Bitbake rev: 0c5d691746fb02807568a8a470969a0b68e21915)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 5074c600f3 bitbake: toaster: read timezone files in binary mode
Used 'rb' mode to open files to avoid unicode error when code
runs on python 3:
   UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80
                       in position 44: invalid start byte

[YOCTO #9584]

(Bitbake rev: 1414866b84fe1fd674ea79500cd62eda3aa30b33)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh cf454d74a8 bitbake: toaster: use re.sub() instead of translate()
translate has different set of parameters in python 3 and
can't be used the way it's used in toaster api module.

Replacing it with re.sub() should make the code work in
both python 2  and python 3.

[YOCTO #9584]

(Bitbake rev: 7cc3a41139abc5b8d1eef4376fb19aba3910ce0d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh d393fe6cff bitbake: toaster: replace map with list comprehensions
map returns map object in python 3. Replaced calls of
map to equivalent list comprehensions in the code which
requires lists.

[YOCTO #9584]

(Bitbake rev: d41eb6d6c061cb35ec1ecd899f856876f9077167)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 314541f600 bitbake: toaster: use items and range instead of old APIs
Used items() and range() APIs instead of iteritems() and
xrange() as latter don't exist in python 3

[YOCTO #9584]

(Bitbake rev: 372dd3abcb201bd9ac2c3189c5505d3578ce0dd0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 96ce543150 bitbake: toaster: use decode('utf-8') for binary data
Decoded binary data to utf-8 to fix the following
error when runnign on python 3:
TypeError: Type str doesn't support the buffer API

[YOCTO #9584]

(Bitbake rev: 752ea00919ef054622a51ce097923309934eff2b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh 9a3f2b3912 bitbake: toaster: fix local imports
Replaced local imports with absolute imports.
Used .module for local imports.

This should make the code to work on python 2 and python 3.

[YOCTO #9584]

(Bitbake rev: 3f1e68c783308dcb51242d0fdeef758e581ccc8c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh 0224f75999 bitbake: toaster: fix imports to work for python 3
Some APIs have been moved to other modules in python 3:
 getstatusoutput: moved from commands to subproces
 urlopen: moved from urllib2 to urllib.request
 urlparse: moved from urlparse to urllib.parse

Made the imports work for both python versions by
catching ImportError and importing APIs from different
modules.

[YOCTO #9584]

(Bitbake rev: 1abaa1c6a950b327e6468192dd910549643768bb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh bbc6e754e8 bitbake: toaster: get rid of using reduce
Replaced compicated calls of reduce with more clear code.
As reduce was removed from python 3 this change is mandatory
for the code to work on both pythons.

Here is an example change for illustration purposes:

original code:

  querydict = dict(zip(or_keys, or_values))
  query = reduce(operator.or_, map(lambda x: __get_q_for_val(x, querydict[x]), [k for k in querydict])))

replaced with:

  query = None
  for key, val in zip(or_keys, or_values):
      x = __get_q_for_val(k, val)
      query = query | x if query else x

[YOCTO #9584]

(Bitbake rev: 249d0bc6094ec9f369a02b78d8ed634a239e5ee4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh 7c44d883b4 bitbake: toaster: use force_text instead of force_bytes
Usage of force_bytes in BuildRequest.__str__ method caused
python 3 to throw "__str__ returned non-string (type bytes)"
error.

Replaced force_bytes with force_text to make the code working
on both python 2 and python 3.

[YOCTO #9584]

(Bitbake rev: 9dd9c1393a84d1110c647e84253af8e0bb6acc45)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Michael Wood 409c940533 bitbake: toaster: tests builds Add SSTATE_MISS as a valid condition for tc=833
Task.SSTATE_NA and Task.SSTATE_MISS are both valid conditions for the
condition that a Task.OUTCOME_COVERED and Task.OUTCOME_PREBUILT.

(Bitbake rev: acac9bf660ac5939beb64d7b8d55541dea1c7b4e)

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-05-20 10:09:03 +01:00
Michael Wood 0664a89ef0 bitbake: toaster: tests build Add a test for a build of core-image-minimal
This is a port of the oe self test to the django test framework from
oe-core meta/lib/oeqa/selftest/_toaster.py

(Bitbake rev: 94418b1b2f9466d35461acdb982fd6b130b2331c)

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-05-20 10:09:03 +01:00
Michael Wood 085688c8ed bitbake: toaster: tests Add a BuildTest helper class
Add a helper class for running build tests. Subclass this and call the
build method to get setup for running tests on the resulting data from a
build.

(Bitbake rev: d1882371cae6b9a8296ea739e6e46ca6a6dc9da8)

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-05-20 10:09:03 +01:00
Michael Wood 5ce1adb177 bitbake: toaster: Add a specific test settings file
When running certain tests we want a particular database specified.
When bitbake toaster ui is being tested pass it these test settings so
that it uses the same database as the unit tests running.

(Bitbake rev: c52e34cac4362ba0a3cb3ea1fcb639e1d802aa85)

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-05-20 10:09:02 +01:00
Michael Wood 82dc991f48 bitbake: toaster: runbuilds move the execution sequence out of the poll loop
Move the execution sequence for a build out of the polling loop and into
it's own fuction. This means that we can call the function on it's own
if we just want to trigger one build rather than infinite polling.
This is something needed for the build tests.

(Bitbake rev: e8e059602c31394a4be5293e2ca0b8434fb4a8cf)

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-05-20 10:09:02 +01:00
Michael Wood db84307055 bitbake: toaster: Remove DATABASE_URL being passed around as an environment var
We don't need to pass the DATABASE_URL around and read it back if we
setup the django framework in the correct way.
We make the default sqlite database path a full path so that the
database isn't being assumed to be in CWD.

Also add some more useful comments on the database settings.

This is preparation work to migrate the build tests and be able to
trigger builds on differently configured databases.

(Bitbake rev: 973c740404ca6a09feea250d3433075995067fe0)

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-05-20 10:09:02 +01:00
Sujith H 8fba59ce45 bitbake: toaster-tests: tests for project config
Add basic tests to validate the value user types
in the text box for IMAGEFS_TYPES. Added a test
case to show the checkbox get automatically selected
when user types value available in the check list.
Added a test case to verify if the check box is enabled
then the text box should also get updated accordingly.

[YOCTO #7828]

(Bitbake rev: 62c74eb38f44d98b40427edf56e40785b076a938)

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-05-20 10:09:02 +01:00
Belen Barros Pena 1aab29ed8d bitbake: toaster: projectconf Small tweaks to IMAGE_FSTYPES form
Add a label to clarify the purpose of the first input field, replace <p>
with <label> for the second set of controls, and give some top margin to
the validation message.

(Bitbake rev: 99b1b52fe4f2b593d7835d2db64eb028ed42600a)

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-05-20 10:09:02 +01:00
Sujith H c81d03e8a3 bitbake: toaster: handle multiple imagefs types
This functionality helps users to add custom
image fs types available other than the checkboxes
in the UI. User can add imagefs types in the text
box and use them in the build.

[YOCTO #7828]

(Bitbake rev: c14cbb026598be064f08f46bb513456c7a3089f5)

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-05-20 10:09:02 +01:00
Elliot Smith 74ae91e0bd bitbake: toaster: don't show "Rebuild" button for cancelled cli builds
[YOCTO #8515]

(Bitbake rev: 71a45c600e47af5a19412bc3c5a9ba242bfb4638)

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-05-17 14:43:30 +01:00
Michael Wood 3718f8d90c bitbake: toaster: toastergui tests Fix toastertable tests
After clean ups remove api assumptions. Our table data often contains
html snippets to display certain things such as dependency pop overs or
simply links to other parts of the UI. Take these into account when
testing the values of the table data.

(Bitbake rev: 7f61a68f2caba538e302ca9c2727bb43a6c77c64)

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-05-17 14:43:30 +01:00
Michael Wood 54bf7cce48 bitbake: toaster: toastertables: Clean up and fix up a number of items
- Remove the unused 'computation' field
 - Remove the code to try to make the tables behave like an api
 - Remove custom JSON encoder in favour of DjangoJSONEncoder
 - Simplify get_data and add comments
 - Add exception type instead of using generic Exception
 - Clean up python style warnings

(Bitbake rev: 16d8198e8f6668c5fa5467ff4bda86c5d66a6cad)

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-05-17 14:43:30 +01:00
Ed Bartosh 0854035d9c bitbake: toaster: use new syntax of except statement
Used except 'except (<exception1>, <exception2>):' syntax as it's
supported by python 2 and pythone 3.

Old syntax 'except <exception1>, <exception2>:' is not supported
by python 3.

[YOCTO #9584]

(Bitbake rev: d19e305ffa44a848b02ede63dc5de8d2640089e6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:15 +01:00
Ed Bartosh 3249e33251 bitbake: toaster: use 'in' instead of has_key
Dictionary method has_key is deprecated in python 2 and absent
in python 3.

Used '<key> in <dict>' statement to make the code working on
both python 2 and python 3.

[YOCTO #9584]

(Bitbake rev: 3d7ad7ba0d1a6f688ae885817c049f2a8ced11b5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:15 +01:00
Elliot Smith 3d11229aa1 bitbake: toaster: fix progress bar in MySQL environment
When using MySQL, the project builds info delivered by MySQL
differs from that delivered by SQLite: the former returns text
values from the enumeration for Build outcomes, while the latter
returns the integer value. This causes the progress bar JS to
break, as it is expecting outcome strings.

Modify the recent_build() method to include an outcomeText property
for each Build object, then use this in the conditionals in the
progress bar JS.

[YOCTO #9498]

(Bitbake rev: 7ac374adf1cc70173ff6cc492bc078bba1cf500b)

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-05-13 17:45:49 +01:00
Michael Wood 28433319ad bitbake: toaster: tests browser Add test for creating a project
Add browser tests for creating a project and test validation of
duplicate project names.

(Bitbake rev: 8055fbe840db426d6859ee2248f86abd44244b30)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 11:32:58 +01:00
Michael Wood cd4f0b3a83 bitbake: toaster: models Add missing import sys
(Bitbake rev: b2fba7a0820d77e1076c05b8ffcd960d4fc883a5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 11:32:58 +01:00
Sujith H 7e2d5017be bitbake: toaster: ui handles duplicate project name in project page
When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name. When an existing project is typed the save
button will be disabled. Else user can proceed ahead by
modifying the project name.

[YOCTO #7005]

(Bitbake rev: 05ddf48cda6690adab4c097b16387578523e751b)

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-05-11 11:32:58 +01:00
Sujith H dc57476d0b bitbake: toaster: ui handles duplicate project name in new project page
When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name.

[YOCTO #7005]

(Bitbake rev: 83e5be7e74850f1bb019668de07f3f745063fe38)

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-05-11 11:32:58 +01:00
Sujith H 9bdfed856b bitbake: toaster: projectNameValidation API added
The projectNameValidation API would help users
to validate if a project name exists or not. This
API is added to libtoaster.

[YOCTO #7005]

(Bitbake rev: 3b1843553f23d78f1ddfec9f7865895ee42356a3)

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-05-11 11:32:58 +01:00
Richard Purdie 3795f4d6a6 bitbake: bin, toaster: Fix print and exception syntax
This updates the print "" syntax to print() and fixes some exception
handling syntax such that its compatible with python v2 and v3.

(Bitbake rev: 58304fcce9727fd89564436771356c033ecd22a3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:34:30 +01:00
Richard Purdie 654eadfa30 bitbake: bitbake: Update logger.warn() -> logger.warning()
python deprecated logger.warn() in favour of logger.warning(). This is only
used in bitbake code so we may as well just translate everything to avoid
warnings under python 3. Its safe for python 2.7.

(Bitbake rev: 676a5f592e8507e81b8f748d58acfea7572f8796)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:34:30 +01:00
Michael Wood fce42a28cc bitbake: toaster: customrecipe Only show download icon or button if it's possible
If the based on recipe has not yet been checked out/cloned we cannot
generate the custom image recipe file that uses it. So disable/remove
the option to download it.

[YOCTO #9425]

(Bitbake rev: f08651a954358e9c6ce4d69de285e4cd9e1408ae)

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-05-06 10:12:16 +01:00
Michael Wood d3b5b0b4bb bitbake: toaster: orm Add get_base_recipe_file to CustomImageRecipe
This function returns the base recipe file path only if it currently
exists. This allows us to know whether we can proceed at this point with
generating a custom image recipe. It also enables us to call this
function from the templates to enable visual indication of this state.

Some whitespace fixes also added in generate_recipe_file_contents

(Bitbake rev: bc30d1b235b9ecacef5b2eaa851b9247d857f317)

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-05-06 10:12:16 +01:00
Elliot Smith d9dd864c68 bitbake: toaster-tests: tests for build dashboard
Convert existing tests to Selenium.

Add basic tests to check that the modal contains radio buttons to select
a custom image to edit when a build built multiple custom images, and
to create a new custom image from one of the images built during
the build.

[YOCTO #9123]

(Bitbake rev: c07f65feaba50b13a38635bd8149804c823d446a)

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-19 21:11:26 +01:00
Elliot Smith 1cf8f215b3 bitbake: toaster: add modal to select custom image for editing
Add functionality to the placeholder button on the build dashboard
to open a modal dialog displaying editable custom images, in cases
where multiple custom images were built by the build. Where there
is only one editable custom image, go direct to its edit page.

The images shown in the modal are custom recipes for the project
which were built during the build shown in the dashboard.

This also affects the new custom image dialog, as that also has
to show custom image recipes as well as image recipes built during
the build. Modify the API on the Build object to support both.

Also modify and rename the queryset_to_list template filter so that
it can deal with lists as well as querysets, as the new custom image
modal has to show a list of image recipes which is an amalgam of two
querysets.

[YOCTO #9123]

(Bitbake rev: 8c2aea3fa8e1071de60390e86e2536904fa9b7c0)

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-19 21:11:26 +01:00
Elliot Smith a40a3e6def bitbake: toaster: add build dashboard buttons to edit/create custom images
When a build is viewed in the dashboard, enable users to edit
a custom image which was built during that build, and/or create
a new custom image based on one of the image recipes built during
the build.

Add methods to the Build model to enable querying for the
set of image recipes built during a build.

Add buttons to the dashboard, with the "Edit custom image"
button opening a basic modal for now. The "New custom image"
button opens the existing new custom image modal, but is modified
to show a list of images available as a base for a new custom image.

Add a new function to the new custom image modal's script which
enables multiple potential custom images to be shown as radio
buttons in the dialog (if there is more than 1). Modify existing
code to use this new function.

Add a template filter which allows the queryset of recipes for
a build to be available to client-side scripts, and from there
be used to populate the new custom image modal.

[YOCTO #9123]

(Bitbake rev: 4c49ffd28e41c4597bdac34d5e54c125571a4b95)

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-19 21:11:26 +01:00
Elliot Smith e65c9808e9 bitbake: toaster-tests: make helper click on input before entering text
The Selenium helper's enter_text() method doesn't cause
keyup events to trigger unless the element where text is
being entered has been clicked.

Prefix all text entry with a click() on the element to ensure
that keyup events fire.

(Bitbake rev: cea34880ad3847bd0e24c9b650eb816e1757cf2b)

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-19 21:11:26 +01:00
Elliot Smith 484cbf81cf bitbake: toaster-tests: add tests for new custom image page
Test adding a new custom image when:

1. No custom images are in the project yet.
2. User tries to add custom image which duplicates the name of
an existing custom image.
3. User tries to add custom image which duplicates the name
of a non-image recipe.

[YOCTO #9209]

(Bitbake rev: 21c1f8f8e30ef868ea6fd861eea1389f149f1049)

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-19 21:11:25 +01:00
Elliot Smith 437b728a9f bitbake: toaster: prevent exception when Project.release is null
Project.release can be null. This causes an exception when calling
get_all_compatible_layer_versions(), as the query to fetch
the layer versions references release.branch_name.

Add a guard to the function so that an empty queryset is returned
if the release isn't set for a project.

(Bitbake rev: 6919a2b2e412a9e7b652a6bc191e7c1bed035222)

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-19 21:11:25 +01:00
Elliot Smith cfc22d3a9e bitbake: toaster: only prevent duplicate custom image names within a project
We currently prevent the same name being used for multiple custom
images, but make the check across all projects. This means that
custom image names have to be unique across all projects in
the Toaster installation.

Modify how we validate the name of a custom image so that we
only prevent duplication of custom image names within a project,
while ensuring that the name of a custom image doesn't duplicate
the name of a recipe which is not a custom image recipe.

[YOCTO #9209]

(Bitbake rev: 9abbb46e799c06757e03addd54e3f5d3c0fe2886)

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-19 21:11:25 +01:00
Elliot Smith 3036413000 bitbake: toaster: disable/enable "Add layer" button according to input's content
In the import layer page, the "Add layer" button in the layer dependencies
section doesn't accurately reflect whether the layer name in the
corresponding input can be added. A partial or empty layer name can
leave the button active, such that when it is clicked, a
previously-selected layer can be accidentally added.

Fix by keeping track of the items currently available in the typeahead,
only activating the "Add layer" button when the input matches the name
of one of those items.

[YOCTO #8511]

(Bitbake rev: dbb4f0282ded361baf9e5a0346e134bece5314b9)

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-19 21:11:25 +01:00
Elliot Smith 040dbf6988 bitbake: toaster: fix sorting after hiding a column in build tables
When hiding a column in the build tasks or build packages included
table, if the column is set as the current order by for the table, the
order by is not reset to the default. The result is that the table
stays sorted by the hidden column.

Set the default_orderby for these two tables correctly to ensure the
corresponding table is re-sorted when a column is hidden, if that column
was being used as the order by.

[YOCTO #9011]

(Bitbake rev: b99e1012f0ad1dc82a769df15a232280c8e57b9e)

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-19 21:11:25 +01:00
Michael Wood 1b11b79f50 bitbake: toaster: ensure ToasterTable headings are reset when order by changes
If a ToasterTable is ordered by an optional column and that
column is subsequently hidden, the table ordering switches back
to the default ordering for the table. However, the table headings
don't update to reflect the new ordering. This is because the
code which sets the heading weight and hides/shows the caret symbols
only runs when the table is first loaded.

Store the default order by and re-apply it when the data is updated.

[YOCTO #9011]

(Bitbake rev: 820761e664cd2d62cc6c333a0e59580b0c4a034d)

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-04-19 21:11:25 +01:00
Dave Lerner 52cfdb6a88 bitbake: toaster: fixes for customimage package not found
For a custom image, if a search for a package results in no packages
found, then additional information should be presented to the user.
This is different than a 'no results' found for a search in other
contexts, for example, a search for a package in a non-customised build.
For a custom image, a package search failure can happen because the
package was not added to the custom image. This commit presents more
information to the user, suggesting why the package was not found in the
custom image.
The generic table view handling js changes to handle a new div
element no-results-special-... such that, if present, that template
section is shown rather than the default no-results-... section.

[YOCTO #9154]

(Bitbake rev: 66b7c7ef61058b52031d71b10effcfe69afbd57b)

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-04-09 23:00:46 +01:00
Michael Wood 013984dc45 bitbake: tests: browser Add test to run the js unit tests
(Bitbake rev: 81ccbf243050a5a9245d2de4c1de342771c09a59)

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-04-06 23:10:31 +01:00
Michael Wood 7609888b6a bitbake: toaster: views jsunittest Add MACHINE and an extra layer to test project
Add set a MACHINE if needed and add a layer. When we're running in the
context of the django unit tests we don't have these defaults setup for
the project so add them.

(Bitbake rev: a0c1432f32930a17e10d50c08c2aa84a0659514b)

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-04-06 23:10:31 +01:00
Michael Wood fbc2c5dcd4 bitbake: toaster: tests Set MACHINE for the test projects
(Bitbake rev: 6288a3bd6678ed1c7863cfde6eb33b7c28207777)

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-04-06 23:10:31 +01:00
Michael Wood cb6b4eb479 bitbake: toaster: Add quint to project so that it can be used offline
Currently we're using a hosted version of quint however this means that the
testing has to be online or have a cached version of quint. Add the
files to Toaster to be able to use offline.

(Bitbake rev: fc5024e2ed0e4ec2ee234a42fd0403c70c3f819e)

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-04-06 23:10:31 +01:00
Dave Lerner 18cb7fe426 bitbake: toaster: add rev dep column to image detail pages
Add a column to the custom image pages that shows the reverse
dependencies in a format matching the dependencies column:
  - either blank or a button showing the count of reverse dependencies,
  - when the button is clicked, a popover appears showing the list
    of reverse dependencies, with each package's size, and the total
    size of all of the reverse dependencies.

The implementation adds a packages table method to retreive the reverse
dependency total size, and adds a separate 'popover' html template. Both
of these changes follow the pattern for the dependencies column.

[YOCTO #9163]

(Bitbake rev: 2f978dccaa1ec82c7ad350bdc1cd9500000984eb)

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-04-06 23:10:31 +01:00
Ed Bartosh 52c8740e1b bitbake: toaster: get bitbake location from BBBASEDIR
It was incorrectly assumed in the current code that bitbake is in
../bitbake/bin/ directory. It's not always the case.
Using bitbake from $BBBASEDIR should be .

(Bitbake rev: 6c9e3375d278bee712c41f07428bc82108b9aaae)

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:30 +01:00
Sujith H 71ff9b9e0e bitbake: toaster: update projectconf.html for DL_DIR and SSTATE_DIR
Modified the projectconf.html to include DL_DIR and
SSTATE_DIR. Updated the script section in the html
to handle the changes made by the user on DL_DIR
and SSTATE_DIR. Included validation check for the
folder names.

[YOCTO #8422]

(Bitbake rev: bd9f8973d4c9c0722874a058466b1b911112500e)

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:30 +01:00
Sujith H 705d44fc0d bitbake: toaster: update view to support DL_DIR and SSTATE_DIR
Update toaster's views.py to support DL_DIR and SSTATE_DIR for
page projectconf.html. Removed DL_DIR and SSTATE_DIR from
blacklist. Initial value of DL_DIR and SSTATE_DIR comes from
BuildEnvironment.

[YOCTO #8422]

(Bitbake rev: 9f672d7ba503d17175eef37ec03a5779e4c9f792)

Signed-off-by: Sujith H <sujith.h@gmail.com>
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:30 +01:00
Ed Bartosh 4aafcae5e4 bitbake: toaster: use empty token
If client xmlrpc token is not provided in the command line, bitbake
generates random token. Server token in --server-only mode is always
empty. This doesn't allow clients with non-empty tokens to connect
to the server. Specifying empty token should stop generation of
random token and make it possible for clients to communicate with
the server.

(Bitbake rev: b54ec2d7cb9f2fb4ff1e8af11b6ecf97d181272c)

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:30 +01:00
Michael Wood 5ce4665f26 bitbake: toaster: runbuilds Clean up runbuilds
- Organise the imports into logical groups
- Fix 80 col wrapping
- Remove catch all exceptions
- Log to the toaster log
- Use QuerySet functions such as .first() and Q()

(Bitbake rev: c382f550c62437954205c7dd9c7e1891d5d03945)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Michael Wood 55b6fabd75 bitbake: toaster: runbuilds Make runbuilds aware of the build CANCELLED state
Add handlers to make sure we remove the BuildEnvironment LOCK when we
have cancelled a build.

(Bitbake rev: 23d0a7f9664450a09c2610631b38590a09b33744)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Michael Wood f4cee8840e bitbake: toaster: models Exclude the CANCELLED builds from get_number_of_builds
Don't count CANCELLED builds when returning the number of builds.

(Bitbake rev: c3c29fd4eb5116b771e8e16281d4e3cdf4fae165)

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 296d3733df bitbake: toaster: mrb_section template Add build cancel button
Add the cancel build button to the mrb section template and add the event
handlers to cancelABuild.
Also clean up the calls to startABuild to use the updated libtoaster methods
and to make the code consistent with it's cancelABuild counterpart.

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

(Bitbake rev: 6b82ffca1aa9ca2d0feec64b15466bc8ba160011)

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 f1b49dc4b6 bitbake: toaster: tables BuildsTable exclude cancelled builds
Exclude cancelled builds from showing in the builds table

[YOCTO #6787]

(Bitbake rev: a724d6aa7515e712a1d656e46e1d0f3bf7d4cea9)

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:29 +01:00
Michael Wood 9dcb9cb2cc bitbake: toaster: bldcontrol models Add a cancelling state the BuildRequest
To accurately reflect the state of a build request we also need a
cancelling state. This is set when we've started a build and then for
whatever reason cancel it, cancelling is not instantaneous so we have
this state to indicate that a cancel is in progress.

Also add a state transition guard. As the state of a BuildRequest can
currently be modified by three processes; Toastergui,
Runbuilds/bldcontrol and the buildinofhelper we cannot say for sure
which process will be running at the time of cancellation so in order to
avoid one of these processes making an incorrect transition only allow
transitions of state to increase.

e.g. CREATED -> QUEUED -> INPROGRESS
And to ignore such requested changes such as
INPROGRESS -> CREATED

(Bitbake rev: 449598c8e6be75bd0c9d59e7bdf859d1d6f83858)

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 dfa85109d6 bitbake: toaster: models Add cancelled state to build outcome
A new state CANCELLED is introduced to, distinguish
the state of build.

[YOCTO #6787]

(Bitbake rev: 404f406fecae879703bcfe96f3b65086b115fa8a)

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:29 +01:00
Sujith H 5f862bb567 bitbake: toaster: update BuildEnvironmentController and BitbakeController
Remove getBBController function from BuildEnvironmentController.
The constructor of BitbakeController is updated appropriately so that
call can be made to connect to running server.
The call to startBBServer is removed from bbcontroller and  handledin
localhostbecontroller.

[YOCTO #6787]

(Bitbake rev: e15151106aae21d3b164ca868be42bd63905f0a1)

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:29 +01:00
Michael Wood 0db62c54a4 bitbake: toaster: libtoaster Update implementation of startABuild and cancelABuild
Update the implementation of startABuild and cancelAbuild to reflect
changes to the backend api. We now have a dedicated endpoint to make
calls into so add this url to libtoaster.ctx and allow passing null in
as a url value to indicate that we want to use the current project

Also:
 - Fix some documentation comments
 - Add the convenience of passing in an array of targets to startABuild

(Bitbake rev: 61a21d96abab113cbd13376cdb8b08a426b50538)

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 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