cubicweb #2330799 crash on db-dump --format=portable [validation pending]

Applications using the container cube annotate their entity classes with data that is used at registration time in hooks (amongst other).

However the appobjets directories are processed in "set order" and whenever hooks are processed before entities, the code burns.

The real fix would be to have proper annotations on Yams schemas; that would alleviate the need to annotate on entity classes and introduce an unwanted dependency between appobjects at registration time.

Traceback (most recent call last):
 File "/home/auc/bin/ctl", line 10, in <module>
   run(sys.argv[1:])
 File "/home/auc/src/fcw/cubicweb/cwctl.py", line 1017, in run
   CWCTL.run(args)
 File "/home/auc/src/fcw/logilab/common/clcommands.py", line 134, in run
   sys.exit(command.main_run(args, rcfile))
 File "/home/auc/src/fcw/logilab/common/clcommands.py", line 263, in main_run
   self.run(args)
 File "/home/auc/src/fcw/cubicweb/server/serverctl.py", line 830, in run
   _local_dump(appid, self.config.output, format=self.config.format)
 File "/home/auc/src/fcw/cubicweb/server/serverctl.py", line 734, in _local_dump
   mih.backup_database(output, askconfirm=False, format=format)
 File "/home/auc/src/fcw/cubicweb/server/migractions.py", line 198, in backup_database
   source.backup(osp.join(tmpdir, source.uri), self.confirm, format=format)
 File "/home/auc/src/fcw/cubicweb/server/sources/native.py", line 376, in backup
   self.repo.fill_schema()
 File "/home/auc/src/fcw/cubicweb/server/repository.py", line 354, in fill_schema
   self.set_schema(appschema)
 File "/home/auc/src/fcw/cubicweb/server/repository.py", line 323, in set_schema
   self.vreg.set_schema(schema)
 File "/home/auc/src/fcw/cubicweb/cwvreg.py", line 559, in set_schema
   self.reload(self.config.vregistry_path(), force_reload=False)
 File "/home/auc/src/fcw/cubicweb/cwvreg.py", line 587, in reload
   self.register_objects(path)
 File "/home/auc/src/fcw/cubicweb/cwvreg.py", line 645, in register_objects
   path, self.config.extrapath)
 File "/home/auc/src/fcw/logilab/common/registry.py", line 578, in register_objects
   self.load_file(filepath, modname)
 File "/home/auc/src/fcw/logilab/common/registry.py", line 634, in load_file
   self.load_module(module)
 File "/home/auc/src/fcw/logilab/common/registry.py", line 639, in load_module
   module.registration_callback(self)
 File "/home/auc/src/fcw/cubes/pylos/hooks/case.py", line 76, in registration_callback
   rtypes, etypes = case_static_structure(vreg)
 File "/home/auc/src/fcw/cubes/pylos/container.py", line 17, in case_static_structure
   skiprtypes = vreg['etypes'].etype_class('Case').container_skiprtypes
AttributeError: type object 'Case' has no attribute 'container_skiprtypes'
prioritynormal
typebug
done in3.14.8
load0.100
load left0.000
closed by#a9a7ae11dfb0 [cwconfig] impose an order on appobject paths processing: entities first (closes #2330799)