1. 20 Mar, 2020 1 commit
    • Laurent Wouters's avatar
      [rql] Store selected variables for RQL select queries in ResultSet (#17218476) · 6eae252361e5
      Laurent Wouters authored
      By storing the name of the selected variables for RQL select queries in the
      ResultSet (within the "variables" attribute), the information can be passed
      down to specific protocols, e.g. rqlio that may wish to pass is down further
      to clients.
      In turn, clients can then choose to present the results of RQL select queries
      as symbolic bindings using the names used in the query's projection, instead of
      ordinal arrays.
      6eae252361e5
  2. 25 Feb, 2020 1 commit
  3. 19 Dec, 2019 1 commit
  4. 13 Mar, 2019 1 commit
    • Nicolas Chauvat's avatar
      [server.rqlannotation] rename SQLGenAnnotator to RQLAnnotator · 194e9ae964ed
      Nicolas Chauvat authored
      This class is in charge of annotating the RQL syntax tree with
      various bits of information, like (in)variance, use of
      full-text-index, etc. It is a needed step before the generation
      of SQL, but does not touch SQL directly. Hence RQLAnnotator
      seems a better name.
      194e9ae964ed
  5. 12 Mar, 2019 1 commit
  6. 11 Sep, 2019 1 commit
    • Philippe Pepiot's avatar
      Avoid to update inlined relation column to NULL when deleting entities · 1a2c7d6397ec
      Philippe Pepiot authored
      When deleting entities, cubicweb run a rql DELETE on all relations to trigger hooks.
      For an inlined relation this also mean set the column to NULL. This operation
      may fail if there's additional constraints on the column.
      
      Also this is a weird and useless behavior since deleting the entity row will by
      definition delete the relation.
      
      We still doesn't handle the case where both subject and object are going to be
      deleted because rows need to be deleted in a particular order that cubicweb
      doesn't handle.
      
      Add a test checking UPDATE does not occur but hooks are correctly called.
      
      Closes #17236690
      
      --HG--
      branch : 3.26
      1a2c7d6397ec
  7. 16 Oct, 2019 1 commit
  8. 24 Jul, 2019 1 commit
  9. 16 May, 2019 1 commit
    • Julien Tayon's avatar
      [ldapfeed] FIX: Unique Key violation when synchronizing with LDAPfeed · 3f125fdbcd70
      Julien Tayon authored
      What was happening
      ==================
      
      The bug appears when ldapfeed tries to insert a user while another user exists
      exists with a different source.
      
      Simple use case to reproduce:
      
      - create a local user in cubicweb (source=system)
      - sync with ldap
      - ldapfeed will stop complaining user already exists.
      
      Without next patch the test MUST fail with message:
      cubicweb/server/sources/native.py:714: UniqueTogetherError
      
      The ldapfeed is thus stopped ignoring any further ldap entries.
      
      
      The proposal
      ============
      
      Prior to this patch, the insertion was trying to create all CWUser with the
      computed login from eeimporter.extid2eid (method process of DataFeedLDAPAdapter).
      
      When a CWUser existed with a different cw_source ("system" for user created
      with cubicweb for instance), it created a conflict.
      
      To avoid collisions, in the extentities_generator method a bypass
      was added at the insertion layer.
      
      Prior to insertion the absence of the computed login is checked on a list of
      all existing login from a different source.
      
      If collision is detected, we skip the ldap record.
      
      By short circuiting at the CWUser entity insertion level we also avoid to treat
      CWGroup and EmailAddress related to this user.
      Hence ensuring a behaviour that will not break existing instances.
      (conservative approach: faced with ambiguity better do nothing than guess).
      
      An error message is added stating explicitly the conflict.
      
      --HG--
      branch : 3.26
      3f125fdbcd70
  10. 28 Mar, 2019 1 commit
    • Philippe Pepiot's avatar
      [server/test] make test filename uniques · 3648a2c293f6
      Philippe Pepiot authored
      To avoid these pytest error when collecting the whole test suite:
      
      import file mismatch:
      imported module 'unittest_utils' has this __file__ attribute:
        cubicweb/cubicweb/server/test/unittest_utils.py
      which is not the same as the test file we want to collect:
        cubicweb/cubicweb/test/unittest_utils.py
      
      
      Move cubicweb/server/test/unittest_security.py to cubicweb/server/test/unittest_security.py
      and cubicweb/test/unittest_utils.py to cubicweb/test/unittest_server_utils.py
      3648a2c293f6
  11. 26 Mar, 2019 1 commit
  12. 05 Apr, 2019 1 commit
    • Denis Laxalde's avatar
      Drop python2 support · 26744ad37953
      Denis Laxalde authored
      This mostly consists in removing the dependency on "six" and updating
      the code to use only Python3 idioms.
      
      Notice that we previously used TemporaryDirectory from
      cubicweb.devtools.testlib for compatibility with Python2. We now
      directly import it from tempfile.
      26744ad37953
  13. 28 Mar, 2019 1 commit
  14. 22 Mar, 2019 1 commit
  15. 15 Mar, 2019 2 commits
    • Denis Laxalde's avatar
      Skip tests for ldapsource with python >= 3.7 · f59439bac0a8
      Denis Laxalde authored
      Until someone works on fixing these, this should make our CI green
      again.
      
      I tried to use setupModule() to check for python version, but
      pre_setup_database() is apparently called even when a SkipTest exception
      is raised there. So handle this in that method.
      (grafted from 4d68d20427de)
      
      --HG--
      branch : 3.26
      f59439bac0a8
    • Denis Laxalde's avatar
      Skip tests for ldapsource with python >= 3.7 · 4d68d20427de
      Denis Laxalde authored
      Until someone works on fixing these, this should make our CI green
      again.
      
      I tried to use setupModule() to check for python version, but
      pre_setup_database() is apparently called even when a SkipTest exception
      is raised there. So handle this in that method.
      4d68d20427de
  16. 19 Mar, 2019 1 commit
    • Philippe Pepiot's avatar
      [server/test] do not depend on third party cubes · 2d43c8b30ef0
      Philippe Pepiot authored
      Drop requirement of basket, card, comment, file, localperms and tag cubes for
      cubicweb.server tests.
      Copy needed part of schema, entities, views, hooks into the
      cubicweb/server/test/data directory (which is included in PYTHONPATH for
      CubicWebTC tests).
      For migration tests which use different "datapath", use symlinks to have dependent cubes importables.
      2d43c8b30ef0
  17. 15 Mar, 2019 1 commit
  18. 13 Mar, 2019 1 commit
  19. 11 Mar, 2019 1 commit
    • Philippe Pepiot's avatar
      [schema] drop monkeypatch "name_for" on BaseConstraint · 661dd0436c01
      Philippe Pepiot authored
      BaseConstraint doesn't have "name_for" method, this is just an addition for
      cubicweb needs.
      
      Implement this as a function instead of a monkeypatch to avoid having
      "name_for" not defined because cubicweb.schema hasn't been imported.
      
      In particular this fix running cubicweb/server/test/unittest_schema2sql.py::SQLSchemaTC::test_known_values alone.
      661dd0436c01
  20. 14 Mar, 2019 1 commit
    • Denis Laxalde's avatar
      Drop most of deprecated code · a8c1ea390400
      Denis Laxalde authored
      As in previous changesets, most code has been deprecated since a very
      long time. This changeset concerns "core" cubicweb modules
      (e.g. "server", "appobjects") for which it's not easy to handle change
      atomically.
      
      In cubicweb/server/querier.py, we adjust empty_rset() function as a
      result of "rqlst" argument of ResultSet being dropped. (There was no use
      of the keyword argument anyways.)
      a8c1ea390400
  21. 12 Mar, 2019 1 commit
  22. 24 Apr, 2018 1 commit
    • Laurent Wouters's avatar
      [server] Fixed issue with the adapters cache of a cloned EditedEntity · 5b6f54f6033a
      Laurent Wouters authored
      The adapters' cache of the entity within an EditedEntity used to be copied along
      the entity itself during a cloning operation of the EditedEntity. This raises
      an issue when the adapters' cache is not empty and contains cached values
      linking to transaction-specific data (or the transaction itself). This prevents
      the clone EditedEntity being used in a transaction outside the one that created
      it.
      
      This change resets the adapters' cache of the new copy so that no cached value
      remain. The new copy can then be used in a new transaction afterwards.
      
      --HG--
      branch : 3.26
      5b6f54f6033a
  23. 12 Oct, 2017 1 commit
  24. 30 Nov, 2017 1 commit
    • Denis Laxalde's avatar
      [ssplanner] Prevent execution of write queries involving computed relations · 68ca7fe0ca29
      Denis Laxalde authored
      Previously, setting a computed relation upon entity creation or
      modification (using the ORM or an RQL query) would usually fail with an
      operational error in the backend ("no such table"). However, under some
      mysterious circumstances (like passing a string as value in cw_set for a
      computed relation), the RQL to SQL transformation would simply drop the
      clause.
      
      To prevent this to happen, we add a check for computed relation before
      adding a relation to an execution plan. This check raises a QueryError.
      It happens in several places:
      
      * in querier.InsertPlan.add_relation_def() (called from several places
        in ssplanner steps) for INSERT queries,
      * in ssplanner.UpdateStep.execute() for SET queries and,
      * in ssplanner.SSplanner.build_delete_plan() for DELETE queries.
      
      Tests added to unittest_querier.py because unittest_sslplanner.py looked
      inappropriate (it has only unit tests) and the former already had a
      NonRegressionTC class.
      68ca7fe0ca29
  25. 03 Nov, 2017 4 commits
  26. 24 Apr, 2018 1 commit
    • Laurent Wouters's avatar
      [server] Fixed issue with the adapters cache of a cloned EditedEntity · 38058ce2a9ec
      Laurent Wouters authored
      The adapters' cache of the entity within an EditedEntity used to be copied along
      the entity itself during a cloning operation of the EditedEntity. This raises
      an issue when the adapters' cache is not empty and contains cached values
      linking to transaction-specific data (or the transaction itself). This prevents
      the clone EditedEntity being used in a transaction outside the one that created
      it.
      
      This change resets the adapters' cache of the new copy so that no cached value
      remain. The new copy can then be used in a new transaction afterwards.
      38058ce2a9ec
  27. 15 Sep, 2017 3 commits
  28. 30 Oct, 2017 1 commit
  29. 12 Apr, 2017 5 commits
  30. 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.
      
      --HG--
      branch : 3.25
      d540defa0591