1. 12 Nov, 2019 1 commit
    • Jérome Perrin's avatar
      ERP5Type: add a transaction note when bootstraping · 36612ca4
      Jérome Perrin authored
      Bootstrap is actually the automatic migration of tools. It happened to me
      several times that I mistakenly start an old instance on a too new version of
      products and this instance is migrated automatically.
      
      By leaving a note in transaction it's easier to find out which
      transaction performed the automatic migration to revert to the state
      before using technique such as
      https://blog.gocept.com/2019/06/14/undo-transactions-by-truncating-zodb-data-fs/
      for FileStorage.
      
      with this change, a command such as;
      
          python -m ZODB.scripts.fstail -n 20 ./instance/slappart6/srv/zodb/root.fs
      
      show something like:
      
          2019-11-12 02:46:42.106313: hash=44fecb9a63411fbf305cea82f4c699c478000d61
          user=' None' description='/timer_service/process_timer\nSite migrated' length=462938 offset=881877846 (+70)
      
      for the transaction which did the migration, so it's easy to repair.
      36612ca4
  2. 29 Oct, 2019 3 commits
    • Arnaud Fontaine's avatar
    • Arnaud Fontaine's avatar
      ZODB Components: Enable checking of imports with pylint. · 1cb2dc4c
      Arnaud Fontaine authored
      Until now it was disabled which means that if Component A imports Component B
      and the latter is not in {validated,modified} state, Component A could be
      validated without raising any error and failed at execution time.
      
      As this relies on Pylint transform/hook and avoiding monkey patch as much
      as possible, make Products.ERP5Type.patches.pylint available for Python3 (not
      actually tested with ERP5 but no AttributeError nor ImportError with Python3
      with this code).
      
      Also, allow developer to call validate action from 'modified' state to handle
      import use case:
        1. Edit A which raises an error stating that B.
        2. Fix B and validate it.
        3. Validate again A without requiring a modification of {reference,version,text_content}.
      1cb2dc4c
    • Arnaud Fontaine's avatar
      ZODB Components: Source code was checked even when setting... · 88a03532
      Arnaud Fontaine authored
      ZODB Components: Source code was checked even when setting text_content_{error,warning}_message_list properties.
      
      So only check source code and validate when _set{TextContent,Reference,Version}
      are called and remove wildcards.
      88a03532
  3. 25 Oct, 2019 3 commits
  4. 24 Oct, 2019 6 commits
  5. 23 Oct, 2019 7 commits
  6. 18 Oct, 2019 1 commit
  7. 17 Oct, 2019 2 commits
    • Arnaud Fontaine's avatar
      ZODB Components: Add 'Origin' (source_reference) field showing from which FS... · cf632afb
      Arnaud Fontaine authored
      ZODB Components: Add 'Origin' (source_reference) field showing from which FS module it was imported.
      cf632afb
    • Arnaud Fontaine's avatar
      ZODB Components: Do not validate nor check {consistency,source code} after importing from FS. · 799da311
      Arnaud Fontaine authored
      * pylint may return a false positive error which have to be disabled and
        failing to import it because of that requires to edit on the FS and try
        again so it is not practical for a whole Product. Instead it is easier
        to import it and not validate
      * Validation was done only for 'Test Component' and 'Extension Component',
        but all imported Components had their consistency and source code checked
        and this is not consistent to not validate but do these checks.
      * importFromFilesystem() was checking consistency and source code, and this
        was done again when validating.
      
      So leave the imported ZODB Components as draft and let the developer fixes
      issues upon validation before committing.
      799da311
  8. 16 Oct, 2019 1 commit
    • Arnaud Fontaine's avatar
      ZODB Components: List of migratable 'Module Components' in Products.XXX.*... · f675c0fb
      Arnaud Fontaine authored
      ZODB Components: List of migratable 'Module Components' in Products.XXX.* should include any kind of objects and not only modules.
      
      This fixes Products.ERP5VCS.Git module not being displayed because
      Products.ERP5VCS.__init__ only imports one of its class and not the whole
      module (and the module was not imported anywhere else too) so it was not in
      Products.ERP5VCS.__dict__.
      f675c0fb
  9. 15 Oct, 2019 2 commits
  10. 14 Oct, 2019 1 commit
  11. 11 Oct, 2019 2 commits
  12. 10 Oct, 2019 7 commits
  13. 09 Oct, 2019 4 commits
    • Arnaud Fontaine's avatar
      ZODB Components: Monkey patch pylint to avoid 'No config file found, using... · b58aeb23
      Arnaud Fontaine authored
      ZODB Components: Monkey patch pylint to avoid 'No config file found, using default configuration' on stderr.
      
      Another solution could have been to have a configuration file for pylint instead
      of command line arguments but it depends on the type of Component (for example
      'Interface Component' has specific arguments).
      b58aeb23
    • Ivan Tyagov's avatar
      Value of text_content is an unicode string whose (inside XML) encoding is... · f9e67207
      Ivan Tyagov authored
      Value of text_content is an unicode string whose (inside XML) encoding is utf-8. This inconsistency raises in xml library thus it is safer to convert back to utf-8 which is the intended encoding anyway.
      f9e67207
    • Arnaud Fontaine's avatar
      ZODB Components: Migrate ERP5ShortMessage Product and fix pylint warnings. · f83f35e4
      Arnaud Fontaine authored
      After upgrading bt5s, portal_sms may still ERP5BaseBroken until restarting Zope.
      f83f35e4
    • Arnaud Fontaine's avatar
      ZODB Components: Allow migration of {Interface,Mixin,Module,Tool} from... · d8961c51
      Arnaud Fontaine authored
      ZODB Components: Allow migration of {Interface,Mixin,Module,Tool} from Business Template UI and on all Products (not only Products.ERP5).
      
      This introduces the following new ZODB Components:
        + Module Component: Non-Documents/non-persistent classes of modules usually
          found at the top-level of Products (eg Products.ERP5.XXX) on FS. Considering
          that all other Components types are actually Modules, make it the base class.
        + Tool Component: Tool directory of Products on FS (eg Products.ERP5.Tool.XXX).
          => DiffTool and CallableTool are now 'Tool Component' instead of plain
             'Document Component' and properly registered as Tools like FS Products Tool.
      
      Skip CMFActivity and HBTreeFolder2 Products for now in migration View for now as
      almost many Portal Type classes have ActiveObject or HBTreeFolder2 in their MRO
      and these Products will be done at the end anyway...
      d8961c51