<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5921</bug_id>
          
          <creation_ts>2014-03-06 16:29:58 +0000</creation_ts>
          <short_desc>Task outcomes are sorted by database value, instead of alphabetically</short_desc>
          <delta_ts>2014-07-31 16:42:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>1.6.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.6.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Belen Barros Pena">belen.barros.pena</reporter>
          <assigned_to name="David Reyna">david.reyna</assigned_to>
          <cc>alexandru.damian</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>bluelightning</cc>
    
    <cc>cristiana.voicu</cc>
    
    <cc>david.reyna</cc>
    
    <cc>jessica.zhang</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>40929</commentid>
    <comment_count>0</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2014-03-06 16:29:58 +0000</bug_when>
    <thetext>The outcomes seem to be sorted by database value, which means that you see the outcomes in this order:

Succeeded
Covered
Cached
Prebuilt
Failed
Empty

Of course, the above makes no sense when you are looking at the strings in the Toaster interface. They should be sorted in alphabetical order:

Cached
Covered
Empty
Failed
Prebuilt
Succeeded</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40930</commentid>
    <comment_count>1</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2014-03-06 16:31:34 +0000</bug_when>
    <thetext>toaster/master:213fef6e87cbf60d773e28d31653e3c626d4058e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41089</commentid>
    <comment_count>2</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2014-03-11 15:52:50 +0000</bug_when>
    <thetext>Is this a specific page ? How can I view this ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41093</commentid>
    <comment_count>3</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2014-03-11 16:07:11 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Is this a specific page ? How can I view this ?

Sorry: I wasn&apos;t very clear. In the tasks table, sort by the Outcome column.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41337</commentid>
    <comment_count>4</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2014-03-17 18:39:46 +0000</bug_when>
    <thetext>Fixing this would mean to break compatibility with the existing data builds.

The reason is that the system orders the outcomes based on the numeric values assigned to different tags. If we change the values, prior data will not make sense anymore.

Please advise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41374</commentid>
    <comment_count>5</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2014-03-18 14:18:36 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Fixing this would mean to break compatibility with the existing data builds.
&gt; 
&gt; The reason is that the system orders the outcomes based on the numeric
&gt; values assigned to different tags. If we change the values, prior data will
&gt; not make sense anymore.

This is what I guessed, but the problem is, as it behaves now it makes no sense, and the longer we wait to solve this problem the worse the impact of breaking the compatibility with previous data will get. 

We probably have no users right now outside of the people contributing, so now is the right time to make a change like this.

I&apos;ve cc&apos;ed Paul and David: it would be good to see what you guys think.

Thanks!


&gt; 
&gt; Please advise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41376</commentid>
    <comment_count>6</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2014-03-18 14:32:23 +0000</bug_when>
    <thetext>Hacking the data values to influence sorting seems like the wrong solution to me. If the values do not sort correctly then the answer is to add something else to the database so you can influence the sort order.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41891</commentid>
    <comment_count>7</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2014-03-28 10:25:47 +0000</bug_when>
    <thetext>We have the same problem with the &quot;Cache attempt&quot; column, by the way, where Failed will appear after File not in cache in the A to Z sorting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41928</commentid>
    <comment_count>8</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2014-03-31 05:54:14 +0000</bug_when>
    <thetext>The only general solution I can think of without polluting the database, is to 

  (a) hide the &apos;real&apos; ordeby value for the normal query processing

  (a) right before the pagination (since that is when the table is instantiated anyway), dynamically create a new virtual column with the text string values of the numerical field(s) and explicitly &quot;orderby&quot; this synthetic column.

That way we get a custom sort, and not much overhead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42631</commentid>
    <comment_count>9</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2014-04-14 02:52:48 +0000</bug_when>
    <thetext>I have completed 5921 for both the &quot;Outcome&quot; and the &quot;Cache attempt&quot; columns.

This used the technique of a python class ‘property’ as a ‘field’ together with an explicit python sort (instead of ‘sortby’), as described in this web site. This general method can be used for any transient or synthesized value of a class instance.

    http://blog.mattwoodward.com/2013/02/generating-and-sorting-on-transient.html

This patch handles both forward and reverse sorts, plus it handles the ‘-1’ base for the outcome text table and the convention of using a blank string for sstate_cache values of SSTATE_NA.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44893</commentid>
    <comment_count>10</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2014-07-31 16:42:16 +0000</bug_when>
    <thetext>merged to master

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?id=961f6226fa8019a7492ee40fdba18c5916065001</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>