Skip to content

Commit db6dd3f

Browse files
authored
Merge pull request #11 from OpenSimulationInterface/change_version_numbering
Updated README.md for versioning definitions
2 parents 33a8efe + ec9eb6f commit db6dd3f

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ existing fields should be set, unless not setting a field carries a specific mea
1616
comment.
1717

1818

19+
Compatibility
20+
--------------
21+
Defintion: FAITHFULLY "All recorded data is correctly interpreted by the interface"
22+
23+
Forward compatibility:
24+
Definition: "An older verison of code can be used to read new files"
25+
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.
26+
Newly added fields are ignored. All patch versions of the same major and minor version is FAITHFULLY forward compatible.
27+
28+
Backward compatibility:
29+
Definition: "A newer version of code can be used to read old files"
30+
All files which have been recorded in the past with a specicific major version are FAITHFULLY valid with all combinations of
31+
higher minor and patch versions of the same major version.
32+
33+
1934
Fault injection: how-to
2035
------------------------
2136
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:
3045
3146
Versioning
3247
----------
33-
The version number is defined in InterfaceVersion::version_number in osi_common.proto as the field's default value.
48+
The version number is defined in InterfaceVersion::version_number in osi_common.proto as the field's default value.
49+
50+
Major:
51+
A change of the major version results in an incompatibility of code and recorded proto messages.
52+
- An existing field with a number changes its meaning
53+
optional double field = 1; -> repeated double field = 1;
54+
Changing the definition of units of a field
55+
- Deleting a field and reusing the field number
56+
- Changing the technology
57+
ProtoBuffer -> FlatBuffer
58+
59+
Minor:
60+
A change of the minor version indicates remaining compatibility to previously recorded files. The code on the other hand needs fixing.
61+
- Renaming of a field without changing the field number
62+
- Changing the names of messages
63+
- Adding a new field in a message without changing the numbering of other fields
64+
65+
Patch:
66+
The compatibility of both recorded files and code remains.
67+
- File or folder structure which does not affect including the code in other projects
68+
- Changing or adding comments
69+
- Clarification of text passages explaining the message content

osi_common.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ message InterfaceVersion
1313
{
1414
// The field containing the version number. Should be left on default, not to be modified by sender.
1515
// Increments will happen as part of changes to the whole interface.
16-
optional uint32 version_number = 1 [default = 17];
16+
optional uint32 major = 1 [default = 2];
17+
optional uint32 minor = 2 [default = 0];
18+
optional uint32 patch = 3 [default = 0];
1719
}
1820

1921
/**

0 commit comments

Comments
 (0)