HomeSoftware Heritage

Adapt cassandra backend to validating model types

Description

Adapt cassandra backend to validating model types

This is required to be able to activate type validation in the model (in
swh.model.model).

It requires to replace the "distorded" usage that was done of model entities
to build objects compatible with CqlRunner's object addition logic.
Since we cannot create invalid model entities any more in this context,
we add a new CassObject type (just a dict with getattr=getitem)
and use it as object passed to the CqlRunner for entity types that need
special care (namely Revision and Release).

This should still work with swh.model v0.0.62 (without type validation) as well
as the (next) v0.0.63 which will come with type valdation.

Details

Provenance
douarddaAuthored on Mar 26 2020, 5:28 PM
douarddaPushed on Apr 1 2020, 2:53 PM
Parents
rDSTO20baa1b0bb33: test: convert test_converts.py to pytest style
Branches
Unknown
Tags
Unknown
Build Status
Buildable 11544
Build 17501: test-and-buildJenkins console · Jenkins