<?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>7642</bug_id>
          
          <creation_ts>2015-04-22 10:12:23 +0000</creation_ts>
          <short_desc>devtool: add recipe upgrade functionality</short_desc>
          <delta_ts>2015-10-15 10:43:37 +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>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>1.8</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.9 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>anibal.limon</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          <qa_contact name="Costin">costin.c.constantin</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50465</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-22 10:12:23 +0000</bug_when>
    <thetext>The Automatic Upgrade Helper has the ability to do recipe upgrades, but quite often the process of recipe upgrading requires fixing/updating associated patches (and possibly adding new ones), which is an interactive process. We have the infrastructure for making this easier in devtool, so it would make sense to add the ability to start a recipe upgrade from devtool (or finish an upgrade that has been started by the AUH and emailed to the maintainer for fixing/review).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50927</commentid>
    <comment_count>1</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2015-05-12 15:21:13 +0000</bug_when>
    <thetext>For the upgrade flow i propose,

upgrade -t version source
validate version/source
download source
copy old recipe to new recipe / handle include files
update license check sums
get a list of current patches
remove all patches

patch cycle (if applies)
apply patch
        - if not apply did a interactive action
                maybe remove or rebase
end patching

test recipe/deploy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50933</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-12 15:36:12 +0000</bug_when>
    <thetext>I had assumed it would be:

  devtool upgrade recipename [-V version]

This would do all of the steps before &quot;test recipe/deploy&quot;, leaving you with the upgraded recipe in the workspace layer once all patches have been dealt with. If you then do devtool update-recipe it would then replace the original recipe with the upgraded one.

We already have pretty much all of this logic in the AUH though, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50934</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-12 15:37:01 +0000</bug_when>
    <thetext>(Oops, I missed out the source tree path parameter in the above.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50937</commentid>
    <comment_count>4</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2015-05-12 16:56:26 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (Oops, I missed out the source tree path parameter in the above.)

(In reply to comment #2)
&gt; I had assumed it would be:
&gt; 
&gt;   devtool upgrade recipename [-V version]
&gt; 
&gt; This would do all of the steps before &quot;test recipe/deploy&quot;, leaving you with
&gt; the upgraded recipe in the workspace layer once all patches have been dealt
&gt; with. If you then do devtool update-recipe it would then replace the
&gt; original recipe with the upgraded one.
&gt; 
&gt; We already have pretty much all of this logic in the AUH though, right?

Almost yes the AUH does not handle patches because it requires an interactive action of the developer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50938</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-12 17:08:37 +0000</bug_when>
    <thetext>Right. For the patch handling, devtool&apos;s patch application code uses our normal do_patch logic - which means we may be able to get away with setting PATCHRESOLVE = &quot;user&quot; for that (you&apos;d have to try it though, I don&apos;t know how well that works in the context devtool runs it).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52510</commentid>
    <comment_count>6</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-07-21 22:24:53 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I had assumed it would be:
&gt; 
&gt;   devtool upgrade recipename [-V version]
&gt; 
&gt; This would do all of the steps before &quot;test recipe/deploy&quot;, leaving you with
&gt; the upgraded recipe in the workspace layer once all patches have been dealt
&gt; with. If you then do devtool update-recipe it would then replace the
&gt; original recipe with the upgraded one.
&gt; 
&gt; We already have pretty much all of this logic in the AUH though, right?

Paul, after spending some time I got to the conclusion that we should use the AUH code for this feature (as you mentioned before).

We have two ways, 1) taking the relevant code from AUH and place it into the poky&apos;s script/lib/devtool folder or 2) from devtool call the AUH app. Of course, 2) implies having the AUH repository somewhere on the host machine, making devtool dependent of AUH. I would go for 1 at this moment, but this means that we would have duplicated code, something not really wanted. Let me know what you think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52515</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-07-22 11:07:31 +0000</bug_when>
    <thetext>I think it has to be #1, but I would like it to be done in a way that the AUH code gets updated to make use of the new code brought across at the same time, so we don&apos;t end up with any duplication. This should also be an opportunity to have the AUH code use the functions in recipeutils to make changes to the recipe files rather than using its own implementation as it does now. Can you work with Anibal on that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52606</commentid>
    <comment_count>8</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-07-26 02:29:52 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; I think it has to be #1, but I would like it to be done in a way that the
&gt; AUH code gets updated to make use of the new code brought across at the same
&gt; time, so we don&apos;t end up with any duplication. This should also be an
&gt; opportunity to have the AUH code use the functions in recipeutils to make
&gt; changes to the recipe files rather than using its own implementation as it
&gt; does now. Can you work with Anibal on that?

Paul,
I finished this task. On Monday, I will review it with Anibal. I do not want to send the patch until we review it and create also some tests. At the end, I did not use the recipeutils library, so code is almost as the AUH code at this point. Future improvements should use the latter library and AUH should call devtool for recipe&apos;s upgrade operation. I am afraid I can make it for 1.9M2, but next week this work should be done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52813</commentid>
    <comment_count>9</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-08-04 13:49:23 +0000</bug_when>
    <thetext>The implementation is currently being review by the AUH maintainer (Anibal Limon). Sending the final patch to the OE-Core list this week.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53005</commentid>
    <comment_count>10</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-08-11 22:17:16 +0000</bug_when>
    <thetext>An RFC patch sent to the ML, waiting for comments.

Subject: [PATCH 0/1][RFC] devtool: Upgrade feature
From: Leonardo Sandoval &lt;leonardo.sandoval.gonzalez@linux.intel.com&gt;

There are several approaches when upgrading a recipe and on this patch
it was decided to reused the code from the auto-upgrade-helper [1] and ported it into
the devtool. There are several pending tasks as described in the patch&apos;s description. 
The progress of this feature is being track on [2].

[1] http://git.yoctoproject.org/cgit/cgit.cgi/auto-upgrade-helper/
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=7642</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53153</commentid>
    <comment_count>11</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-08-17 17:09:48 +0000</bug_when>
    <thetext>V1 patches had several comments from Paul, so It will take around 10 days to complete.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53574</commentid>
    <comment_count>12</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-08-31 16:18:46 +0000</bug_when>
    <thetext>V3 set of patches sent to the ML.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54087</commentid>
    <comment_count>13</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-09-15 14:22:16 +0000</bug_when>
    <thetext>Patch now in master branch (8be95c5)

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8be95c5fbe6ad970943edabe288fd47d1dcac288</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55347</commentid>
    <comment_count>14</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-10-15 10:43:37 +0000</bug_when>
    <thetext>Hello,

Tested on master with d302c98822efe2cb78a63b620aed1b94b4ed4a68 on Ubuntu 15.04

To test, i just reproduced the related oe-selftest  testcase devtool.DevtoolTests.test_devtool_upgrade

Marking as verified</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>