<?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>10619</bug_id>
          
          <creation_ts>2016-11-08 09:55:49 +0000</creation_ts>
          <short_desc>Refactor wic codebase</short_desc>
          <delta_ts>2017-03-06 11:38:14 +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>Scripts and Tools</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>LET</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ed Bartosh">eduard.bartosh</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>ross.burton</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>68068</commentid>
    <comment_count>0</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-11-08 09:55:49 +0000</bug_when>
    <thetext>Currently wic code is quite hard to follow due to its complicated class inheritance and data models. It makes sense to refactor it to make it more maintainable and easier to change.

Possible areas of refactoring:
- get rid of msger logging in favor of logging Python module
- flatten directory structure. Directory paths similar to ./scripts/lib/wic/utils/oe/ with only one file misc.py inside it should be simplified.
- get rid of two different partition structures in direct and partitionedfs modules
- flatten class hierarchy. Currently it has a lot more levels of abstractions than needed for this simple tool
- get rid of two underscore-prefixed attributes and methods
- clean up the codebase. Currently pylint shows hundreds of warnings for it
...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69193</commentid>
    <comment_count>1</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-12-16 21:18:03 +0000</bug_when>
    <thetext>one more point from bug 10816: runner/exec code duplicates the other wrapping of subprocess done elsewhere in bitbake and oe-core</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69194</commentid>
    <comment_count>2</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2016-12-16 21:19:09 +0000</bug_when>
    <thetext>This would be nice, trying to trace the flow for that other recent issue took longer than it might have :) It felt a bit more like a c++ or java codebase -- more OOP than is usually seen in pythonic code, which tends to be more pragmatic and multi-paradigm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70062</commentid>
    <comment_count>3</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-01-23 22:57:12 +0000</bug_when>
    <thetext>one more area to lock at is configuration management. Code in conf.py and empty configuration file in config/wic.conf are very confusing. I think they should be removed. If we need this functionality we can implement it in much cleaner way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70330</commentid>
    <comment_count>4</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-01 14:38:55 +0000</bug_when>
    <thetext>First set of changes has been sent for review: http://lists.openembedded.org/pipermail/openembedded-core/2017-February/132117.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70427</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-03 21:27:43 +0000</bug_when>
    <thetext>flatten image class hierarchy: http://lists.openembedded.org/pipermail/openembedded-core/2017-February/132246.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70620</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-10 15:12:07 +0000</bug_when>
    <thetext>Simplified interfaces of DirectPlugin and underlying
set of APIs located in partitionedfs module. Removed one of
two different structures for partitioning info:

http://lists.openembedded.org/pipermail/openembedded-core/2017-February/132430.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70621</commentid>
    <comment_count>7</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-10 15:30:42 +0000</bug_when>
    <thetext>Moved partition operations to PartitionedImage:
http://lists.openembedded.org/pipermail/openembedded-core/2017-February/132558.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70709</commentid>
    <comment_count>8</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-15 09:04:33 +0000</bug_when>
    <thetext>Removed msger in favor of logging. Improved error handling:
http://lists.openembedded.org/pipermail/openembedded-core/2017-February/132782.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70745</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-16 15:58:55 +0000</bug_when>
    <thetext>Refactored plugin system: http://lists.openembedded.org/pipermail/openembedded-core/2017-February/132854.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70746</commentid>
    <comment_count>10</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-16 16:02:23 +0000</bug_when>
    <thetext>I&apos;m going to resolve this bug when all above mentioned patchset are merged.

However, there is still some work left on this area

- make use of ArgumentParser: bug #9636
- refactor engine.py and help.py
- replace plugin code that configures bootloaders with using configuration
  files (--configfile .wks option)
- refactor source plugins
- get rid of custom runner module in favor of using subprocess
- move the rest of the code from utils/ subdirectory to lib/wic/utils.py

I&apos;m going to address this when I have time and put it here as a reminder and in a hope that other people want to join me with this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71078</commentid>
    <comment_count>11</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-03-06 11:38:14 +0000</bug_when>
    <thetext>all patches have been merged to poky master</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>