bitbake: toaster: Fix total number of tasks in build dashboard

The total number of tasks in the build dashboard was counting
_setscene tasks, which are not exposed by Toaster as separate
tasks. This patch makes sure that _setscene tasks are not
counted when calculating that number.

[YOCTO #6145]

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake: toaster: Fix Empty tasks filter

Somehow the counter was set to count tasks with outcome
'not available', instead of outcome 'empty'. This patch
fixes the problem.

[YOCTO #6146]

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: sort outcome and sstate columns by string value

Sort the 'outcome' and 'sstate_result' columns by their
description string values and not their numerical values.

[YOCTO #5921]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
toaster: fix span2 headings for packages

[YOCTO 6147]

Fix bug in views.py that put 'span2' class id in a 'clclass' key
instead of the 'dclass' key.  This fix exposed another problem in
target.html and the target view function that used 'package_size'
instead of 'size' as the 'clclass' which is inconsistent with the
model field name, causing table data columns to be shown when
the header is hidden.

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
toaster: sort columns properly after edit columns

If a sorted column is made invisible through the edit columns function,
resort the table the its default order.

[YOCTO 5919]

Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: reduce redundant foreign key lookups

Replace redundant foreign key lookups with "with" to improve all
recipes page load time. Do depends pre-lookup in the view class,
and use python itertation instead of filter() all to achieve x16
processing speedup.

[YOCTO #6137]

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

Conflicts:
	bitbake/lib/toaster/toastergui/views.py
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toastergui: fix built ETA calculation

We fix the calculation showing the estimated time
to build completion.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
toaster: refactor the target page

the target (packages) page had to refactored to
allow the displays to differ depending on the caller
namely the license manifest link. Amended to make the
link from the tag rather than the pathname itself.

[YOCTO #6291]
[YOCTO #6079]

Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: Add performance testing script

This is implemented as a django management command.
For the moment the 'manage.py perf' command will track the toaster
'gui' urls http response code and load time.

To use it:
1. do your toaster builds
2. ensure toaster is started
1. cd bitbake/lib/toaster
2. ln -s ../../../build/toaster.sqlite
3. ./manage.py perf

Signed-off-by: Ionut Chisanovici <ionutx.chisanovici@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: display message if no images are generated

Display message if no images are generated for a target. This
commit was amended to have more conditions for displaying the
message.

[YOCTO #6094]

Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
toaster: Fix spacing and layout in no image files notification

Close the definition list before adding the notification, and
restrict the notification width to avoid uncomfortable line
lenghts.

Signed-off-by: Belen Barros <belen.barros.pena@intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
codeparser: don't interact with the cache for subshells

Doing so was causing leakage between the execs of the main value and that of
the subshell value, and was causing the cached subshell value to be used for
the overall variable. At the least this could cause execs contamination
between two variables that while differing, run the same subshell. Beyond
that, it's possible we could have been using an incomplete cached value of
a subshell for that of the main value.

Before this, bb_codeparser.dat would change between parses with differing
bbfile parse order. After, it does not change.

The codeparser cache version is bumped, to ensure we don't use potentially
incorrect cached values from previous runs.

This should hopefully resolve the difficult-to-reproduce issues we've seen at
Mentor Graphics where bitbake emits a script to run a task and misses
dependent functions, resulting in 'command not found' failures. This issue has
also been mentioned on the oe devel list, where someone hit a case where
oe_runmake was missing from a do_install task (IIRC). Adding debug information
showed that bitbake's information about the variable dependencies for this
task is inaccurate in the failure cases.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
codeparser: Fix to better catch all getVar references

Currently if you do localdata.getVar, the code parser simply ignores
the references. Change the code to use endswith() to catch more of the
references. These names are probably unique enough to get away with this.

Bump the cache version to ensure things get updated.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>