Bug 6060

Summary: When a build fails, some tasks come without order number and with outcome 'not available'
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: David Reyna <david.reyna>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: alexandru.damian, belen.barros.pena, cristiana.voicu, jessica.zhang, Yuan.Sun2
Version: unspecified   
Target Milestone: 1.6 M5   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Belen Barros Pena 2014-03-27 17:08:27 UTC
To see an example, download the development database from the wiki:

https://wiki.yoctoproject.org/wiki/images/d/d1/Toaster.sqlite

and check 

/gui/build/6/recipe/1714
Comment 1 Alexandru Damian 2014-03-27 17:24:41 UTC
This is normal and expected.

All the tasks are created when the task dependency tree is generated and submitted.

The tasks are assigned order numbers and outcomes when they are executed. When a build fails or is stopped, tasks not yet evaluated will show outcome NA and no order number.
Comment 2 Belen Barros Pena 2014-03-27 17:32:22 UTC
(In reply to comment #1)
> This is normal and expected.
> 
> All the tasks are created when the task dependency tree is generated and
> submitted.
> 
> The tasks are assigned order numbers and outcomes when they are executed.
> When a build fails or is stopped, tasks not yet evaluated will show outcome
> NA and no order number.

Fair enough, but if they never got to run, Toaster should not show them. 

David: ping Alex if you have any questions. I think he knows how to go about fixing this one.

Thanks!
Comment 3 David Reyna 2014-04-01 02:16:05 UTC
I think that the simple resolution is in the view class to filter out any tasks with no order numbers. That would be easier and safer at this point than making a backend change.
Comment 4 David Reyna 2014-04-04 20:38:57 UTC
The solution is to copy the filter for 'order' from the All Tasks view class and applied it to this task table within the Recipe view class.

    tasks  = Task.objects.filter(recipe_id = recipe_id).filter(build_id = build_id).exclude(task_name__endswith='_setscene').filter(order__gte=0)

BTW, the example database mentioned above is actually a ".tar.gz" formatted file, so be forewarned:
  https://wiki.yoctoproject.org/wiki/images/d/d1/Toaster.sqlite
Comment 5 David Reyna 2014-04-09 23:13:49 UTC
commit dc7d3d29108d63eb5ecf276769f0099a5bc3ab86
Comment 6 Yuan Sun 2014-04-11 06:52:08 UTC
Verified in 046a9ea30356daf4f3f8f4ddfc5b57fcfd85a27f.