1. 28 Apr, 2017 1 commit
    • Philippe Pepiot's avatar
      [req] fix find() generating non-rewritable rql on non final relations · af5d0a3c3f1a
      Philippe Pepiot authored
      When filtering on a relation, find() was generating rql like
      'Any X WHERE X is ETYPE, X relation EID' which work without being rewritten (it
      should probably not), but when applying some rewrite (eg. permissions) it raise
      in rqlrewrite code.
      	def _use_orig_term(self, snippet_varname, term):
      	>       self.rewritten[key] = term.name
      	E       AttributeError: 'Constant' object has no attribute 'name'
      Generate valid rql instead 'Any X WHERE X is ETYPE, X relation Y, Y eid EID'.
  2. 26 Apr, 2017 1 commit
  3. 25 Apr, 2017 3 commits
  4. 21 Apr, 2017 2 commits
  5. 25 Apr, 2017 1 commit
  6. 20 Apr, 2017 1 commit
  7. 21 Apr, 2017 1 commit
    • Sylvain Thénault's avatar
      [rqlrewrite] Fix rewrite on ambiguities introduced by NOT relation or "is IN" type restriction · 02b8325720d6
      Sylvain Thénault authored
      When some inserted RQL snippet generate more solutions than the original RQL,
      the rewriter attempt to duplicate the snippet for each newly introduced
      solution. There are though some cases where we do not want this behaviour in
      case of ambiguities introduced by:
      * NOT(X relation Y) expression, since it won't be
        equivalent to NOT(X relation Y1, Y1 is Type1) OR NOT(X relation Y2, Y2 is
        Type2) ;
      * EXISTS(X relation Y, Y is IN (Type1, Type2) expression, since it's not
        actually necessary to split an explicitly introduced ambiguity (and it crash
        if we attempt to do so, so...).
      In test, we've to modify the `rewrite()` function because in the newly
      introduced test we need the same constraint to be applied to two variables in
      the original query, and this was not supported before.
      Notice the generated RQL in test is still *NOT CORRECT* "(EXISTS(NOT EXISTS() OR
      EXISTS(...))", or at least isn't optimal. This will be fixed in a forthcoming
      Related to #17074119
  8. 19 Apr, 2017 1 commit
  9. 20 Apr, 2017 1 commit
  10. 19 Apr, 2017 5 commits
  11. 14 Apr, 2017 4 commits
  12. 13 Apr, 2017 3 commits
    • Sylvain Thénault's avatar
      [entities] Fix backward compat of IDublinCore adapter wrt dc_long_title · 608481168432
      Sylvain Thénault authored
      `entity.dc_long_title()` used to fallback to `dc_title()`, and most entity types
      were relying on this, thus only implementing the later.
      Since introduction of the IDublinCore adapter, if one call
      `entity.dc_long_title()` on an entity that only implements `dc_title()`, it will retrieve
      the adapter which will then call its own `title()` method instead of the
      `dc_title()` method of the entity as expected.
      Fix this by calling instead `entity.dc_title()` which will eventually kick in the
      backward compat layer if necessary.
      branch : 3.25
    • Denis Laxalde's avatar
      [web] Do not try to rmtree symlinks in rmtreecontent() · 8a1306c43656
      Denis Laxalde authored
      There is a symlink in data directory (created by generate_static_dir() method)
      and trying to rmtree() it will fail with an OSError. So we unlink() it
      branch : 3.25
    • Denis Laxalde's avatar
      [pkg] Version 3.25.0rc3 · 241bb09c67f7
      Denis Laxalde authored
      branch : 3.25
  13. 12 Apr, 2017 11 commits
  14. 05 Apr, 2017 1 commit
    • Denis Laxalde's avatar
      [server] Add source_by_eid and source_by_uri methods to repository · d540defa0591
      Denis Laxalde authored
      Most of the times we only need to retrieve one source (either by uri or eid)
      and querying sources_by_eid and sources_by_uri properties on repository just
      for one item is costly. So these methods query what's needed. We issue a
      ValueError (instead of KeyError for sources_by_{eid,uri} dict) in case the key
      is not found.
      branch : 3.25
  15. 04 Apr, 2017 1 commit
  16. 05 Apr, 2017 2 commits
    • Denis Laxalde's avatar
      [server] Inline _entity_update method into init method of AbstractSource · f54286c1cef5
      Denis Laxalde authored
      This _entity_update method does not make sense now that we do not update
      source from database information but always build them afresh.
      branch : 3.25
    • Denis Laxalde's avatar
      [server] Drop update_config method of source · a446124bcf3c
      Denis Laxalde authored
      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.
      branch : 3.25
  17. 04 Apr, 2017 1 commit
    • Denis Laxalde's avatar
      [server] Make "sources_by_uri" and "sources_by_eid" properties of repository · db2fc87348ab
      Denis Laxalde authored
      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
      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
      * 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
      branch : 3.25