Philippe Pepiot <philippe.pepiot@logilab.fr> [Wed, 25 Jan 2017 14:28:20 +0100] rev 11964
[web/views] show composite entities in delete view
Disabled by default, can be activated with show_composite = True Display first
level of composite entities in a treeview, limited to the current
(page_size - 1), so the maximum of displayed entities bump to
page_size * (page_size - 1).
Christophe de Vienne <christophe@unlish.com> [Mon, 11 May 2015 13:57:34 +0200] rev 11963
[workflow] Utilities for declarative definition of workflows
Closes #5337897
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 20 Feb 2017 15:56:07 +0100] rev 11962
[server] Remove pseudo-handling of exceptions in Repository._delete_cascade_multi()
It seems to me that we never want to pass on an exception here be it in "test"
mode or not, so remove the last `except Exception:` clause. For instance, the
actual implementation would pass on an IntegrityError and thus possibly hide
it in a log message.
Concerning the `except Unauthorized:`, as said by the log message this should
not happen because we are within a `security_enabled(write=False)` context. So
remove it as well.
As far as I can tell, this strange handling of exceptions dates from
37668bf302f5 and there is no clear justification to it.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Tue, 21 Feb 2017 10:12:47 +0100] rev 11961
[web] fix os.rename usage on windows when destination exists
os.rename on windows will raise OSError (or WindowsError subclass) when if
destination file already exists.
Also check that exception is EEXIST.
There is an attempt to fix in f6ba947c but using IOError instead of OSError.
Closes #14214794
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 09 Feb 2017 10:31:15 +0100] rev 11960
[skeleton] Add "cubicweb.session.secret" to development.ini
Commented as other "secret" settings.
At least, now all settings are present in the development.ini file.
[ci skip]
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 10 Feb 2017 16:55:23 +0100] rev 11959
[pyramid] Include 'cubicweb.pyramid.predicates' where it is used
It's only used in "rest_api" module.
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 10 Feb 2017 16:33:16 +0100] rev 11958
[pyramid] Rename make_cubicweb_application function as config_from_cwconfig
And update its docstring.
This function does not actually "make a cubicweb application", it just builds
a pyramid.config.Configurator instance from a CubicWeb config object.
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 08 Feb 2017 17:49:25 +0100] rev 11957
[server] Reprase messages of db-check to avoid using "system" and "sources"
And rather mention "entity type table" and "entities" table, which are
clearer references.
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 20 Feb 2017 16:39:07 +0100] rev 11956
[predicates] Fix reference to has_related_entities in partial_has_related_entities docstring
Philippe Pepiot <philippe.pepiot@logilab.fr> [Tue, 07 Feb 2017 13:47:03 +0100] rev 11955
Fix possible double import of cubes modules
When cubes using the new layout are imported with 'cubicweb_<cube>' and with
'cubes.<cube>', the same module is imported twice.
Handle this by adding 'cubes.<cube>' to sys.modules when importing from
'cubicweb_<cube>'.
Move load_module() to a sub class _CubesLoader to share informations computed
in find_modules().
Don't handle subpackages in _CubesImporter and rely on normal import machinery
instead.
Add a test and use unittest from cubicweb.devtools.testlib which resolve to
unittest2 on PY2 with assertLogs() method.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Wed, 08 Feb 2017 10:31:26 +0100] rev 11954
Make load_module() return existing module if present in sys.modules
Otherwise the reload() builtin will not work correctly:
https://www.python.org/dev/peps/pep-0302/#specification-part-1-the-importer-protocol
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 06 Feb 2017 15:43:19 +0100] rev 11953
[server] Ignore computed relations in "relations" integrity checker
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 06 Feb 2017 15:40:39 +0100] rev 11952
[server] Use global registry variable of integrity checker functions
Instead of querying globals() in checkintegrity.check(), we maintain a
_CHECKERS dict mapping checker name to function in checkintegrity module. This
is later used to build the list of available checkers in 'db-check' command
help.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Tue, 07 Feb 2017 18:18:22 +0100] rev 11951
[doc] Add 3.25 release notes
[ci skip]
Philippe Pepiot <philippe.pepiot@logilab.fr> [Fri, 27 Jan 2017 18:09:56 +0100] rev 11950
[repository] possibility to disable connections pooling
Add a new configuration option 'connections-pooler-enabled' (default yes). If
set to no, disable connection pooling and open new connections to the database
on demand. This allow to use CubicWeb with other poolers (such as pgbouncer).
Florent Cayré <florent.cayre@logilab.fr> [Thu, 02 Feb 2017 14:58:39 +0100] rev 11949
[js] Fix loading image URL
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 06 Feb 2017 11:21:31 +0100] rev 11948
[migration] Move pyramid-related migration after "entities" table modifications
Otherwise, we getting into `add_entity_type('CWSession')` we try to insert a
CWEType without any 'asource' column (per 3.24's schema) whereas the backend
still wants it.
Closes #17054035.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 03 Feb 2017 13:37:32 +0100] rev 11947
Merge 3.24.5 into default branch
Denis Laxalde <denis.laxalde@logilab.fr> [Tue, 10 Jan 2017 16:08:55 +0100] rev 11946
[entities] Introduce an IDublinCore adapter
Move all dc_ methods from AnyEntity to the new IDublinCore adapter and proxy
them through a __getattr__ method on AnyEntity.
Current test suite should be enough.
Closes #3119992.
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 27 Jan 2017 11:05:07 +0100] rev 11945
[skeleton] Add an entry point and configuration for running a Pyramid application
We add a `pyramid_main` function in __init__.py that instantiate the WSGI
application using "cubicweb.pyramid"; this is defined as an entry point (in
setup.py) so that pserve_ can find it.
Alongside comes a development.ini file which includes basic settings so that
running a Pyramid+CubicWeb application works (only the "instance=<appid>" may
be passed as a command-line argument). Logging is also configured there, but
only includes the cube at stake and cubicweb (others could be added if
needed).
.. _perse: \
http://docs.pylonsproject.org/projects/pyramid/en/1.8-branch/pscripts/pserve.html
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 27 Jan 2017 09:58:30 +0100] rev 11944
[cwconfig] Issue a warning when a "core" ctl plugin failed to load
This is often because of a missing dependency, the warning would indicate this
hopefully.
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 27 Jan 2017 13:36:00 +0100] rev 11943
[dataimport] Fix "existing_relations" parameter name in ExtEntitiesImporter
Olivier CAYROL (Logilab) <Olivier.Cayrol@logilab.fr> [Thu, 15 Jan 2015 18:01:28 +0100] rev 11942
[ical] Create ICal events or todos depending on component type returned by adapter
Sylvain Thénault <sylvain.thenault@logilab.fr> [Tue, 31 Jan 2017 11:06:28 +0100] rev 11941
Added tag 3.24.5, debian/3.24.5-1, centos/3.24.5-1 for changeset 70d28e632206
Sylvain Thénault <sylvain.thenault@logilab.fr> [Tue, 31 Jan 2017 10:41:04 +0100] rev 11940
Prepare 3.24.5
Sylvain Thénault <sylvain.thenault@logilab.fr> [Mon, 30 Jan 2017 10:18:31 +0100] rev 11939
[devtools] Skip computed relations when attempting to auto-populate test database
Fix the automatic database population underlying automatic test to avoid attempt
to create computed relations.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Mon, 30 Jan 2017 18:14:45 +0100] rev 11938
[migration] Stop asking confirm to commit
Sylvain Thénault <sylvain.thenault@logilab.fr> [Mon, 30 Jan 2017 17:17:17 +0100] rev 11937
[migration] Fix crash on 3.24 migration
Some sql using a column droped the line above crash migration of cw < 3.24.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Mon, 30 Jan 2017 10:18:31 +0100] rev 11936
[devtools] Skip computed relations when attempting to auto-populate test database
Fix the automatic database population underlying automatic test to avoid attempt
to create computed relations.
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 30 Jan 2017 11:23:13 +0100] rev 11935
[test] Use our BaseTestCase in unittest_rtags.py
We need it DeprecatedInstanceWithoutModule for assertWarns method. Use this
instead of unittest2 directly with a try/except block to get rid of flake8
error about import not being one top of file.
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 30 Jan 2017 10:22:23 +0100] rev 11934
[server] Add a blank line before _CnxSetPool to fix PEP8 error
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 30 Jan 2017 10:19:58 +0100] rev 11933
[pkg] Use logilab-common's master repository in dev requirements
Should follow-up on 7b2247098f58 after integration on logilab-common side.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Fri, 20 Jan 2017 16:39:44 +0100] rev 11932
[rtags] pass module name to RegistrableInstance
Instantiate a RegistrableInstance without passing the module name is deprecated
in https://www.logilab.org/patch/10047069
Philippe Pepiot <philippe.pepiot@logilab.fr> [Fri, 27 Jan 2017 17:42:16 +0100] rev 11931
[repository] move cnxset pool handling to a helper class
The class has responsability to handle connections pool operations in a single
public attribute 'cnxsets'.
On Repository _get_cnxset() and _free_cnxset() are replaced by cnxsets.get()
and cnxsets.release().
Drop multiple access to private attributes and methods from outside of Repository.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 27 Jan 2017 15:53:15 +0100] rev 11930
[pkg] Fix some error on building documentation
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 27 Jan 2017 16:26:09 +0100] rev 11929
Merge 3.24.4 into default branch
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 27 Jan 2017 13:41:24 +0100] rev 11928
Added tag 3.24.4, debian/3.24.4-1, centos/3.24.4-1 for changeset 35fd54c0065d
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 27 Jan 2017 13:30:24 +0100] rev 11927
Prepare 3.24.4
Florent Cayré <florent.cayre@gmail.com> [Fri, 20 Jan 2017 03:48:11 +0100] rev 11926
[source,native] Generalize the IntegrityError constraint parsing regex
This allows catching constraint-related errors that have been translated
by psycopg2, replacing surrounding english quotes by french quotes + space
for instance.
Closes #17047951.
Samuel Trégouët <samuel.tregouet@logilab.fr> [Wed, 18 Jan 2017 16:50:48 +0100] rev 11925
[pyramid] use pyramid.request `path_info` property instead of `path`
path is concatenation of SCRIPT_NAME and PATH_INFO
we just need PATH_INFO here
Samuel Trégouët <samuel.tregouet@logilab.fr> [Fri, 13 Jan 2017 11:36:51 +0100] rev 11924
[pyramid] fix login route with language-mode = url-prefix
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 18 Nov 2016 10:28:41 +0100] rev 11923
[devtools] Make timeout error in qunit tests configurable and use SkipTest in test_jscript.py
This is grafted from 87443f279b0f in default branch (got tired of CI failing
because of these unreliable tests).
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 26 Jan 2017 16:34:56 +0100] rev 11922
[web] Handle unspecified value in TZDatetimeField
`field._ensure_correctly_typed(self, form, value)` should return None if value
is None.
Closes #17050181.
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 26 Jan 2017 16:33:15 +0100] rev 11921
[web] Handle unspecified 'date' or 'time' in JQueryDateTimePicker.process_field_data()
dict.get() may return None, which has no attribute strip.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Mon, 23 Jan 2017 15:35:19 +0100] rev 11920
[cwconfig] create a virtual "cubes" package
_CubesImporter now handle import of "cubes" and return a virtual module so that
"cubes" is always importable without having to create a __init__.py in
CUBES_DIR and add CUBES_DIR/.. to sys.path.
Drop custom code in setup.py used to create CUBES_DIR/__init__.py and drop now
useless warning when cubicweb is installed in develop mode
Update test_cubes_path() and ensure 'cubes.file' is not loaded before testing
its import. This test seems to have mistakes because cubes are loaded
automatically when discovering cw commands (cubes.<x>.ccplugin), not sure how
this should be fixed definitely.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 20 Jan 2017 18:17:04 +0100] rev 11919
Change hooks control (deny_all_hooks_but / allow_all_hooks_but) to be more predictable
Prior to this, if one execute code like:
with cnx.hooks.deny_all_hooks_but('metadata'):
with cnx.hooks.deny_all_hooks_but():
# mycode
'metadata' hooks will be activated anyway in the inner block, which is rather
unexpected (of course in real life you only see the latest hooks control
statement, the former being higher in the call stack). This is due to the
underlying usage of old `enable_hook_categories` / `disable_hook_categories`
methods, which were introduced much before the now official context manager
based API (with `cnx.[deny|all]_all_hooks_but(...)`).
To move on, this patch drop the two legacy methods, rename and privatize related
internal state on the connection (`hooks_mode` becomes `_hooks_mode`,
`disabled_hook_cats` and `enabled_hook_cats` become `_hooks_categories`) and
reimplement the `_hooks_control` context manager to simply update them.
See the added unit test for details.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Tue, 24 Jan 2017 14:09:13 +0100] rev 11918
[cwconfig] make appobjects_cubes_modnames() public
The method is used in cubicweb.cwvreg without underscore and outside of the
config class, so let's make this method public.
Fix autoreload with twisted.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 20 Jan 2017 15:16:18 +0100] rev 11917
Fix str(Unauthorized)
which is really problematic on python 3 where __unicode__ is never called
anymore. This was caused because in PY3, CubicWebException.__str__ was referencing
__unicode__ implementation of CubicWebException, not of its subclass that
implements it.
Fix a flake8 style warning about lambda assignment as a bonus.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Fri, 20 Jan 2017 09:55:08 +0100] rev 11916
[test] avoid using a deprecated feature of yams
handle_file() now require a module name (yams@d9120d7)
Alain Leufroy <alain@leufroy.fr> [Tue, 12 May 2015 22:14:24 +0200] rev 11915
[test] add some tests to web.views.baseviews
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 23 Jan 2017 10:44:00 +0100] rev 11914
[tox] Drop "touch {envdir}/share/cubicweb/cubes/__init__.py" command on py34 env
This was useful when we installed cubicweb in "develop" mode
but we do not do this anymore.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Mon, 23 Jan 2017 11:02:21 +0100] rev 11913
Drop support for https-url in all-in-one.conf
This feature allowing an instance to have both anonymous and authenticated
(https) url is not used anymore, let's drop it.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Fri, 20 Jan 2017 16:53:28 +0100] rev 11912
[test] use TemporaryDirectory context manager
For consistency with others tests, use TemporaryDirectory from
cubicweb.devtools.testlib.
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 20 Jan 2017 14:32:34 +0100] rev 11911
[tox] Drop "exclude" option from flake8 config and adjust flake8-ok-files.txt accordingly
Some files listed in flake8-ok-files.txt were excluded of flake8 run because
of the "exclude" option in tox.ini. Some of them were non-existent files
(moved), some others were actually non-flake8-compliant. In the latter case,
we adjust trivial errors (blank lines, module import not on top of file) but
remove others (like cubicweb/test/unittest_utils.py) from
flake8-ok-files.txt.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 20 Jan 2017 10:31:04 +0100] rev 11910
[autoform] Go through guess_field even when field class is specified using uicfg
guess_field does not only find the proper field class for some
attribute/relation, but also do some basic configuration depending on e.g.
constraints. Before this patch, if one was specifying explicitly the field class
using uicfg.autoform_field, this automatic configuration wasn't happening.
Change form.field_by_name and ff.guess_field so explicit class are also
automatically configured now.
Closes #14474840
Florent Cayré <florent.cayre@gmail.com> [Fri, 20 Jan 2017 03:54:43 +0100] rev 11909
[uilib] Fix incorrect serialization of python dicts into javascript objects
Valid javascript object keys must be surrounded by quotes unless they are valid javascript identifiers. Valid identifiers are a defined by complex and changing specs, so it is much simpler to always use quotes.
Closes #17046704.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Thu, 12 Jan 2017 13:40:25 +0100] rev 11908
[repository] Fix connection-pool-size not set to 1 with quick_start enabled
config.load_schema() and config.init_cube() reload configuration options from
config file, so a manually set connections-pool-size (eg. when quick_start is
enabled) wasn't working.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 19 Jan 2017 11:12:35 +0100] rev 11907
[migration] Enhance assertion message to get a chance to fix the problem
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 19 Jan 2017 11:12:07 +0100] rev 11906
[migration] Skip virtual rtypes when adding relation definition through add_cube
Virtual rtypes should be skipped as they are added dynamically on loading
schema. Those are skipped by e.g. schema serialisation or add_entity_type, do
the same thing here.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 19 Jan 2017 11:10:47 +0100] rev 11905
[migration] Avoid unnecessary intermediary commit when migrating a schema
Those are low-hanging fruit following changes in ac74476d686c (Fix addition of
entity type including boundary constraints on its own attributes): this is no
more necesary to commit the get a new relation type definition in the schema.
At some point we could/should probably do more on this topic to avoid
intermediary commit on e.g. entity type addition, but this requires more work.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 18 Jan 2017 15:04:27 +0100] rev 11904
[migration] Fix addition of entity type including boundary constraints on its own attributes
This was failing because of the sequence of sql executing when adding an
attribute:
1. add entity type <commit>
2. add relation type for attribute 1 <commit>
3. add attribute 1 and associated constraints <commit>
etc.
In the case of e.g. start/end constraint, we were trying to add the constraint
before addition of the constrained attribute (e.g. add constraint on 'start'
referencing 'end', but only 'start' has been added yet, not 'end').
This patch fix this by:
* adding the relation type to the schema without having to commit, but keeping
the operation to revert the addition if necessary - this allows to a single
commit for all attributes of the entity type ;
* using a LateOperation on constraint operation, so we ensure attributes are
actually added before any constraint is added.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 19 Jan 2017 09:53:31 +0100] rev 11903
[schema sync] Refactor AfterAddCWRTypeHook and AfterAddCWComputedRTypeHook so the latter inherit from the former
and enhance their docstring.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 18 Jan 2017 12:36:02 +0100] rev 11902
Drop embed-allowed option, gone away for a long time
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 04 Jan 2017 10:02:05 +0100] rev 11901
Never record undo information for session or data import
for session, it may causes unlimited database size expansion while it makes no sense
to undo this kind of changes. For data import, they are created programatically hence
we may not want to undo this either.
Philippe Pepiot <philippe.pepiot@logilab.fr> [Thu, 19 Jan 2017 14:53:05 +0100] rev 11900
[cwvreg] load registry using modules names instead of directories
Introspect cubicweb, cubes and apphome using pkgutil to generate the full list
of modules names for loading registries.
Avoiding using bogus logilab.common.modutils.modpath_from_file().
Philippe Pepiot <philippe.pepiot@logilab.fr> [Thu, 19 Jan 2017 15:27:39 +0100] rev 11899
[schema] load schema from modules names instead of directories
Introspect cubicweb, cubes and apphome using pkgutil to generate the full list
of modules names for loading the schema.
Keep historical behavior and check if source .py file exists if a module is
found using python bytecode file (.pyc and .pyo)
Loading schema from apphome require apphome to be present in sys.path and that
"schema" module resolve to a file located in apphome.
Update migraction tests to explicitely update sys.path when loading schema from
different apps, use a contextmanager for this so it's more readable.
Require updated logilab-common and yams
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 18 Jan 2017 17:16:00 +0100] rev 11898
[devtools/test] Skip qunit tests in case of timeout
Follow-up on 87443f279b0f where other similar tests got
adjusted not to fail (in particular in our CI environment).
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 18 Feb 2016 14:22:07 +0100] rev 11897
[autoform] Avoid two calls to field.process_form for the same field in some cases
when some entity is being created and data include non-inlined relations, the
values for this relation are now stored for later usage, avoiding two calls
to field's process_form method, which may be unexpected for custom fields.
This has been discovered in saem_ref#f5444b1f9770.
Reorganize imports in the test along the way.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Mon, 19 Dec 2016 17:22:48 +0100] rev 11896
[pyramid] Don't use unsafe_cnx_context_manager for write queries
we may have clumsy error that hide previous problems on attempting to commit the transaction.
Closes #16753531
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 14 Dec 2016 08:37:11 +0100] rev 11895
Repair database wrt indexes / unique constraints
* recreate indexes dropped by 3.23 migration (but it's still unclear why)
* attempt drop remaining extra indexes (there may be a bunch of these on old instances)
* warn about missing expected indexes
Closes #16666137
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 14 Dec 2016 17:06:24 +0100] rev 11894
Enhance postgres index filter with values from real life
This has been found on fairly old instances of ours (cwo/elo). Dunno if we
really want this in, it may lead to false negatives.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 14 Dec 2016 17:04:29 +0100] rev 11893
Extract functions to list expected/found database indexes from check_indexes
so they may be used from other contexts.
Use consistent naming along the way: always use indexes, not indices.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 24 Nov 2016 15:36:26 +0100] rev 11892
Simplify and fix _cw.drop_entity_cache
* it's never called with an eid as argument, beside in a useless case in test
(removed)
* the only place where it's called from outside the tests is in full-text
reindexation in server.checkintegrity: we could removed the request
implementation and move it in unittest_rset, byt I decided to keep it for
consistency with all other entity cache handling methods
* get back a fix from Julien Cristau for the connection's implementation,
quoting is commit message:
When removing an entity from the transaction's cache, clear the
entity's own cache
May avoid issues where an entity object is still accessible somewhere else
(e.g. an operation) after dropping it from the transaction's cache, with a
stale attribute or relation cache.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 18 Nov 2016 17:50:56 +0100] rev 11891
[entity/optimization] Cache rset when entity.related is called with entities=False
If fail to see why we couldn't cache in this case, while this is important for
optimization reason: when doing a single HTTP request, some queries are done two
or three times because of predicates / uicfg or alike.
Also always store tuple and not list in the cache, because:
* else we get some regression
* and inconsistent result type (tuple or list)
* and it simply feels better to cache an unmutable object.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 14 Dec 2016 08:47:06 +0100] rev 11890
Ensure in 3.24 migration that entities from LDAP have consistent cwuri
Closes #16666157
Nicolas Chauvat <nicolas.chauvat@logilab.fr> [Wed, 14 Dec 2016 13:34:08 +0100] rev 11889
[doc/book] fix error in markup
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 09 Nov 2016 16:14:17 +0100] rev 11888
[rtags] Allow to 'derive' rtags
Since some releases, rtags (structure underlying uicfg) have selector and may be
copied using something like:
new_rtags = deepcopy(original_rtags)
new_rtags.__module__ = __name__
new_rtags.__select__ = custom_selector
The problem is that starting from that, both rtags wil diverge and changes in
original_rtags won't be considered, while we usually want to set a few specific
rules only in new_rtags. To fix this problem, this cset introduces the notion of
"derivated/parent" rtag, eg:
new_rtags = original_rtags.derive(__name__, custom_selector)
Beside easier copying, when using the above method changes in original_rtags
which are not overriden by new_rtags will be considered since it only hold its
specific rules but look among its parent chain for non-found keys.
Along the way, flake8 unittest_rtags.
Closes #16164880
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 09 Nov 2016 16:08:23 +0100] rev 11887
[test] Use bare unittest in unittest_rtags
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 09 Nov 2016 16:07:10 +0100] rev 11886
[rtags] Docstring fix
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 09 Nov 2016 16:05:06 +0100] rev 11885
[cleanup] flake8 rtags.py
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 14 Dec 2016 11:13:46 +0100] rev 11884
[pkg] Require passlib >= 1.7.0
Since bc9d901cb9e6 we use 1.7.0 API, update packaging accordingly.
Nicolas Chauvat <nicolas.chauvat@logilab.fr> [Sun, 04 Dec 2016 23:45:52 +0100] rev 11883
[web/http_headers] do not crash when IfModifiedSince is empty string (closes #16527954)
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 07 Dec 2016 14:07:35 +0100] rev 11882
[pkg] Set an upper bound to passlib
We're using a deprecated API and are getting the following deprecation
warning:
::
the method passlib.context.CryptContext.encrypt() is deprecated as of
Passlib 1.7, and will be removed in Passlib 2.0, use CryptContext.hash()
instead.
So let's make sure we're getting a working library.
[ci skip]
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 09 Dec 2016 15:08:52 +0100] rev 11881
[cwconfig] Retrieve real path of cubes directory
Since logilab-common 1.3.0, we have real path expansion
modutils.modpath_from_file. But the extrapath parameter that is passed from
cubicweb.schema reader may still have symlinks, so expand them here to
hopefully have consistent comparison in modpath_from_file.
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 07 Dec 2016 14:11:23 +0100] rev 11880
[server] Use CryptContext's hash method instead of deprecated encrypt method
Getting rid of the following deprecation warning:
::
the method passlib.context.CryptContext.encrypt() is deprecated as of
Passlib 1.7, and will be removed in Passlib 2.0, use CryptContext.hash()
instead.
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 07 Dec 2016 14:13:20 +0100] rev 11879
Merge public heads
Julien Cristau <julien.cristau@logilab.fr> [Thu, 22 Oct 2015 16:58:12 +0200] rev 11878
[cwctl] on upgrade, clear instance_md5_version cache
The generate-static-datadir depends on a correct
config.instance_md5_version(), and we just invalidated it by
upgrading the instance.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr> [Tue, 15 Dec 2015 08:35:13 +0100] rev 11877
[twisted] add request error handler to avoid finishing it twice
And avoid stack traces like::
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 783, in __bootstrap
self.__bootstrap_inner()
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
--- <exception caught here> ---
[...]
File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 196, in _worker
result = context.call(ctx, function, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/home/me/envs/grshell-cw/cubicweb/statsd_logger.py", line 121, in __call__
return self.callable(*args, **kw)
File "/home/me/envs/grshell-cw/cubicweb/etwist/server.py", line 131, in render_request
code=500, twisted_request=request)
File "/home/me/envs/grshell-cw/cubicweb/etwist/http.py", line 22, in __init__
self._finalize()
File "/home/me/envs/grshell-cw/cubicweb/etwist/http.py", line 46, in _finalize
self._twreq.finish()
File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 228, in finish
return http.Request.finish(self)
File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 931, in finish
"Request.finish called on a request after its connection was lost; "
exceptions.RuntimeError: Request.finish called on a request after its connection was lost; use Request.notifyFinish to keep track of this.
Rémi Cardona <remi.cardona@logilab.fr> [Fri, 04 Sep 2015 18:05:51 +0200] rev 11876
[web/tests] Hide DeprecationWarnings
Julien Cristau <julien.cristau@logilab.fr> [Thu, 19 Nov 2015 12:25:45 +0100] rev 11875
[web] remove next_tabindex()
It's hard to see it work reliably in view of multiple server processes.
If something like that is needed it should probably be built on the
client (js) side.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 23 Nov 2016 17:19:51 +0100] rev 11874
[views/optimization] Ensure we call rset.possible_actions with the same argument
rset.possible_actions (which should definitly not be an ResultSet method, but
that's another story) has been designed to hold a cache to compute possible
actions for a only once, since this may be a fairly costly operation (notably
because of the 'has_editable_relations' predicates). But this has been broken by
introduction of a new 'view' parameter which is not given by every call.
To fix this, this cset adds the missing view argument where necessary and
reimplements the rset's method to assert it's always called with the same key.
Unfortunatly, those changes have to be ported to squareui and bootstrap cubes as
well.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 18 Nov 2016 18:19:10 +0100] rev 11873
[schema/optimization] Ensure read permissions are deactivated when we're checking a permission
When called from a web request, since we *are* checking some permission, read
permissions don't have to be introduced in this query.
We may avoid that since there now more any differences between web and repo
connections, so let's do it.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 18 Nov 2016 18:16:21 +0100] rev 11872
[web] Enhance query log file
* Add an overall page generation time
* Don't log URL without any query (e.g. static files)
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 24 Nov 2016 14:26:12 +0100] rev 11871
[massive store] Don't store eids_seq_range as a store attribute
since it's not considered after object's initialization.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 24 Nov 2016 16:58:50 +0100] rev 11870
Flake8 bits with some copyright updates
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 24 Nov 2016 16:58:27 +0100] rev 11869
[test] Use plain unittest in unittest_views_forms.py
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 24 Nov 2016 16:32:14 +0100] rev 11868
Some py3k related fixes: use text_type instead of unicode
Sylvain Thénault <sylvain.thenault@logilab.fr> [Thu, 24 Nov 2016 15:39:52 +0100] rev 11867
[cwctl] Kill deprecated ordered_instances method
no need to keep bw compat for this.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 02 Dec 2016 10:10:58 +0100] rev 11866
[test/cleanup] Use plain unittest
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 02 Dec 2016 10:10:42 +0100] rev 11865
[test/cleanup] flake8 unittest_rqlannotation.py
Arthur Lutz <arthur.lutz@logilab.fr> [Fri, 25 Nov 2016 13:10:10 +0100] rev 11864
[debian] logilab >= 1.2.2 in requires (only in build depends)
Related to #16404515.
Arthur Lutz <arthur.lutz@logilab.fr> [Fri, 25 Nov 2016 13:07:06 +0100] rev 11863
[debian] move unittest2 to requires not recommends closes #16404515
Philippe Pepiot <philippe.pepiot@logilab.fr> [Wed, 23 Nov 2016 17:25:31 +0100] rev 11862
[devtools] named context for boxes subTest for consistency
David Douard <david.douard@logilab.fr> [Wed, 23 Nov 2016 18:38:46 +0100] rev 11861
Added tag 3.24.3, debian/3.24.3-1, centos/3.24.3-1 for changeset bb5904cd284e
David Douard <david.douard@logilab.fr> [Wed, 23 Nov 2016 18:36:55 +0100] rev 11860
[pkg] 3.24.3
David Douard <david.douard@logilab.fr> [Wed, 23 Nov 2016 12:24:04 +0100] rev 11859
[cwconfig] ensure CubicWebNoAppConfiguration returns a typed value (closes #16364459)
Sylvain Thénault <sylvain.thenault@logilab.fr> [Fri, 18 Nov 2016 18:15:14 +0100] rev 11858
[views/optimization] Makes has_editable_relations predicate less costly by using generator
The `has_editable_relations` predicate is used to say if the 'modify' action
should appear. To do so, it checks if anything is editable (ie. something in the
attributes, relations or inlined section of the automatic form).
This may be costly since it may have to check several permissions. To optimize
this a bit, this cset turns list into generator so that we'll avoid unnecessary
work as soon as we find a match.
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 17 Nov 2016 11:03:19 +0100] rev 11857
[cwconfig] Trim down allowed exceptions in gettext language setting
I can't see any valid reason to pass on ImportError and AttributeError. In
particular, the latter shadowed a Python 3 error until 4f43e64603ef.
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 21 Nov 2016 14:52:33 +0100] rev 11856
[pkg] Configure "universal" wheel build
According to https://packaging.python.org/distributing/#wheels,
we should create universal wheels (no 2to3 step, no C extension).
Configure this in setup.cfg.
[ci skip]
Sylvain Thénault <sylvain.thenault@logilab.fr> [Mon, 21 Nov 2016 15:17:32 +0100] rev 11855
[rqlrewrite] Test and fix potential NameError
We were referencing a loop variable, which may lead to a name error and show a
potential error if there are several matching variables.
To avoid this, introduce a list to hold every encountered variable and process
all of them later.
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 16 Nov 2016 15:55:35 +0100] rev 11854
flake8 uicfg
Sylvain Thénault <sylvain.thenault@logilab.fr> [Wed, 16 Nov 2016 15:52:55 +0100] rev 11853
[uicfg] Remove unpredictability from autoform_section initialization
It was attempting to guess smart default values by looking at the opposite
relation (neg_role), but depending on the (random) ordering of the schema, it
may or may not have been set yet, leading to unpredictable result with varying
hash seed.
Remove those fuzzy lookup all at once, it may change some (unreliable) things in
your app but at least it's still a bit easier to explain.
Closes #16272968