Skip to content

Commit

Permalink
Merge pull request OpenSimulationInterface#11 from OpenSimulationInte…
Browse files Browse the repository at this point in the history
…rface/change_version_numbering

Updated README.md for versioning definitions
  • Loading branch information
jdsika authored Feb 3, 2017
2 parents 33a8efe + ec9eb6f commit db6dd3f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
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
4 changes: 3 additions & 1 deletion osi_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

/**
Expand Down

0 comments on commit db6dd3f

Please sign in to comment.