Wed, 05 Apr 2017 14:31:44 +0200 [server] Inline _entity_update method into init method of AbstractSource 3.25
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 05 Apr 2017 14:31:44 +0200] rev 12144
[server] Inline _entity_update method into init method of AbstractSource This _entity_update method does not make sense now that we do not update source from database information but always build them afresh.
Wed, 05 Apr 2017 14:02:58 +0200 [server] Drop update_config method of source 3.25
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 05 Apr 2017 14:02:58 +0200] rev 12143
[server] Drop update_config method of source It does not make sense anymore to update the config of a source instance (subclass of cubicweb.server.sources.AbstractSource) now that they are always built from database information (CWSource). In datafeed and ldapfeed, we move all code from "update_config" method in "init" method. This changeset fixes LDAPFeedUserDeletionTC.test_a_filter_inactivate() failure (unittest_ldapsource.py) introduces in previous changeset.
Tue, 04 Apr 2017 16:28:50 +0200 [server] Make "sources_by_uri" and "sources_by_eid" properties of repository 3.25
Denis Laxalde <denis.laxalde@logilab.fr> [Tue, 04 Apr 2017 16:28:50 +0200] rev 12142
[server] Make "sources_by_uri" and "sources_by_eid" properties of repository I.e. do not populate these dict as repo initialization (bootstrap step) but always use information from database. This is needed because when multiple instances of the same application run, if one instance adds a CWSource the other ones will not see it. In particular, when using a scheduler instance, new CWSource will be added by the web instance and not seen by the scheduler which is supposed to update them. We thus define properties for sources_by_eid and sources_by_uri instead attributes on repository instance. CWSource entities are thus retrieved from database every time these properties are accessed. We factor out initialization of the "source" instance (subclass of cubicweb.server.source.AbstractSource) in a _sources() method. Note that this method takes care of calling "init" method on the source as well as "set_schema" (previously done in repo.set_schema(), which now only touches system_source). Accordingly the "init_sources_from_database" method is dropped along with "add_source"/"remove_source" methods. In syncsources hook, we thus drop: * SourceAddedOp operation which called repo.add_source() so that the SourceAddedHook only cares about checking source configuration now; * SourceRemovedOp and SourceRenamedOp operations for the same reason; * SourceConfigUpdatedOp as updating the live config of source is meaningless once we rely on them being retrieved from the database; * SourceHostConfigUpdatedHook hook which is now useless without call to SourceConfigUpdatedOp; In 3.10 migration script, remove usage of sources_by_uri repo attribute which, unless I'm missing something, appears useless (at least now). In tests: * unittest_datafeed: remove test_update_url method since we dropped respective hook; * unittest_ldapsource: LDAPFeedUserDeletionTC.test_a_filter_inactivate() currently fails because it still relies on live config being updated, this will be fixed in the next changeset once all "live source" logic will be removed.
(0) -10000 -3000 -1000 -300 -100 -30 -10 -3 +3 +10 +30 +100 +300 tip