add build artifacts table and other improvements

We add a BuildArtifacts class to store data about files
discovered during the build process and not stored anywhere
else.

Small cosmetic changes in the toasterui.

Add model methods to return file path display data relative
to the build environment instead of absolute file paths.

[YOCTO #6834]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toasterui: add extra debug and development infos

We update and add logs throughout the code in order to help
with development. The extra logging is turned off by default,
but it can be enabled by using environment variables.

All logging happens through the Python logging facilities.

The toaster UI will save a log of all incoming events if the
TOASTER_EVENTLOG variable is set.

If TOASTER_SQLDEBUG is set all DB queries will be logged.

If TOASTER_DEVEL is set and the django-fresh module is available,
the module is enabled to allow auto-reload of pages when the
source is changed.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
add option to write offline event log file

This patch adds a "-w/--write-log" option to bitbake
that writes an event log file for the current build.

The name of the file is passed as a parameter to the "-w"
argument. If the parameter is the empty string '', the file
name is generated in the form bitbake_eventlog_DATE.json,
where DATE is the current date and time, with second precision.

The "-w" option can also be supplied as the BBEVENTLOG
environment variable.

We add a script, toater-eventreplay, that reads an event
log file and loads the data into a Toaster database, creating
a build entry.

We modify the toasterui to fix minor issues with reading
events from an event log file.

Performance impact is undetectable under no-task executed builds.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toastergui: implement UI changes to allow file download

This patchset adds download links in the build analisys pages
if toaster runs in managed mode. This allows the user to access
data directly from the web interface.

[YOCTO #6837]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
add POST endpoint for uploading eventlog files

This patch adds a simple UI-less POST endpoint, where
bitbake_eventlog.json files generated by a bitbake run can be
uploaded to the running toaster instance for insertion into
the database.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toaster: base Only show change project icon when > one project

In the new build button, it only makes sense to change
the selected project when there is more than one project
in the Toaster instance. If the number of projects is 1,
we hide the change project icon.

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: Initialise the 'change' icon tooltips

All 'change' icons should have a tooltip that appears
when you hover over them. The tootlip says (fittingly):
"Change". Initialise those icons in the libtoaster.js
file so that they work outside the project page.

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: libtoaster Add a error handler to GET in makeTypehead

If the JSON data comes back from the request with an error set, have a
default handler which logs the error to the console.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
toaster: libtoaster Add editProject and getLayerDepsForProject

Add two utility functions for editing project settings and returning the
layer "dependencies" for a specified layer.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
toasterui: refactor project layer finding logic

This is a basic refactoring of the code computing
the layer equivalence classes for a project, in order to
bring common bits of logic in a single place.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toaster: Add import layer feature.

This feature allows users to import layers from git into their current
project and associate it with the release of the current project and the
dependencies for the newly imported layer with existing layers.
It will also resolve the child dependencies of the dependencies added.

[YOCTO #6595]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toaster: tweaking the import layers form

This commit makes the following changes to the import
layers form:

* In the explanatory text at the top of the page, show only
the release description (to match the information shown in all
other pages)

* Make sure the spacing between form fields and labels is
consistent across the form

* Change the 'Branch, tag or commit' label to 'Revision'
and add some help text to the label

* Change the help text and the input type in the layer
 description

* Change the help text next to the form actions to match
the new field ordering in the form

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toaster: Importlayer add notify exactly which layers changed

This changes when the dependencies are added to the project so that we
can know which ones were successfully added by waiting for the server to
respond with a list. This is more reliable because we may have specified
dependencies which are already in the project.

To pass this information to the project page a temporary cookie is used
with the values for the notification.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
toaster: importlayer Avoid namespace clash with layer name

This was causing validation issues as the layer name was being picked up
from a different location in the dom.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
toaster: projectapp Add links to the imported layers notify

Adds links to layer details for each of the layers that has been added
to the project.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
toaster: Formatting changes to error messages

Just giving a bit of space to the content of the error
messages we show when you try to import a layer that
already exists.

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: Change the full stop to a colon

In the import layers notification for multiple layers
there was a full stop where there should be a colon.

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: importlayer Tidy up the page initialisation

Tidy up the page initialisation and change the error logging so that
it's consistent with other pages.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>