Skip to content

Commit 49abe12

Browse files
committed
Add first draft of versioning ADR
Signed-off-by: Max Maass <max.maass@iteratec.com>
1 parent 2eb3196 commit 49abe12

1 file changed

Lines changed: 126 additions & 0 deletions

File tree

docs/adr/adr_0011.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2021 iteratec GmbH
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
# ADR-0011: Version Numbers
8+
9+
| <!-- --> | <!-- --> |
10+
|----------------|----------|
11+
| **Status**: | DRAFT |
12+
| **Date**: | 2022-01-18 |
13+
| **Author(s)**: | Max Maass <max.maass@iteratec.com> |
14+
15+
## Context
16+
Software version numbers should serve as an indicator of compatibility between different versions, both during operation and while updating to a newer release.
17+
At the moment, the _secureCodeBox_ is following the [Semantic Versioning (semver)][semver] approach.
18+
According to semver, version numbers are of the format MAJOR.MINOR.PATCH, and the different places are incremented as follows:
19+
20+
> 1. MAJOR version when you make incompatible API changes,
21+
> 2. MINOR version when you add functionality in a backwards compatible manner, and
22+
> 3. PATCH version when you make backwards compatible bug fixes.
23+
24+
However, the architecture of _secureCodeBox_, with its operator and many individual scanners that can be installed and used separately, makes this seemingly simple versioning system more difficult.
25+
For example, we need to answer the following questions:
26+
27+
1. Are breaking changes in the parameterization of a scanner (e.g. nmap, Gitleaks) a breaking change for the entire _secureCodeBox_ project?
28+
2. Are changes to the output format of a single scanner a breaking change for the entire project?
29+
3. In an environment where operator and scanners aren't necessarily using the same version number because the operator is controlled by a different team than the scanners (a setup that we want to support), how do we indicate compatibility between different versions of operator and scanner?
30+
31+
Depending on how these questions are answered, different versioning schemes are possible.
32+
33+
### Option 1: SemVer With Major Version Indicating Overall Compatibility Of All Components
34+
The basic premise for this versioning scheme would be:
35+
36+
> Any change that requires manual actions from at least one user of the SCB to keep existing workflows running after an update is considered a breaking change and requires a MAJOR release.
37+
38+
This manual action may include making changes to scan definitions, or to systems that are ingesting data from the SCB findings of a scanner.
39+
It sees the entire _secureCodeBox_ as **one large piece of software with many components** that are all equally important to the overall compatibility, and where all components are (usually) updated in lockstep.
40+
As illustration, here are a few examples and what kind of release they would require:
41+
42+
| Action |Version |
43+
|------------------------------------------------------------------------------------|--------|
44+
| A scanner changes how it is parameterized | Major |
45+
| A scanner changes what data it returns | Major |
46+
| The SCB makes changes to the findings format of one scanner (e.g., renaming a key) | Major |
47+
| The SCB makes breaking changes to the CRDs (renaming or removing fields) | Major |
48+
| The SCB makes backwards-compatible changes to the CRDs (adding new fields) | Minor |
49+
| The SCB fixes a small bug in the operator or a scanner | Patch |
50+
51+
#### Advantages
52+
1. **MAJOR versions indicate that manual action may be required to keep existing workflows running** and that the users should read the changelog. However, it may turn out that the breaking change does not apply to the users' environment (e.g., because they are not using a specific scanner), in which case no manual action may be required.
53+
2. **MINOR versions can be installed with the expectation that no manual action will be required to keep existing workflows working.** However, manual action _may_ be required to benefit from new features (due to changes to the CRDs that need to be manually installed).
54+
3. **Frequent MAJOR releases lower the inhibition to make larger changes.** At the moment, many proposed larger changes are pushed back to "the next major version", without actively planning towards releasing such a version. Making major releases more common makes it easier to include smaller breaking changes that improve the consistency of the system (e.g., in the case of the output format).
55+
4. **It is compliant with the expectations of users that expect SCB to be versioned like a single monolithic piece of software.**
56+
57+
#### Disadvantages
58+
1. **The MAJOR version no longer indicates compatibility between operator and scanner versions.** In environments where operator and scanners are updated separately by different groups, this increases complexity greatly (we know that such environments exist, and want to support them). It also raises the question how this compatibility will be documented instead.
59+
2. **The versioning scheme does not distinguish between changes that are breaking to a small subset of users, and breaking to all users.** This makes it harder for users to distinguish based on the version number alone if an update is going to take 5 minutes (because all the breakage is in a component that they do not use) or 5 hours (because there are large changes to the CRDs, like there were between SCBv2 and SCBv3).
60+
61+
62+
### Option 2: SemVer With Major Version Indicating Operator Compatibility
63+
The basic premise for this versioning scheme would be:
64+
65+
> Any change that breaks compatibility between operator and scanner is considered a breaking change requiring a MAJOR release. Breaking changes to individual scanners are considered non-breaking for the overall system and instead use a MINOR release.
66+
67+
This approach sees the _secureCodeBox_ as **a platform with independent components**, more akin to an operating system or kernel than a monolithic piece of software.
68+
The MAJOR version number indicates compatibility between the operator and scanners, while MINOR version changes can still be breaking to some users (in which case this will be denoted prominently at the top of the release notes).
69+
As illustration, here are a few examples and what kind of release they would require:
70+
71+
| Action |Version |
72+
|------------------------------------------------------------------------------------|--------|
73+
| A scanner changes how it is parameterized | Minor |
74+
| A scanner changes what data it returns | Minor |
75+
| The SCB makes changes to the findings format of one scanner (e.g., renaming a key) | Minor |
76+
| The SCB makes breaking changes to the CRDs (renaming or removing fields) | Major |
77+
| The SCB makes backwards-compatible changes to the CRDs (adding new fields) | Minor |
78+
| The SCB fixes a small bug in the operator or a scanner | Patch |
79+
80+
#### Advantages
81+
1. **MAJOR versions indicate that a joint upgrade of operator and scanners is required,** which is highly relevant in environments where operator and scanners are maintained by different teams (we know that these environments exist, and want to support them). This obviates the need for a detailed compatibility matrix between scanner and operator versions.
82+
2. **It is compliant to the expectations of users that expect SCB to be versioned like a platform or operating system.**
83+
84+
#### Disadvantages
85+
1. **MINOR version changes can be breaking to some users,** forcing everyone to read the changelogs of all intermediate minor version changes when upgrading a scanner.
86+
87+
88+
### Option 3: Version Number With Architecture Prefix For Operator Compatibility
89+
A different variant of the previous option would be to prefix the version number with an ARCHITECTURE (ARCH) number, so the final versioning would be ARCH.MAJOR.MINOR.PATCH. In that case, the table would look like this:
90+
91+
| Action |Version |
92+
|------------------------------------------------------------------------------------|--------|
93+
| A scanner changes how it is parameterized | Major |
94+
| A scanner changes what data it returns | Major |
95+
| The SCB makes changes to the findings format of one scanner (e.g., renaming a key) | Major |
96+
| The SCB makes breaking changes to the CRDs (renaming or removing fields) | Arch |
97+
| The SCB makes backwards-compatible changes to the CRDs (adding new fields) | Minor |
98+
| The SCB fixes a small bug in the operator or a scanner | Patch |
99+
100+
This could be considered "playing tricks" (by just adding a digit and relabeling the meaning of the positions) and would deviate from semver, but would allow us to use the ARCH number to denote operator compatibility, while the MAJOR version denotes scanner compatibility, the MINOR indicates feature additions, and the PATCH indicates bugfixes.
101+
102+
#### Advantages
103+
1. **ARCH versions indicate that a joint upgrade of operator and scanners is required,** which is highly relevant in environments where operator and scanners are maintained by different teams. This obviates the need for a detailed compatibility matrix between scanner and operator versions.
104+
2. **MAJOR versions indicate that there have been breaking changes in a component (a scanner, a hook, ...), but compability with other components remains.** The exact breakage and how to address it is communicated prominently in the changelog.
105+
3. **MINOR and PATCH versions can be installed without worrying about compatibility for existing scans.**
106+
107+
#### Disadvantages
108+
1. **The proposal deviates from the SemVer standard** and is thus unexpected for people who do not know about it.
109+
110+
### Option 4: Semantic Versioning, Separate Versioning For Components
111+
For completeness sake, we also include this option, in which each component is versioned separately, so that a breaking change in one component only changes the verion number of that component.
112+
We previous discarded this idea because it would require complex documentation of which scanner versions work with which operator versions.
113+
We will thus not consider this proposal in greater detail here.
114+
115+
116+
## Decision
117+
TBD
118+
119+
## Consequences
120+
- Create a page in the documentation explaining the versioning scheme (as part of the yet-to-be-written "how to upgrade" page).
121+
- Check the different files in the repo where the versioning and upgrading process are discussed, and make sure they are consistent with the new policy.
122+
- Depending on the decision, potentially write a blog post explaining it.
123+
- Depending on the decision, consider if automated compatibility tests that combine the most up-to-date operator and older scanners (plus, potentially, the reverse) would be a useful thing to have, to have an automated assurance that interoperability is actually maintained as advertised.
124+
125+
126+
[semver]: https://semver.org/

0 commit comments

Comments
 (0)