toaster: fix help texts not showing for most tasks

These were not being collected properly because we were explicitly
excluding variables defined as functions from being stored in the
database. We don't want these to be shown in the variables list, and in
any case it makes sense for these to be stored elsewhere, so create a
separate model to store these.

Fixes [YOCTO #6050].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: fix mis-detection of targets as images

If you are using the testimage class then the old test mistook the
global inheritance of testimage.bbclass with the recipe inheriting
image.bbclass because it was only looking for that at the end of the
string.

Also tidy up the code so you an easily tell what it's doing. (The
original method may have been more "pythonic", but it does nothing for
readability.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: adding INHERIT += " testimage " affects image recipes list

To find if a recipe is for an image, Hob checks if it inherits
image.bbclass. But when you add testimage in local.conf, this will
be added for each recipe, and it pass the test. Adding a "/" before
"image.bbclass", will check only for image.bbclass.

[YOCTO #6117]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: fix customization of empty image recipe

This fixes a problem which happened when you tried to build an
image by selecting 'Start with an empty image recipe' from the
Image configuration page of hob.

The reason on of the bug was that the name of the resulting image
was threated the same way as ordinary custom images, when in fact
they should use the default name: "hob-image", because they do not
derive from any other recipe.

[YOCTO #6102]

Signed-off-by: Marius Avram <marius.avram@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cooker: Overwrite IMAGE_BASENAME to default in custom image

This solves a problem of custom images which inherit a base
image with IMAGE_BASENAME overwritten in their recipe by a
different value than its default one: ${PN}.

The value of IMAGE_BASE causes a crash when hob will try to
create symbolic links to the resulting images from the deploy
directory, because it will look for names similar to
<original_recipe_name>-edited-timestamp-machine.rootfs.*
which might be different from the actual resulting image.

The solution is to simply overwrite IMAGE_BASENAME in the
custom recipe to the default value in the case IMAGE_BASENAME
is found in the base recipe.

Some recipes which were affected by this problem are those
from meta-fsl-demos (e.g.: fsl-image-test).

[YOCTO #6017]

Signed-off-by: Marius Avram <marius.avram@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: link task order to right tasks page

When linking from a task order number to the All Tasks
page, automatically display the correct page for that link
anchor.

[YOCTO #5933]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toaster: Update API

Make sure the REST API includes the latest changes
to the database schema.

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toasterui: avoid variable name conflict

We rename a local variable in as to prevent a conflict with
a similary named function parameter.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toasterui: save warnings from non-build context

Some warnings and errors may come from a non-build context,
and they were not saved, even if they were counted for the current
build.

This patch saves these messages in memory until we have the
entire build context available.

	[YOCTO #5642]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toaster: Remove html validation errors in tasks.html

Remove the duplicated class attribute and the name
attribute.

Also, make sure that the row blue highlight works
without the name attribute when you land on the
tasks table after clicking the order link in a
task details page.

The commit also fixes a typo in default.css.

[YOCTO #6033]

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: Changes to help text

All help text strings have been reviewed by the
technical writer, and some of them by Paul Eggleton.
This patch implements their suggested changes.

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: catch IndexError error in dictionary lookups

In the get_dict_value filter, there is the edge case where halted
builds can lead to IndexError errors in dictionary lookups, so we
need to catch those.

[YOCTO #6067]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
toaster: Fix "Recent builds" links

* Link the number of errors to the #errors section in the
build dashboard

* Link the number of warnigns to the #warnings section in
the build dashboard

* Link the build time to the build time page

* Move some javascript that applies only to builddashboard.html
to that template from main.js

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: Fix the empty packages alert

* Remove a tag in all capitals
* Remove an unnecessary div
* Fix a typo

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: Make tables happy in Chrome

There is a known layout issue with Bootstrap tables in
Chrome. This change applies a css fix for it, and changes
the span classes in the variables table to improve
formatting.

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: Fixes to the build dashboard

* Add "on" before the date in the build status

* Get rid of the extra space before the "and" in the
build status

* Make the errors and warnings links in the build
status show the message content

* Make sure that the "Images" section in the left navigation
appears only for successful builds

* Link the number of packages installed to the "Packages
included" tab in the image information page

* Remove unnecessary inline styles in the dashboard
template

* Make sure target names in the h1 are listed in
alphabetical order

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
toaster: correct package count

The package count was incorrect because it was counting anonymous
packages. the full path of the image files was shortened to just
the filename.

[YOCTO 6087]
[YOCTO 6091]

Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
toaster: added covered task list

if a task has a 'covered' indication, the list of tasks that
covered the task are computed and displayed. amended to add tooltip.

[YOCTO #5925]

Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
fetch2: Fix bug in file checksum generation

For a while its been puzzling me why connman-gnome rebuilds as often as it
does. It turns out you can trigger this with a new checkout of the metadata.

The SRC_URI that is causing the problems is:

SRC_URI = "file://images/*"

and rather oddly the results in checksums for a file "." being added to
the tree, e.g.:

('.', 'ab48a68186f0e0f277c21ef4cb390b4b')

The problem is that when iterating files lists, the checksum variable can
become set yet we don't break the out from the for loop, which leads to
odd (and non-deterministic) entries being added into the file checksum list.
The exact item added probably depends on the order of items on the disk.

Before this change, bitbake-diffsigs on connman-gnome:do_fetch would report:

This task depends on the checksums of files: [
('connman-signal-03.png', 'f6c16aee57b37b73793a2f1dea433ffa'),
('connman-signal-02.png', 'ad0cd22710c097d8174121fc1023c3be'),
('connman-signal-01.png', '8842bd83d2fa9ba56480df34c727c629'),
('null_check_for_ipv4_config.patch', 'a23271e41c9fe81551244d875106af10'),
('connman-signal-05.png', '808589e7e8d502b44c7b007e9e68d48c'),
('connman-signal-04.png', 'ab48a68186f0e0f277c21ef4cb390b4b'),
('null_check_for_ipv4_config.patch', 'a23271e41c9fe81551244d875106af10'),
('0001-Removed-icon-from-connman-gnome-about-applet.patch', 'e2d8269357c1e8c84291606da24eea85'),
('0001-Removed-icon-from-connman-gnome-about-applet.patch', 'e2d8269357c1e8c84291606da24eea85'),
('.', 'ab48a68186f0e0f277c21ef4cb390b4b')]

Afterwards:

This task depends on the checksums of files: [
('connman-signal-03.png', 'f6c16aee57b37b73793a2f1dea433ffa'),
('connman-signal-02.png', 'ad0cd22710c097d8174121fc1023c3be'),
('connman-signal-01.png', '8842bd83d2fa9ba56480df34c727c629'),
('null_check_for_ipv4_config.patch', 'a23271e41c9fe81551244d875106af10'),
('connman-signal-05.png', '808589e7e8d502b44c7b007e9e68d48c'),
('connman-signal-04.png', 'ab48a68186f0e0f277c21ef4cb390b4b'),
('null_check_for_ipv4_config.patch', 'a23271e41c9fe81551244d875106af10'),
('0001-Removed-icon-from-connman-gnome-about-applet.patch', 'e2d8269357c1e8c84291606da24eea85'),
('0001-Removed-icon-from-connman-gnome-about-applet.patch', 'e2d8269357c1e8c84291606da24eea85')]

which is correct and deterministic without the "." entry.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fetch2: avoid cache ignoring missing files

Previously, if a file listed in SRC_URI was missing at the time of
parsing, and then was added and bitbake run again, it would not be
picked up because the recipe was cached without it. If we allow the file
to be added to the list of files to checksum, then it will be checked
for and found on the second run.

Fixes [YOCTO #4790].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>