]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
9 years agotoaster: tables Add default_orderby field where it was missing or unset
Michael Wood [Thu, 26 Nov 2015 16:44:33 +0000 (16:44 +0000)] 
toaster: tables Add default_orderby field where it was missing or unset

This value is used to set the default ordering of the model that is used
for ToasterTables, it is picked up client side to set the ordering
indicator.

[YOCTO #8695]

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>
9 years agotoaster: CustomImageRecipe add search_allowed_fields to this model
Michael Wood [Thu, 26 Nov 2015 16:44:32 +0000 (16:44 +0000)] 
toaster: CustomImageRecipe add search_allowed_fields to this model

In order to search the model from the UI some fields must be nominated
as searchable.

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>
9 years agotoaster: machines table Fix missing layers information needed for filter
Michael Wood [Thu, 26 Nov 2015 16:44:31 +0000 (16:44 +0000)] 
toaster: machines table Fix missing layers information needed for filter

The current layers information wasn't being passed to the template for
the Select/Add button for the Compatible machines filter.

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>
9 years agotoaster: tablejs Make sure click handlers consume click event
Michael Wood [Thu, 26 Nov 2015 15:59:01 +0000 (15:59 +0000)] 
toaster: tablejs Make sure click handlers consume click event

Avoid the click event from propagating and causing strange side effects
in toaster tables.

[YOCTO #8527]
[YOCTO #8148]

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>
9 years agotoaster: projectpage Make sure build targets are space separated
Michael Wood [Thu, 26 Nov 2015 14:54:29 +0000 (14:54 +0000)] 
toaster: projectpage Make sure build targets are space separated

Make sure the build targets are space separated when building multiple
targets. Also fix error path now that YOCTO #7995 is resolved.

[YOCTO #8450]

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>
9 years agotoaster: builds pages Fix the download cooker log link
Belen Barros Pena [Tue, 10 Nov 2015 17:08:03 +0000 (17:08 +0000)] 
toaster: builds pages Fix the download cooker log link

The 'all builds' page was missing the download icon next to the outcome
icon, which allows you to download a build log from the 'all builds' page.

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

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>
9 years agotoaster: project pages Link to image recipes table in notifications
Belen Barros Pena [Tue, 10 Nov 2015 17:08:02 +0000 (17:08 +0000)] 
toaster: project pages Link to image recipes table in notifications

The project created notifications and the 'Choosea recipe to build' link in
the project page are linking to the software recipes table. Changes them to
link to the image recipes table instead, which is bound to be more useful.

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>
9 years agotoaster: tests: Re-write some cases to make them more maintainable
Ke Zou [Wed, 4 Nov 2015 14:32:22 +0000 (14:32 +0000)] 
toaster: tests: Re-write some cases to make them more maintainable

Signed-off-by: Ke Zou <ke.zou@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata_smart: Only support lowercase OVERRIDES
Richard Purdie [Sun, 11 Oct 2015 09:21:20 +0000 (10:21 +0100)] 
data_smart: Only support lowercase OVERRIDES

Our current OVERRIDES handling means we end up caching and checking for
a lot of possible override combinations which turn out to very unlikely.
A typical example is the SRC_URI variable where we have to check if
"URI" is an override. Having spent many hours working in this code, I've
realised all the actual overrides we use are lower case and our standard
variables are mostly uppercase.

This means we could gain quite some speed advantage if we write this
into the code, that overrides only consist of lowercase characters. This
patch shows how simple this is and the resulting speed gains are
significant. This is a significant change but tests show we don't appear
to have any users of capitals in overrides in any OE-Core metadata.

Before "time bitbake -p":

real 2m4.224s
user 7m32.312s
sys 0m7.116s

After "time bitbake -p":

real 1m26.009s
user 5m10.484s
sys 0m4.640s

This check could also be made conditional however I'm not seeing a need
to do that at present.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: Remove crazy code in unpack
Richard Purdie [Tue, 10 Nov 2015 09:56:51 +0000 (09:56 +0000)] 
fetch2: Remove crazy code in unpack

This looks reasonable until you realise self.localpath is a function. Data
expansion of something which isn't a string is the original value so this
code just wastes CPU cycles and makes no sense. Remove it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoparse: Don't try to expand __base_depends/__depends
Richard Purdie [Tue, 10 Nov 2015 09:55:49 +0000 (09:55 +0000)] 
parse: Don't try to expand __base_depends/__depends

Trying to expand a variable which isn't a string doesn't make sense.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Don't try to expand __inherit_data
Richard Purdie [Tue, 10 Nov 2015 09:54:44 +0000 (09:54 +0000)] 
cache: Don't try to expand __inherit_data

Trying to expand a variable which isn't a string doesn't make sense.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: localhostbectrl Pass DATABASE_URL in via the process environment
Elliot Smith [Fri, 13 Nov 2015 15:28:07 +0000 (15:28 +0000)] 
toaster: localhostbectrl Pass DATABASE_URL in via the process environment

Instead of putting the DATABASE_URL as part of the command for launching
the bitbake observer process set it as part of environment.

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

[YOCTO #8669]

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>
9 years agotoaster: Remove the new-build-input button widget
Michael Wood [Fri, 13 Nov 2015 13:48:37 +0000 (13:48 +0000)] 
toaster: Remove the new-build-input button widget

The button required a lot of state maintenance to make sure it
showed up when the project was configured properly, showed correctly
according to the projects known to Toaster, displayed correctly
according to the mode Toaster was in, and was able to be
used to change the current project.

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>
9 years agotoaster: projecttopbar Use the project in context to get num builds
Michael Wood [Fri, 13 Nov 2015 13:48:36 +0000 (13:48 +0000)] 
toaster: projecttopbar Use the project in context to get num builds

Use the project in the template context rather than ajax request to get
the number of ended builds.

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>
9 years agotoaster: projectpage Disable/Enable build input if we have 0 layers
Michael Wood [Fri, 13 Nov 2015 13:48:35 +0000 (13:48 +0000)] 
toaster: projectpage Disable/Enable build input if we have 0 layers

If we've removed all the layers in the configuration, disable the build
button and build input.

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>
9 years agotoaster: orm Fix get_number_of_builds to count all apart from IN_PROGRESS
Michael Wood [Fri, 13 Nov 2015 13:48:34 +0000 (13:48 +0000)] 
toaster: orm Fix get_number_of_builds to count all apart from IN_PROGRESS

The count of a project's builds should not include those which are
currently in progress.

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>
9 years agocodeparser: Only load the codeparser cache once
Richard Purdie [Wed, 11 Nov 2015 16:56:32 +0000 (08:56 -0800)] 
codeparser: Only load the codeparser cache once

The server state gets reset multiple times during startup and currently
we reload the codeparser cache each time. This is pointless and causes
unnecessary interaction time with bitbake.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoasterui: Create per-build logs
Elliot Smith [Thu, 29 Oct 2015 11:59:44 +0000 (13:59 +0200)] 
toasterui: Create per-build logs

Rather than relying on bug 8411, which is conveniently creating
separate log files for each of our builds, create our own
log file for each build.

The log files are created in the same tmp directories that
bitbake users, but are timestamped to the millisecond to avoid
name collisions.

Each log file is opened on a ParseStarted event (for builds
triggered by Toaster) or BuildStarted event (for builds on the
command line: Toaster doesn't get the ParseStarted event
for command-line builds).

The log file is closed on the BuildCompleted event, or if the
build fails.

Because we start logging on ParseStarted for Toaster builds,
we're able to capture the "Build Configuration" section which
bitbake writes to output.

[YOCTO #8373]

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>
9 years agobuild/utils: Add BB_TASK_IONICE_LEVEL support
Richard Purdie [Sat, 24 Oct 2015 10:19:06 +0000 (11:19 +0100)] 
build/utils: Add BB_TASK_IONICE_LEVEL support

Similarly to BB_TASK_NICE_LEVEL, add BB_TASK_IONICE_LEVEL which allows the ioprio
of tasks to be adjusted. This is in response to various qemu runtime timeouts
which have been witnessed on the autobuilder, seemingly due to IO starvation (we
already use NICE_LEVEL to adjust tasks). This has a fairly urgent need to deal
with certain 'random' failures we're seeing on the autobuilders in testing.

The format of the data in the variable is BB_TASK_IONICE_LEVEL = "<class>.<prio>".

For <class>, 2 is best effort (the default), 1 is real time and 3 is idle. You'd
need superuser privileges to use realtime. The <prio> value is a default of 4,
and can be set between 0 and 7 with 7 being lowest priority and 0 the highest.
The user can set this freely with normal privileges

Note that in order for this to take effect, you need the cfq scheduler selected
for the backing block device.

We could use nice wrapper functions for ioprio from modules like psutil however
that would complicate bitbake dependencies. This version has some magic numbers
but works on the main 32 and 64 bit x86 build architectures and can easily be
extended if ever needed. When we move to python 3.x, we can likely replace this
with standard calls.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Ensure BB_CONSOLE remains correct over server resets
Richard Purdie [Sun, 11 Oct 2015 09:22:26 +0000 (10:22 +0100)] 
cooker: Ensure BB_CONSOLE remains correct over server resets

The console log data is written to is created at console initialisation
time and does not change over reset events. This ensures the
BB_CONSOLELOG value is correct over such resets by preserving it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb/ui: Use getSetVariable command for BB_CONSOLELOG
Richard Purdie [Sun, 11 Oct 2015 09:12:42 +0000 (10:12 +0100)] 
bb/ui: Use getSetVariable command for BB_CONSOLELOG

Metadata can define BB_CONSOLELOG as containing ${DATETIME} and
this can get expanded to a different value each time the variable
is read. In the case of BB_CONSOLELOG, this behaviour is not
desireable.

The values of DATE/TIME are locked down at build time but this is too
late for the purposes of ensuring the system can figure out the real
value of BB_CONSOLELOG.

The best way to do this is to set the variable into the datastore, thereby
preserving its value.

[YOCTO #8411]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocommand: Add getSetVariable command
Richard Purdie [Sun, 11 Oct 2015 09:11:47 +0000 (10:11 +0100)] 
command: Add getSetVariable command

There are some use cases where we want to read a variable but also
set the variable to the value read, effectively locking in any
expansion of it. This adds such a command.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Added new description for BB_TASK_IONICE_LEVEL
Scott Rifenbark [Tue, 27 Oct 2015 16:15:10 +0000 (09:15 -0700)] 
bitbake-user-manual: Added new description for BB_TASK_IONICE_LEVEL

Added a new variable description here for this variable.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Added BBTARGETS variable description.
Scott Rifenbark [Tue, 29 Sep 2015 19:35:41 +0000 (12:35 -0700)] 
bitbake-user-manual: Added BBTARGETS variable description.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: templates Add meaningful title tags
Belen Barros Pena [Wed, 28 Oct 2015 14:22:05 +0000 (14:22 +0000)] 
toaster: templates Add meaningful title tags

Our title tags are all over the place, and have no relation to the page
content. This commit adds a meaningful title tag to each Toaster page.

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>
9 years agotoaster: orm Fix restrictive LogMessage message length
Michael Wood [Thu, 22 Oct 2015 10:22:28 +0000 (11:22 +0100)] 
toaster: orm Fix restrictive LogMessage message length

Log messages can be quite long so use a TextField rather than a char
field with max length of 240. mySQL is especially picky about field
lengths and will cause an exception if the log is too long.

[YOCTO #8475]

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>
9 years agotoaster: Remove all navigation when not in build mode
Elliot Smith [Sat, 17 Oct 2015 17:45:53 +0000 (10:45 -0700)] 
toaster: Remove all navigation when not in build mode

The user is redirected to the all builds page or all projects
page from the landing page, regardless of mode.

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

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

[YOCTO #8514]

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>
9 years agotoaster: Run tests in build mode
Elliot Smith [Sat, 17 Oct 2015 17:45:52 +0000 (10:45 -0700)] 
toaster: Run tests in build mode

Now that the UI content is conditional on whether BUILD_MODE
is active, modify the existing tests so that they run in
this mode by default.

[YOCTO #8514]

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>
9 years agotoaster: Hide builds for non-cli projects in analysis mode
Elliot Smith [Sat, 17 Oct 2015 17:45:51 +0000 (10:45 -0700)] 
toaster: Hide builds for non-cli projects in analysis mode

The "latest builds" sections of the "all builds" page
show builds for all projects. This is not appropriate
for analysis mode, where we can only affect the command-line
builds project.

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

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

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

[YOCTO #8514]

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>
9 years agotoaster: Hide top bar buttons in analysis mode
Elliot Smith [Sat, 17 Oct 2015 17:45:50 +0000 (10:45 -0700)] 
toaster: Hide top bar buttons in analysis mode

The "new build" and "new project" buttons are irrelevant in
analysis mode, as you can't start a build or a project.

Hide these buttons if not in BUILD_MODE.

[YOCTO #8514]

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>
9 years agotoaster: Show mode-appropriate landing page
Elliot Smith [Sat, 17 Oct 2015 17:45:49 +0000 (10:45 -0700)] 
toaster: Show mode-appropriate landing page

The same landing page is shown for both analysis and
build modes. This means that users in analysis mode can see
options which are not available or broken in that mode.

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

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

[YOCTO #8514]

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>
9 years agotoaster: Add BUILD_MODE flag to context
Elliot Smith [Sat, 17 Oct 2015 17:45:48 +0000 (10:45 -0700)] 
toaster: Add BUILD_MODE flag to context

We set a TOASTER_MANAGED env variable in the startup script,
which has a value of "1" if Toaster should run in build mode.

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

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

[YOCTO #8514]

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>
9 years agotoaster: add get_or_create_targets API
Ed Bartosh [Fri, 16 Oct 2015 17:31:12 +0000 (10:31 -0700)] 
toaster: add get_or_create_targets API

Target objects are created before the build if build is
started from UI in build mode. However, in analysis mode Target
objects don't exist and need to be created using information
from bitbake events.

Added new API call get_or_create_targets to retrive existing
target objects or create them if they don't exist yet.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetcher: svn: Add support for checkout to a custom path
Jens Rehsack [Fri, 16 Oct 2015 17:14:04 +0000 (19:14 +0200)] 
fetcher: svn: Add support for checkout to a custom path

Add support for the Subversion fetcher to checkout modules to a custom path
than the module name to avoid checkout is always module - svn is path
based and tag/branch-checkout might break builds because of invaid path specs.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: preserve pre and post configs
Ed Bartosh [Fri, 16 Oct 2015 16:23:58 +0000 (19:23 +0300)] 
cooker: preserve pre and post configs

Additional config files passed to bitbake server with --read and
--postread options are rewritten by client bitbake even if
it doesn't use those options.

This is a show stopper for toaster as toaster command line
builds are based on the assumption that server is aware of
toster configs, provided by --postread option.

This behaviour is fixed by preserving values of --read and
--postread options when bitbake server starts and restoring
them if client bitbake doesn't explicitly specify them.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Add tests for error message display on the build dashboard
Elliot Smith [Tue, 13 Oct 2015 14:35:17 +0000 (15:35 +0100)] 
toaster: Add tests for error message display on the build dashboard

Add tests to ensure that log messages with CRITICAL level and
with EXCEPTION level are shown in the main errors display
on the build dashboard.

[YOCTO #8320]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster: Modify "New build" button behaviour for cli builds project
Elliot Smith [Mon, 5 Oct 2015 15:39:36 +0000 (16:39 +0100)] 
toaster: Modify "New build" button behaviour for cli builds project

The "New build" button should only be displayed if there are
user-generated projects, not if there is only the command-line
builds project. (Toaster can't run builds on behalf of the
command-line builds project.)

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

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

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

[YOCTO #8231]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: Clean up template code
Elliot Smith [Fri, 2 Oct 2015 17:03:55 +0000 (18:03 +0100)] 
toaster: Clean up template code

Some errors in the HTML template didn't show up until
they were rendering command line builds.

One useless conditional was lingering in another template.

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

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: More linting of tests
Elliot Smith [Fri, 2 Oct 2015 15:13:04 +0000 (16:13 +0100)] 
toaster: More linting of tests

Fix some more lint errors on the tests for toastergui.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: Show tooltip next to cli builds project name in all builds
Elliot Smith [Fri, 2 Oct 2015 14:49:17 +0000 (15:49 +0100)] 
toaster: Show tooltip next to cli builds project name in all builds

In the all builds page, show an icon with tooltip next to the
command line builds project name.

[YOCTO #8231]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: Hide tabs and add info popups for command line builds
Elliot Smith [Fri, 2 Oct 2015 13:23:35 +0000 (14:23 +0100)] 
toaster: Hide tabs and add info popups for command line builds

Command line builds don't have a configuration or
layers which can be modified through Toaster.

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

[YOCTO #8231]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: Make the builds view the project page for "command line builds"
Elliot Smith [Fri, 2 Oct 2015 07:14:42 +0000 (08:14 +0100)] 
toaster: Make the builds view the project page for "command line builds"

Command line builds don't have configuration or layers which can
be manipulated in Toaster, so these pages shouldn't be visible.
However, the configuration page is the default page for the
project view (/project/X/), which isn't correct for the
command line builds project.

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

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

[YOCTO #8231]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: Replace "Run again" button with help text for cli builds
Elliot Smith [Wed, 30 Sep 2015 13:53:12 +0000 (14:53 +0100)] 
toaster: Replace "Run again" button with help text for cli builds

It's not possible to run a command-line build again, as Toaster
doesn't have access to the data used for that build.

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

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

[YOCTO #8231]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: Exclude "command line builds" project from projects typeahead
Elliot Smith [Wed, 14 Oct 2015 20:29:17 +0000 (13:29 -0700)] 
toaster: Exclude "command line builds" project from projects typeahead

The "New build" drop-down provides autocomplete for Toaster projects.

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

[YOCTO #8231]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Show 'not applicable' for default project machine and release
Elliot Smith [Wed, 14 Oct 2015 20:29:11 +0000 (13:29 -0700)] 
toaster: Show 'not applicable' for default project machine and release

The machine and release for the default project should show as
'not applicable' on the all projects page, as that information
isn't available for command-line builds.

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

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

[YOCTO #8231]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Reorganise and lint tests
Elliot Smith [Wed, 14 Oct 2015 20:29:09 +0000 (13:29 -0700)] 
toaster: Reorganise and lint tests

Get test suite ready to accommodate new tests for how command line
builds are shown on various pages.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/hg: Include missing errno import
Logan Buchy [Thu, 15 Oct 2015 07:42:27 +0000 (00:42 -0700)] 
fetch2/hg: Include missing errno import

errno.ENOENT checked if deletion of the fullmirror fails.
Exception was thrown since module not imported

Signed-off-by: Logan Buchy <logan.buchy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: normalize build targets
Ed Bartosh [Thu, 15 Oct 2015 08:37:40 +0000 (11:37 +0300)] 
cooker: normalize build targets

BuildStarted event not fully represents build tasks for
the targets. If -c option is used to specify default task
it's not included into the event.

Made build targets to always look as <target>:do_<task>.
Consider default task (do_build or specified by -c command
line option) when normalizing.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Allow any text input to machine configuration variable
Michael Wood [Fri, 16 Oct 2015 09:18:29 +0000 (10:18 +0100)] 
toaster: Allow any text input to machine configuration variable

Allow any text input to the machine variable; as we may not have discovered
all the available machines until after a build.

[YOCTO #8418]

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>
9 years agotoaster: exit or return depending on the mode
Ed Bartosh [Thu, 15 Oct 2015 16:34:17 +0000 (09:34 -0700)] 
toaster: exit or return depending on the mode

When toaster script is sourced 'return' should be used as
using 'exit' will cause script to exit the shell and close terminal
window. If script is called 'exit' should be used. Otherwise shell
will throw and error:
  return: can only `return' from a function or sourced script

Used 'return' or 'exit' depending on the toaster mode using
TOASTER_MANAGED variable.

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>
9 years agotoaster: set TOASTER_MANAGED variable
Ed Bartosh [Thu, 15 Oct 2015 16:34:16 +0000 (09:34 -0700)] 
toaster: set TOASTER_MANAGED variable

Set TOASTER_MANAGED to 1 if toaster is run as a script.

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>
9 years agotoaster: get rid of SRCFILE
Ed Bartosh [Thu, 15 Oct 2015 16:34:15 +0000 (09:34 -0700)] 
toaster: get rid of SRCFILE

Used TOASTER variable instead of SRCFILE as they're
essentially the same.

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>
9 years agotoaster: use path to the script to guess config path
Ed Bartosh [Thu, 15 Oct 2015 16:34:14 +0000 (09:34 -0700)] 
toaster: use path to the script to guess config path

Used $TOASTER variable(path to the toaster script) instead of
current directory name to get path to the toasterconf.json

This way script should work in both modes and it doesn't depend
on the current directory.

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>
9 years agotoaster: Guard against builds with no targets
Elliot Smith [Thu, 15 Oct 2015 12:45:15 +0000 (15:45 +0300)] 
toaster: Guard against builds with no targets

Although this probably can't happen in practice (builds without
targets), this constraint is not currently enforced in the data model.

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

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

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>
9 years agotoaster: Remove Toaster exceptions section of build dashboard
Elliot Smith [Thu, 15 Oct 2015 12:45:14 +0000 (15:45 +0300)] 
toaster: Remove Toaster exceptions section of build dashboard

Fatal build errors were displayed as exceptions, and highlighted
with less severity than they deserved.

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

[YOCTO #8320]

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>
9 years agotoaster: Record critical errors
Elliot Smith [Thu, 15 Oct 2015 12:45:13 +0000 (15:45 +0300)] 
toaster: Record critical errors

Critical errors (where a build failed for reasons of
misconfiguration, such as a machine being specified which is not
in a project's layers) were being ignored (only log records
up to ERROR level were being logged to Toaster's db). This meant that
the build would fail but would not correctly report why.

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

[YOCTO #8320]

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>
9 years agotoaster: Test that exception isn't thrown by project page
Elliot Smith [Wed, 14 Oct 2015 14:43:45 +0000 (15:43 +0100)] 
toaster: Test that exception isn't thrown by project page

Add a test which checks that an exception is no longer thrown
for the /toastergui/project/X page for the default project.

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

[YOCTO #8277]

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>
9 years agotoaster: Check whether buildrequest exists before using it
Elliot Smith [Wed, 14 Oct 2015 14:43:44 +0000 (15:43 +0100)] 
toaster: Check whether buildrequest exists before using it

Builds initiated from the command line don't have a buildrequest
associated with them. The build.buildrequest association is
only added if a build is triggered from toaster.

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

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

[YOCTO #8277]

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>
9 years agotoaster: Always run bldcontrol migrations
Elliot Smith [Wed, 14 Oct 2015 14:43:43 +0000 (15:43 +0100)] 
toaster: Always run bldcontrol migrations

The toaster startup script conditionally migrates the database
tables depending on whether you are in managed mode or not. This
means that if you are in analysis mode, some of the bldcontrol*
database tables used by managed mode are not available.

As a consequence, some of the code in toaster which refers to
those tables can break in analysis mode, as there's no clean
isolation of the two modes.

To prevent this from happening, always run the migrations for
managed mode and create the bldcontrol* tables, even if in
analysis mode.

Also clean up the function which starts up toaster so the
logic is easier to follow.

[YOCTO #8277]

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>
9 years agotoaster: buildinfohelper Detect command line builds
Michael Wood [Wed, 14 Oct 2015 09:09:12 +0000 (10:09 +0100)] 
toaster: buildinfohelper Detect command line builds

When we're building using toaster as just a listener to bitbake
(analysis mode) we need to handle the case where the toaster configuration data
isn't present so we don't need to try and update the existing information.

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>
9 years agotoaster: Disable add layer button when input is empty
Belen Barros Pena [Wed, 14 Oct 2015 12:43:18 +0000 (13:43 +0100)] 
toaster: Disable add layer button when input is empty

The 'add layer' button in the project configuration page
is enabled when you select a layer from the type ahead.
However, if you delete the layer name, the 'add layer'
button remains enabled, and if you click it, the last
selected layer from the type ahead will be added to the
project.

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

[YOCTO #8449]

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>
9 years agotoaster: Have 'Version' next to recipe name
Belen Barros Pena [Wed, 14 Oct 2015 12:20:50 +0000 (13:20 +0100)] 
toaster: Have 'Version' next to recipe name

In all Toaster tables we show the version next to the recipe
or package names, with one exception: the recipes table in
the layer details page, where we are showing the version
next to the recipe description.

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

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>
9 years agotoaster: Improve directory structure layout
Belen Barros Pena [Wed, 14 Oct 2015 12:12:14 +0000 (13:12 +0100)] 
toaster: Improve directory structure layout

File names in the directory structure often wrap
due to big indenting for nested files and directories,
unnecessary width in certain columns, and not using
colspan when the symlink and package cells are empty.
The wrapping makes the table harder to read.

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

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>
9 years agotoaster: importlayer Update property names for importlayer api calls
Ed Bartosh [Wed, 14 Oct 2015 11:10:10 +0000 (14:10 +0300)] 
toaster: importlayer Update property names for importlayer api calls

Update the property names used in checking for existing layers. The
server side API changed but not all references were updated.

[YOCTO #8300]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Fix missing tooltips from layers on project configuration page
Michael Wood [Tue, 13 Oct 2015 08:58:49 +0000 (09:58 +0100)] 
toaster: Fix missing tooltips from layers on project configuration page

Re-enable the layer tooltips on the project configuration page.
This adds the required fields to the API used for the layer dependencies
to be able to show the metadata needed.

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

[YOCTO #8295]
[YOCTO #8251]

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>
9 years agotoaster: Fix broken test case
Ed Bartosh [Thu, 1 Oct 2015 09:41:26 +0000 (10:41 +0100)] 
toaster: Fix broken test case

Fixed test_show_tasks_in_projectbuilds broken by latest changes in
project build view.

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>
9 years agotoaster: exclude recipes with empty names
Ed Bartosh [Thu, 1 Oct 2015 21:19:57 +0000 (14:19 -0700)] 
toaster: exclude recipes with empty names

Modified get_all_compatible_recipes function to exclude recipes
with empty names from the result queryset. This should stop UI
to show recipes with empty names in compatible recipes page.

[YOCTO #7969]

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>
9 years agotoaster: delete recipe if it can't be saved
Ed Bartosh [Thu, 1 Oct 2015 21:19:56 +0000 (14:19 -0700)] 
toaster: delete recipe if it can't be saved

Due to Recipe model constraints some recipes can't be
saved. However, they still can create incomplete records in
the database. This causes all sorts of errors when Toaster
operates with those objects. Removing them should fix those
issues.

[YOCTO #7969]

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>
9 years agotoaster: Remove project name from latest project builds
Belen Barros Pena [Fri, 2 Oct 2015 13:43:26 +0000 (14:43 +0100)] 
toaster: Remove project name from latest project builds

The 'latest builds' list in the project builds page does not
need to show the project name, since it lists only builds
for the selected project.

This patch removes the redundant project name.

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>
9 years agotoaster: test get_alldeps API
Ed Bartosh [Fri, 2 Oct 2015 18:05:16 +0000 (11:05 -0700)] 
toaster: test get_alldeps API

Added test case to test Layer_Version.get_alldeps API.

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>
9 years agotoaster: fix orm tests
Ed Bartosh [Fri, 2 Oct 2015 18:05:15 +0000 (11:05 -0700)] 
toaster: fix orm tests

Cleaned up and fixed orm tests. Removed test_build_layerversion as
it's not needed due to changed compatible_layer_versions API.

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>
9 years agotoaster: fix NameError
Ed Bartosh [Fri, 2 Oct 2015 18:05:14 +0000 (11:05 -0700)] 
toaster: fix NameError

Fixed exception: NameError: global name 'DoesNotExist' is not defined

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>
9 years agotoaster: use get_alldeps in layerdetails renderer
Ed Bartosh [Fri, 2 Oct 2015 18:05:13 +0000 (11:05 -0700)] 
toaster: use get_alldeps in layerdetails renderer

Used Layer_Version.get_alldeps api in layerdetails template
renderer to get list of layer dependencies.

[YOCTO 8004]

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>
9 years agotoaster: implement API to get full list of deps
Ed Bartosh [Fri, 2 Oct 2015 18:05:12 +0000 (11:05 -0700)] 
toaster: implement API to get full list of deps

Implemented Layer_Version.get_alldeps API to recursively get
full list of dependencies for the layer. Dependencies that are
already in the project are filtered out from the result.
Result list of Layer_Version objects is sorted by layer name
for UI to look consistent.

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

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>
9 years agotoaster: Don't descend into directories for cached_layers
Michael Wood [Fri, 9 Oct 2015 10:28:58 +0000 (11:28 +0100)] 
toaster: Don't descend into directories for cached_layers

As toaster makes use of clones of itself we have a mechanism to just
clone the current checkout and use that as a basis for the git clone for
the layers inside. For instance, in poky, if we're running in that directory,
we don't ever want to change the current checkout so we make a copy of
ourselves to do this work in.

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

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

[YOCTO #8463]

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>
9 years agotoaster: Update JS unit tests
Michael Wood [Fri, 9 Oct 2015 09:32:43 +0000 (10:32 +0100)] 
toaster: Update JS unit tests

Update JS unit tests.
- Expand the add remove layer check to make sure that the layer is
  actually added to the project.
- Remove some unused vars
- Make sure that the layers/project ids will always exist at the point
  of running the test.
- Add the missing typeahead input fields to the dom to fix the failing
  typeahead test.

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>
9 years agotoaster: Fix stale layer state buttons
Michael Wood [Fri, 9 Oct 2015 09:32:42 +0000 (10:32 +0100)] 
toaster: Fix stale layer state buttons

Move the "is available to the project" state computation to the template
for the Layer add/remove buttons, Recipe build/Add layer as done for the
Package add/remove. This is more reliable as we can get an inconsistent
state on the front end JS as there are many opportunities for hitting
out of date project information.

[YOCTO #8294]

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>
9 years agotoaster: tables Add the recipe filter back into the Recipe table
Michael Wood [Fri, 9 Oct 2015 09:32:41 +0000 (10:32 +0100)] 
toaster: tables Add the recipe filter back into the Recipe table

Add the "Is recipe currently available in the project" filter back to
the Recipe table which was removed when we had intermediate
AvailableRecipe tables.

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>
9 years agotoaster: Fix typo in returning pk list of layer versions in current project
Michael Wood [Fri, 9 Oct 2015 09:32:40 +0000 (10:32 +0100)] 
toaster: Fix typo in returning pk list of layer versions in current project

This was accidentally returning the primary key of the ProjectLayer
rather than the ProjectLayer.Layer_Version.pk

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>
9 years agotoaster: layerdetails update build recipe button class name
Michael Wood [Fri, 9 Oct 2015 09:32:39 +0000 (10:32 +0100)] 
toaster: layerdetails update build recipe button class name

Update the class name which we are using for the recipe build button.
This fixes a regression in the buttons being enabled/disabled when
adding and removing the layer being viewed from the project.

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>
9 years agotoaster: Hide "Download build log" button if log doesn't exist
Elliot Smith [Wed, 7 Oct 2015 10:20:15 +0000 (13:20 +0300)] 
toaster: Hide "Download build log" button if log doesn't exist

Our builds pages show all builds, but also include build requests
which may have resulted in a build failure, before the build
started (e.g. at the recipe parsing stage).

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

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

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

[YOCTO #8373]

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>
9 years agotoaster: fix naming for clone directory
Ed Bartosh [Wed, 7 Oct 2015 14:31:20 +0000 (15:31 +0100)] 
toaster: fix naming for clone directory

Toaster uses git url and branch to make a clone directory
name. Current code leaves '@' and '%' characters unchanged,
which can cause generation of wrong directory names.

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

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>
9 years agotoaster: buildinfohelper Skip packages we have no build info about
Michael Wood [Wed, 7 Oct 2015 13:55:08 +0000 (14:55 +0100)] 
toaster: buildinfohelper Skip packages we have no build info about

If there are more packages listed as installed than we know about from
bitbake, and therefore have insufficient information to be able to
create a Toaster Package object then skip it. Also handle the case where
a dependency references such a package.

Also clarify the error logging.

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>
9 years agotoaster: buildinfohelper associate build data with built_recipe
Michael Wood [Wed, 7 Oct 2015 13:55:07 +0000 (14:55 +0100)] 
toaster: buildinfohelper associate build data with built_recipe

Make sure we associate build data with the built recipe rather than
toaster's configuration copy of the recipe.

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>
9 years agotoaster: remove bashisms so script works in dash as well
brian avery [Wed, 7 Oct 2015 12:17:36 +0000 (15:17 +0300)] 
toaster: remove bashisms so script works in dash as well

[YOCTO #8217]

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: get rid of interactivity in bldcontrol
brian avery [Wed, 7 Oct 2015 12:17:35 +0000 (15:17 +0300)] 
toaster: get rid of interactivity in bldcontrol

removed layer dir questions and base off TOASTER_DIR

removed build dir questions and base off TOASTER_DIR

base configuration file off of TOASTER_CONF

fixed some pylint issues

[YOCTO #8217]

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: check for configuration file and exit if not found
brian avery [Wed, 7 Oct 2015 12:17:34 +0000 (15:17 +0300)] 
toaster: check for configuration file and exit if not found

[YOCTO #8217]

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove layer and build dir interactive questions
brian avery [Wed, 7 Oct 2015 12:17:33 +0000 (15:17 +0300)] 
toaster: remove layer and build dir interactive questions

added TOASTER_CONF env var for toaasterconf.json

added TOASTER_DIR env var for working dir

added bugfix so WEB_PORT env variable is honored

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: removed superuser question from startup
brian avery [Wed, 7 Oct 2015 12:17:32 +0000 (15:17 +0300)] 
toaster: removed superuser question from startup

added comment explaining how to create one later

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: orm Machines filter don't pass self in as parameter
Michael Wood [Wed, 7 Oct 2015 03:21:25 +0000 (20:21 -0700)] 
toaster: orm Machines filter don't pass self in as parameter

Fix typo don't pass self in as a parameter, this evaluated to true
giving the wrong results meaning the machines typeahead did not return
valid results.

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>
9 years agotoaster: Rationalise mimetype guessing to fix artifact downloads
Elliot Smith [Wed, 7 Oct 2015 03:05:22 +0000 (20:05 -0700)] 
toaster: Rationalise mimetype guessing to fix artifact downloads

Artifact download links were broken because the function to
get the mimetype for the artifact was incorrectly using the
underlying mimetype library. The function was also attached
to the build environment controller, which was unnecessary, as
we only support local controllers anyway.

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

[YOCTO #8369]

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>
9 years agotoaster: Use Python's mimetypes module
Elliot Smith [Wed, 7 Oct 2015 03:05:21 +0000 (20:05 -0700)] 
toaster: Use Python's mimetypes module

filemagic is used to guess the mimetype of files when a user
requests a download. However, this adds a dependency on an
external library.

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

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

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>
9 years agotoaster: display warnings for bad "IMAGE_FSTYPES" values
David Reyna [Tue, 6 Oct 2015 15:43:30 +0000 (16:43 +0100)] 
toaster: display warnings for bad "IMAGE_FSTYPES" values

Display warning message for IMAGE_FSTYPES when no value is selected or
when the filter does not have any matches

[YOCTO #8126]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Set default columns in recipes tables
Belen Barros Pena [Tue, 6 Oct 2015 13:31:50 +0000 (14:31 +0100)] 
toaster: Set default columns in recipes tables

The compatible image recipes and software recipes tables
show pretty much all their columns by default. That's a few
too many columns. The default columns in both tables should
be: recipe, version, description, layer and build.

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

[YOCTO #8421]

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>
9 years agotoaster: Comment out broken sorting and filters
Belen Barros Pena [Tue, 6 Oct 2015 13:20:44 +0000 (14:20 +0100)] 
toaster: Comment out broken sorting and filters

YOCTO #8131 records that the sorting by 'errors', 'warnings'
and 'time', and the filtering by 'errors' and 'warnings',
are broken in the 'all builds' and 'project builds' pages.

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

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>
9 years agotoaster: Don't HTTP cache ToasterTable responses
Elliot Smith [Mon, 5 Oct 2015 11:08:32 +0000 (12:08 +0100)] 
toaster: Don't HTTP cache ToasterTable responses

Django allows generated pages to be cached by default by the
browser. This can result in stale data displaying for some pages.

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

[YOCTO #7660]

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>
9 years agotoaster: Don't add new history entries when table data loads
Elliot Smith [Mon, 5 Oct 2015 11:08:31 +0000 (12:08 +0100)] 
toaster: Don't add new history entries when table data loads

When ToasterTable data is loaded into the UI, a new entry is
added to the browser history. This means that pressing the back
button appears to have no effect, as you end up at the same page,
possibly with slightly different data.

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

[YOCTO #7660]

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>
9 years agotoaster: use meaningful logging levels
Ed Bartosh [Mon, 5 Oct 2015 09:43:18 +0000 (10:43 +0100)] 
toaster: use meaningful logging levels

Changed logging levels to more appropriate ones.

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>
9 years agotoaster: ignore ReachableStamps event
Ed Bartosh [Mon, 5 Oct 2015 09:43:17 +0000 (10:43 +0100)] 
toaster: ignore ReachableStamps event

Added ReachableStamps event to the list of known events to
ignore. This should stop toaster throwing error message:
ERROR: Unknown event: <bb.event.ReachableStamps>

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>