Add schema version metadata and checks
Adding or removing YAML files or top level entries in existing YAML files require adaptation in Detector (either in compact XML files or in C++).
Although it's OK to keep the Detector code and the condition database in sync in master while things are still moving fast, in a more stable scenario we need to have code in Detector that can adapt to different versions of the schema of the conditions database (meaning number of YAML files and top level entries in those files).
Discussing with @bcouturi we agreed that we should have some metadata in the repository (e.g. a VERSION
or SCHEMA_VERSION
file) that describe the compatibility level of the database schema as a major.minor version number, plus a validation check that enforces that merge requests correctly update the version. Adding files or top level entries should come with an update of the minor version, while removals should get a major version update. In this way we can declare the Detector code to be compatible with a specific major version and at least a specific minor version.
The checks should also make sure that a change in schema is applied to the whole timeline of the condition being modified.
In principle we may have multiple schema versions for different subtrees (e.g. one per subdetector), but, if really needed, we can implement it at a later stage.