62 lines
764 B
Markdown
62 lines
764 B
Markdown
# Module Versioning Pattern Notes
|
|
|
|
This file keeps examples and the decision tree. The normative rules live in `contract.md`.
|
|
|
|
## Version Format
|
|
|
|
```text
|
|
N.M
|
|
```
|
|
|
|
Examples:
|
|
|
|
- `1.0`
|
|
- `2.0`
|
|
- `2.1`
|
|
- `2.3`
|
|
|
|
## Canonical Storage Options
|
|
|
|
Go constant:
|
|
|
|
```go
|
|
const Version = "2.1"
|
|
```
|
|
|
|
Document header:
|
|
|
|
```text
|
|
Version: 2.1
|
|
```
|
|
|
|
Config field:
|
|
|
|
```json
|
|
{ "version": "2.1" }
|
|
```
|
|
|
|
## Tag Format
|
|
|
|
```text
|
|
<module-name>/v<N.M>
|
|
```
|
|
|
|
Examples:
|
|
|
|
- `parser/v2.0`
|
|
- `api-client/v1.3`
|
|
|
|
## Decision Tree
|
|
|
|
```text
|
|
Module changed?
|
|
-> no: version unchanged
|
|
-> yes: behavior or interface changed?
|
|
-> yes: N+1, reset minor to 0
|
|
-> no: narrow bugfix only -> N+0.1
|
|
```
|
|
|
|
## Commit Reminder
|
|
|
|
If a commit changes a module, the same commit should update the module version.
|