1. 24 Apr, 2018 4 commits
    • Laurent Wouters's avatar
      [utils] Implements __iter__ on QueryCache · c96dd92e480e
      Laurent Wouters authored
      In order to be able to iterate over the currently cached queries (so that they
      may be inspected and invalidated), this changeset implementes __iter__ on
    • Laurent Wouters's avatar
      [utils] Added new get method to QueryCache · 9fd7d496e27e
      Laurent Wouters authored
      The new get method enables the retrieval an item in the cache by specifying a
      default value so that in the absence of an item for the key, the default value
      is returned.
    • David Douard's avatar
      [test/rset] typo · c1538e5ac532
      David Douard authored
    • Laurent Wouters's avatar
      [utils] Fixed issue in clearing QueryCache · 198cb7d7b4ac
      Laurent Wouters authored
      When trying to add an item in a full QueryCache, the cache tries to make room.
      It tries to list and remove non-permanent items with a transient counter (number
       of times it has been requested). However, there is a pathological case where
      items could be non-permanent but still not have a transient counter because they
      were added, but never requested. In some cases, the full cache could be flushed,
       including the permanent items.
      This changeset attempts to fix this issue by only dropping the non-permanent
      items that did not hav a transient counter.
  2. 13 Nov, 2017 1 commit
    • David Douard's avatar
      [statsd] add a statsd_timethis context manager · 0d474f888f4a
      David Douard authored
      This context manager allows to report to statsd the execution time of any
      piece of code, without the need for it to be a function or a method, like::
        def some_function():
          with statsd_timethis('some context message'):
  3. 24 Apr, 2018 3 commits
  4. 21 Sep, 2017 1 commit
  5. 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
      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.
  6. 23 Apr, 2018 4 commits
  7. 12 Jan, 2018 1 commit
    • Denis Laxalde's avatar
      [schema] Define a decorator to handle methods override · 46a8146f9703
      Denis Laxalde authored
      There is a number of external classes (from yams/rql) methods overridden
      "by hand" in cubicweb/schema.py. Define a single decorator to factor out
      the pattern. It handles specifying the method name (to avoid conflict
      with the local namespace) and passing the original method to the new
      definition when needed.
  8. 24 Jan, 2018 9 commits
  9. 12 Jan, 2018 3 commits
  10. 12 Dec, 2017 1 commit
    • Denis Laxalde's avatar
      [pyramid] Let logging be configured through .ini file · cd760c411242
      Denis Laxalde authored
      We do not initialize logging in CubicWebPyramidConfiguration thus
      preventing logging to be started with cubicweb's configuration. On the
      other hand, any logging configuration defined in ``development.ini``
      file will be loaded by whatever start the instance using this file (i.e.
      pserve, gunicorn, etc.). The benefit is that logging can now be
      configured per "qualified name" in this file (i.e. one can easily set
      the DEBUG level for the application cube while keeping all dependencies'
      level to WARNING). In the development.ini template, we add logger
      configurations for "logilab" and "cubicweb" qualified names (along with
      those of the application cube).
  11. 01 Dec, 2017 2 commits
    • Denis Laxalde's avatar
      Disable pytest's logs reporting · 6a71cb23f827
      Denis Laxalde authored
      CubicWeb already prints captured logs in stderr upon test failure, so we
      get them twice. Until we fix our logging management, disabling pytest
      capture and restore brings the output level back to sanity.
    • Denis Laxalde's avatar
      [pyramid] Do not issue security warnings in test mode · a46fb3f58ea2
      Denis Laxalde authored
      When some session or authtk secret is missing in Pyramid settings,
      scary "!! SECURITY WARNING !!" are issued. This is arguably pointless in
      tests. So disable them in this case.
  12. 30 Nov, 2017 3 commits
    • 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
      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.
    • Denis Laxalde's avatar
      [querier] Expand 'rdef' argument in InsertPlan.add_relation_def() · 06deb43c23c3
      Denis Laxalde authored
      Expand the 'rdef' tuple to improve readability. The 'rtype' value is not
      used at the moment, but will in the next changeset.
    • Denis Laxalde's avatar
  13. 03 Nov, 2017 4 commits
  14. 30 Oct, 2017 1 commit
  15. 24 Oct, 2017 1 commit
  16. 17 Oct, 2017 1 commit