Bug 5917

Summary: Task Detail page needs support for "Empty" outcome
Product: [Build System, Metadata & Runtime] Toaster Reporter: David Reyna <david.reyna>
Component: toasterAssignee: David Reyna <david.reyna>
Status: VERIFIED FIXED QA Contact: Mihail Stanciu <stanciux.mihail>
Severity: normal    
Priority: Medium CC: alexandru.damian, belen.barros.pena, cristiana.voicu, jessica.zhang, stanciux.mihail
Version: 1.6   
Target Milestone: 1.6 M4   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description David Reyna 2014-03-06 05:33:02 UTC
In the “task.html” page, there is the value “task.outcome_help”, but that no longer appears to be in the database. It that the case and intent? What should we use instead?

  159:     <i class="icon-question-sign get-help heading-help" title="" data-original-title="{{task.outcome_help}}"></i>

What is really weird, I do not get a Django error unless I open a task with the “Empty” outcome, even though this code would seem to execute for all outcomes.

  KeyError at /gui/build/13/task/23748
    Exception Location: 	/home/abc/toaster_1_6/poky/bitbake/lib/toaster/orm/models.py in outcome_help, line 159
      <i class="icon-question-sign get-help heading-help" title="" data-original-title="{{task.outcome_help}}"></i>
Comment 1 Alexandru Damian 2014-03-06 10:07:28 UTC
outcome_help is a method in the Task class, at least on toaster/master. 
I would've named it get_outcome_help, but such is life.

def outcome_help(self):
        return Task.TASK_OUTCOME_HELP[self.outcome]
Comment 2 Belen Barros Pena 2014-03-06 10:32:13 UTC
I found this problem earlier this week and fixed it here:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=bbarrosp/front-end-050414&id=f82e49c5142309dd09d6bcc1f9c67f63141c3175
Comment 3 Belen Barros Pena 2014-03-06 10:38:54 UTC
(In reply to comment #2)
> I found this problem earlier this week and fixed it here:
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=bbarrosp/
> front-end-050414&id=f82e49c5142309dd09d6bcc1f9c67f63141c3175

Sorry, forget that: it no longer works after rebasing
Comment 5 David Reyna 2014-03-07 02:13:34 UTC
There are three places in tasks that need update in the GUI for the "Empty" outcome.

  1. In the "TASK_OUTCOME_HELP" structure in the model, missing the string mapping for OUTCOME_EMPTY.

  2. In the tasks view for sorting on Empty.

  3. In the format of the Task detail page when Empty, missing the "This task is empty because ..." message.

The patch from Belen "2014-03-06 17:33:01 UTC " does not address these issues, so I will prepare a patch for them.
Comment 6 David Reyna 2014-03-17 05:47:53 UTC
commit 324791a729d29b929dd2c78489f2564d5e01ad92

Test Instructions:

  1) In the tasks page, you can now sort by "Empty"

  2) In the task detail page for "Empty" tasks, the help icon now has the text "This task has no executable content"

  3) In the task detail page for "Empty" tasks, you now have the <div> for "empty" outcomes of:

     "This task is empty because it has the <code>noexec</code> flag set to <code>1</code>, or the task function is empty"
Comment 7 Mihail Stanciu 2014-08-01 15:06:57 UTC
Verified on master: 2d1660112e54653f7bb763939d0416472c49fe01