]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
9 years agobitbake: rename REGEX, REGEX_URI, and GITTAGREGEX.
Alexander Kanavin [Fri, 4 Dec 2015 14:59:26 +0000 (14:59 +0000)] 
bitbake: rename REGEX, REGEX_URI, and GITTAGREGEX.

Rename REGEX to UPSTREAM_CHECK_REGEX, REGEX_URI to UPSTREAM_CHECK_URI, and
GITTAGREGEX to UPSTREAM_CHECK_GITTAGREGEX to better reflect their purpose
and to reflect a common namespace.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: return back 'New project' button
Ed Bartosh [Mon, 7 Dec 2015 16:06:01 +0000 (16:06 +0000)] 
toaster: return back 'New project' button

The button was removed by mistake in merging modes patchset.

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: tests Update UI tests to work with 2.0 changes
Mihail Stanciu [Mon, 7 Dec 2015 15:53:01 +0000 (15:53 +0000)] 
toaster: tests Update UI tests to work with 2.0 changes

Update tests that were referencing items removed in 2.0.

Update most xpath elements left to use IDs.

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>
9 years agotoaster: tests Automated build-mode backend tests
Mihail Stanciu [Mon, 7 Dec 2015 15:53:00 +0000 (15:53 +0000)] 
toaster: tests Automated build-mode backend tests

Add tests to check various backend scenarios that
require UI interaction.

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

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>
9 years agotoaster: unset environment variables
Ed Bartosh [Wed, 2 Dec 2015 18:02:59 +0000 (10:02 -0800)] 
toaster: unset environment variables

Toaster script sets environment variables when it starts.
It makes sense to unset them when toaster stops as they can
cause other programs to behave incorrectly.

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 complicated heuristics
Ed Bartosh [Wed, 2 Dec 2015 18:02:58 +0000 (10:02 -0800)] 
toaster: get rid of complicated heuristics

Removed buildinfohelper code which was trying to guess layer version of
the recipe using build request information. The code caused creation of
duplicated recipes as it resulted in layer version from layer index
instead of returning build layer version. As a result of this Toaster
UI was not showing any information about recipes.

Default approach used to find layer version seems to work much better as
it finds proper layer version. Now toaster will use it as the only
way to find layer version.

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 SDKMACHINE from project variables
Ed Bartosh [Wed, 2 Dec 2015 18:02:57 +0000 (10:02 -0800)] 
toaster: remove SDKMACHINE from project variables

Removed SDKMACHINE from predefined set of variables
for the project as it causes bitbake build error:
   SDKMACHINE is set, but SDK_ARCH has not been changed as a result

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

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

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: stop using toaster-pre.conf
Ed Bartosh [Wed, 2 Dec 2015 18:02:56 +0000 (10:02 -0800)] 
toaster: stop using toaster-pre.conf

This file is not needed anymore as toaster UI doesn't
write variables to it. It sets them directly on bitbake
server.

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 writeConfFile API
Ed Bartosh [Wed, 2 Dec 2015 18:02:55 +0000 (10:02 -0800)] 
toaster: remove writeConfFile API

This API is not used anymore as toaster doesn't write variables
to configuration files anymore. It sets variables through its
connection to bitbake server.

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 varibales on bitbake server
Ed Bartosh [Wed, 2 Dec 2015 18:02:54 +0000 (10:02 -0800)] 
toaster: set varibales on bitbake server

Set project variables using connection to bitbake server
instead of writing them to toaster configuration files.

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

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 BitbakeController.getVariable
Ed Bartosh [Wed, 2 Dec 2015 18:02:53 +0000 (10:02 -0800)] 
toaster: implement BitbakeController.getVariable

Added new API to get value of bitbake variable from bitbake server.
The API will be used to update INHERIT variable instead of writing
it to the toaster configuration files.

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: buildinfohelper Broaden the toaster created recipe data case
Michael Wood [Wed, 2 Dec 2015 18:02:52 +0000 (10:02 -0800)] 
toaster: buildinfohelper Broaden the toaster created recipe data case

When build information is the 'original' source of the information we
need to return the recipe that was created rather than the copy of the
recipe that is taken for keeping build history. We do this already for
command line triggered builds, but we also have this case for custom
images. We can simply check if the built_recipe exists instead of
special casing this.

Signed-off-by: Michael Wood <michael.g.wood@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: do not create duplicate HelpText objects
Ed Bartosh [Wed, 2 Dec 2015 18:02:51 +0000 (10:02 -0800)] 
toaster: do not create duplicate HelpText objects

buildinfohelper code expects only one HelpText object per
build/variable/description.
Current code creates more than one such an object, which causes
toastergui to crash with this exception:
 MultipleObjectsReturned: get() returned more than one HelpText -- it returned 2!

Used git_or_create API to ensure that only one HelpText object is
created.

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 usage of BUILD_MODE variable
Ed Bartosh [Wed, 2 Dec 2015 18:02:50 +0000 (10:02 -0800)] 
toaster: remove usage of BUILD_MODE variable

As both modes can be used at the same time we can't have any
difference in UI between modes.

Removed all conditional statements that used BUILD_MODE.

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: do not terminate bb server
Ed Bartosh [Wed, 2 Dec 2015 18:02:49 +0000 (10:02 -0800)] 
toaster: do not terminate bb server

Toaster needs bb server to be running all the time due
to merged analysis and managed modes. Server gets restarted
before every build triggered by UI, but it shouldn't be
terminated as it will influence command line builds.

[YOCTO #8279]

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 stopBBServer API
Ed Bartosh [Wed, 2 Dec 2015 18:02:48 +0000 (10:02 -0800)] 
toaster: remove stopBBServer API

Removed stopBBServer API from build controller as toaster
doesn't stop bitbake server anymore. It's reused for both
types of builds: triggered by UI and started manually.

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: reimplemented startBBServer method
Ed Bartosh [Wed, 2 Dec 2015 18:02:47 +0000 (10:02 -0800)] 
toaster: reimplemented startBBServer method

Rewritten LocalhostBEController.startBBServer to use
'toaster restart-bitbake' and read bitbake port number from
bitbake.lock.

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

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 _setupBE function
Ed Bartosh [Wed, 2 Dec 2015 18:02:46 +0000 (10:02 -0800)] 
toaster: remove _setupBE function

This function is not needed as build environment is always created
because of the new way to run Toaster. It can be only sourced after
oe-init-build-env is sourced.

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 'toaster restart-bitbake'
Ed Bartosh [Wed, 2 Dec 2015 18:02:45 +0000 (10:02 -0800)] 
toaster: implement 'toaster restart-bitbake'

This implementation allows to have functionality of restarting
bitbake in toaster script. It can be used by toaster script and
build controllers.

[YOCTO #8279]

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 start_bitbake function
Ed Bartosh [Wed, 2 Dec 2015 18:02:44 +0000 (10:02 -0800)] 
toaster: implement start_bitbake function

Separated functionality of starting bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

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 stop_bitbake function
Ed Bartosh [Wed, 2 Dec 2015 18:02:43 +0000 (10:02 -0800)] 
toaster: implement stop_bitbake function

Separated functionality of stopping bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

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: update brbe and project attributes
Ed Bartosh [Wed, 2 Dec 2015 18:02:42 +0000 (10:02 -0800)] 
toaster: update brbe and project attributes

Updated attributes of buildinfohelper object as they can
be changed for every build. For example brbe is set by
runbuilds for every build triggered by Toaster UI.

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: start 'manage.py runbuilds' in the script
Ed Bartosh [Wed, 2 Dec 2015 18:02:41 +0000 (10:02 -0800)] 
toaster: start 'manage.py runbuilds' in the script

Running runbuilds machinery in background allows Toaster to
start builds initiated by toaster UI.

Added runbuilds pid file to the list in webserverKillAll to
kill runbuilds the same way as runserver process.

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: make runbuilds to loop
Ed Bartosh [Wed, 2 Dec 2015 18:02:40 +0000 (10:02 -0800)] 
toaster: make runbuilds to loop

Made runbuilds to loop to avoid having a loop in shell code and
initialize heavy Django init machinery every second.

Ignored exceptions to prevent exiting a loop.

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 parent of the build dir
Ed Bartosh [Wed, 2 Dec 2015 18:02:39 +0000 (10:02 -0800)] 
toaster: use parent of the build dir

Assigned TOASTER_DIR to the parent of the build directory.
This should fix local controller crash as it assumes that
TOASTER_DIR is a root of local poky and tries to clone it.

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: check for toaster configuration later
Ed Bartosh [Wed, 2 Dec 2015 18:02:38 +0000 (10:02 -0800)] 
toaster: check for toaster configuration later

Moved check for toasterconf.json after check of build environment.
We'll need some variables from build environment to find toasterconf.json
better way.

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 unused variable
Ed Bartosh [Wed, 2 Dec 2015 18:02:37 +0000 (10:02 -0800)] 
toaster: remove unused variable

Removed variable RUNNING as it's not used anymore
in the toaster 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: change toasterconf.json logic to use TEMPLATECONF, like oe-setup-builddir
brian avery [Fri, 20 Nov 2015 18:29:34 +0000 (18:29 +0000)] 
toaster: change toasterconf.json logic to use TEMPLATECONF, like oe-setup-builddir

This changes the way we pick a toasterconf.json file so that it
matches the way oe-setup-builddir does it. We now base it on TEMPLATECONF
found in the .templateconf file.

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: run bitbake the same way
Ed Bartosh [Wed, 2 Dec 2015 18:02:36 +0000 (10:02 -0800)] 
toaster: run bitbake the same way

Run bitbake in toaster script the same way as it's run
by localbuildcontroller.

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 DATABASE_URL in toaster script
Ed Bartosh [Wed, 2 Dec 2015 18:02:35 +0000 (10:02 -0800)] 
toaster: set DATABASE_URL in toaster script

Set environment variable DATABASE_URL in bitbake/bit/toaster
Variable value is obtained by running 'manage.py get-dburl'

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 get-dburl command
Ed Bartosh [Wed, 2 Dec 2015 18:02:34 +0000 (10:02 -0800)] 
toaster: implement get-dburl command

Implemented management command to call getDATABASE_URL API.
It will be used to get database url from toaster shell script
by running 'manage.py get-dburl'

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 allow to run toaster as a script
Ed Bartosh [Wed, 2 Dec 2015 18:02:33 +0000 (10:02 -0800)] 
toaster: don't allow to run toaster as a script

Removed support of starting toaster as a script.

Sourcing a toaster script becomes the only way to start it.
It's consistent with the way oe build system is started by sourcing
oe-init-build-env. It also returns user back to shell, so user can
continue running builds without having to open new terminal window.

[YOCTO #8279]

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 agolib/bb/utils: improve edit_bblayers_conf() handling of bblayers.conf formatting
Paul Eggleton [Fri, 20 Nov 2015 04:11:16 +0000 (17:11 +1300)] 
lib/bb/utils: improve edit_bblayers_conf() handling of bblayers.conf formatting

Make the following improvements to edit_bblayers_conf():

* Support ~ in BBLAYERS entries
* Handle where BBLAYERS items are added over multiple lines with +=
  instead of one single long item

Also add some comments documenting the function arguments and return
values as well as a set of bitbake-selftest tests.

(This function is used by the bitbake-layers add, remove and
layerindex-fetch subcommands, as well as devtool when adding the
workspace layer).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils: fix error in edit_metadata() when deleting first line
Paul Eggleton [Fri, 20 Nov 2015 04:11:15 +0000 (17:11 +1300)] 
lib/bb/utils: fix error in edit_metadata() when deleting first line

If you tried to delete the variable on the first line passed to
edit_metadata() this failed because the logic for trimming extra blank
lines didn't expect the list to be empty at that point - fix that bad
assumption.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agowget.py: parse only <a> tags
Alexander Kanavin [Fri, 4 Dec 2015 11:00:20 +0000 (13:00 +0200)] 
wget.py: parse only <a> tags

For two reasons:
1) The important one: we hit the following bug when doing upstream version checks
on some webpages:
https://bugs.launchpad.net/beautifulsoup/+bug/1471755

2) Also, documentation for beautifulsoup states that memory usage and
speed is improved that way.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: toastergui tests Add generic test for ToasterTables widget
Michael Wood [Thu, 26 Nov 2015 16:44:35 +0000 (16:44 +0000)] 
toaster: toastergui tests Add generic test for ToasterTables widget

For each of the ToasterTables defined test:
 - Data returned
 - Search
 - Order by
 - Limit
 - Paginate
 - Filter

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

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 Fix invalid field name on NewCustomImagesTable
Michael Wood [Thu, 26 Nov 2015 16:44:34 +0000 (16:44 +0000)] 
toaster: tables Fix invalid field name on NewCustomImagesTable

Correct the field name in the NewCustomImagesTable as it is a Recipe
object it's self and not a container.

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