From ec9eb6fcee7058a746f8146494977b1f7bfb0192 Mon Sep 17 00:00:00 2001 From: Carlo van Driesten Date: Fri, 3 Feb 2017 11:06:59 +0100 Subject: [PATCH] Updated README.md for versioning definitions --- README.md | 38 +++++++++++++++++++++++++++++++++++++- osi_common.proto | 4 +++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 177a106c9..f187e13af 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,21 @@ existing fields should be set, unless not setting a field carries a specific mea comment. +Compatibility +-------------- +Defintion: FAITHFULLY "All recorded data is correctly interpreted by the interface" + +Forward compatibility: +Definition: "An older verison of code can be used to read new files" +Data recorded with a higher minor or patch version of a major version can be read with code using the same major version but lower minor and patch version. +Newly added fields are ignored. All patch versions of the same major and minor version is FAITHFULLY forward compatible. + +Backward compatibility: +Definition: "A newer version of code can be used to read old files" +All files which have been recorded in the past with a specicific major version are FAITHFULLY valid with all combinations of +higher minor and patch versions of the same major version. + + Fault injection: how-to ------------------------ Injection of pre-defined sensor errors should be handled by a specialized "fault injector" component that acts like a @@ -30,4 +45,25 @@ Specific errors should be handled as follows: Versioning ---------- -The version number is defined in InterfaceVersion::version_number in osi_common.proto as the field's default value. \ No newline at end of file +The version number is defined in InterfaceVersion::version_number in osi_common.proto as the field's default value. + +Major: +A change of the major version results in an incompatibility of code and recorded proto messages. +- An existing field with a number changes its meaning + optional double field = 1; -> repeated double field = 1; + Changing the definition of units of a field +- Deleting a field and reusing the field number +- Changing the technology + ProtoBuffer -> FlatBuffer + +Minor: +A change of the minor version indicates remaining compatibility to previously recorded files. The code on the other hand needs fixing. +- Renaming of a field without changing the field number +- Changing the names of messages +- Adding a new field in a message without changing the numbering of other fields + +Patch: +The compatibility of both recorded files and code remains. +- File or folder structure which does not affect including the code in other projects +- Changing or adding comments +- Clarification of text passages explaining the message content \ No newline at end of file diff --git a/osi_common.proto b/osi_common.proto index d05f7d363..f1f5584e6 100644 --- a/osi_common.proto +++ b/osi_common.proto @@ -13,7 +13,9 @@ message InterfaceVersion { // The field containing the version number. Should be left on default, not to be modified by sender. // Increments will happen as part of changes to the whole interface. - optional uint32 version_number = 1 [default = 17]; + optional uint32 major = 1 [default = 2]; + optional uint32 minor = 2 [default = 0]; + optional uint32 patch = 3 [default = 0]; } /**