|
| 1 | +title: CalVer to SemVer |
| 2 | +--- |
| 3 | +categories: |
| 4 | +announcements |
| 5 | +collaboration |
| 6 | +--- |
| 7 | +author: TimidRobot |
| 8 | +--- |
| 9 | +pub_date: 2022-11-11 |
| 10 | +--- |
| 11 | +body: |
| 12 | + |
| 13 | +Creative Commons (CC) tried to use CalVer (calendar versioning), but |
| 14 | +encountered too many issues and decided on SemVer (semantic versioning) |
| 15 | +instead. |
| 16 | + |
| 17 | +[calver]: https://calver.org/ |
| 18 | +[semver]: https://semver.org/ |
| 19 | + |
| 20 | + |
| 21 | +## Why we chose CalVer |
| 22 | + |
| 23 | +Years ago, the CC technology team standardized on using [CalVer][calver] as our |
| 24 | +versioning scheme. Specifically, we selected `YYYY.0M.MICRO`. [CalVer][calver]: |
| 25 | + |
| 26 | +> 1. **`YYYY`** - Full year - 2006, 2016, 2106 |
| 27 | +> 2. **`0M`** - Zero-padded month - 01, 02 ... 11, 12 |
| 28 | +
|
| 29 | +> 3. **`Micro`** - The third and usually final number in the version. Sometimes |
| 30 | +> referred to as the "patch" segment. |
| 31 | +
|
| 32 | +The use of CalVer was inspired by Ubuntu, pip, SaltStack, and others. It was |
| 33 | +thought that CalVer not only matched [SemVer][semver] in communicating |
| 34 | +potential risks to users, but also gave additional temporal context. Also, many |
| 35 | +argue that the promises of SemVer’s `MAJOR.MINOR.PATCH` go unfulfilled often |
| 36 | +enough that they lose meaning and that the differences between MINOR/PATCH are |
| 37 | +too poorly defined (more on these later). |
| 38 | + |
| 39 | + |
| 40 | +## Issues Encountered with CalVer |
| 41 | + |
| 42 | + |
| 43 | +### Time/Duration Is Not Primarily Relevant |
| 44 | + |
| 45 | +CalVer is often favored by projects for which time/duration is of primary |
| 46 | +relevance (ex. Ubuntu releases which have a limited support window). However, |
| 47 | +none of CC’s projects have time/duration as a primary relevance. |
| 48 | + |
| 49 | + |
| 50 | +### `MAJOR` Expectations and Slow Iteration |
| 51 | + |
| 52 | +SemVer is a formalization of longstanding convention. Many many users, |
| 53 | +especially developers, expect the first number of a versioning scheme to |
| 54 | +indicate change severity. With `YYYY` indicating current release year, the |
| 55 | +`YYYY.0M.MICRO` versioning scheme might set an expectation of significant |
| 56 | +changes or improvements (ex. `2021.09.1` to `2022.02.1`) even when the content |
| 57 | +of the changes are trivial. With `YYYY` indicating original release year, a |
| 58 | +slow moving but stable and functional release might appear abandoned or |
| 59 | +insecure (ex. `2019.03.2` in 2022). |
| 60 | + |
| 61 | + |
| 62 | +### Poor Support for CalVer |
| 63 | + |
| 64 | +We also encountered poor support for CalVer in software and systems. For |
| 65 | +example, NPM currently strips leading zeros which breaks CDN integration |
| 66 | +([CalVer and CDN compatibility · Issue #588 · |
| 67 | +creativecommons/vocabulary][issue588]). |
| 68 | + |
| 69 | +[issue588]: https://github.com/creativecommons/vocabulary/issues/588. |
| 70 | + |
| 71 | + |
| 72 | +## Using SemVer |
| 73 | + |
| 74 | +Our experiment with CalVer is a win for the scientific method. We can be more |
| 75 | +confident, today, that SemVer will treat both the developers and users of CC |
| 76 | +software better than CalVer. |
| 77 | + |
| 78 | + |
| 79 | +### SemVer’s ~~Promises~~ Commitments |
| 80 | + |
| 81 | +The CC Technology team sees SemVer as a set of commitments we are making to the |
| 82 | +users and developers of CC open source software. We may not achieve perfection |
| 83 | +in fulfilling those commitments, but they outline expectations and we hope |
| 84 | +you’ll open an issue if we make a mistake. |
| 85 | + |
| 86 | + |
| 87 | +### CC SemVer Specifics |
| 88 | + |
| 89 | +We will be using [SemVer][semver] (semantic versioning) going forward. To add |
| 90 | +additional clarity, we will avoid mixing functionality changes and bug fixes in |
| 91 | +releases: |
| 92 | + |
| 93 | +1. `MAJOR` version when you make incompatible API changes |
| 94 | +2. `MINOR` version when you add functionality in a backwards compatible manner |
| 95 | + - Releases that increment the `MINOR` version **must not** include bug |
| 96 | + fixes |
| 97 | +4. `PATCH` version when you make backwards compatible bug fixes |
| 98 | + - Releases that increment the `PATCH` version **must not** include |
| 99 | + functionality additions |
| 100 | + |
| 101 | +When a bug fix _technically_ changes functionality, we will release a bug fix |
| 102 | +(incrementing only the `PATCH` version) as the change preserves the _intended |
| 103 | +functionality_. |
0 commit comments