Introduction
SemVer allows users to understand the scope of a software update at first glance, based on the following :
- the patch number is incremented when something is fixed ;
- the minor number is incremented when something is added ;
- the major number is incremented when something is moved or removed.
something could be :
- a command, an option or an argument, for a CLI ;
- a route path, a query parameter or a body property, for a REST API ;
- a text node, a button or a field, for a GUI.
Forgejo's case
Generality
Since Forgejo has all of the above, changes to all of those components should be taken into consideration when creating a new version number.
The REST API
A major version number is specified in Forgejo's REST API's base URL (/api/v1) but was never incremented.
Multiple options are available :
Option A - Matching the REST API's version with the global version
It's actually likely that the REST API's major version number already matches the global major version number, so the former would never have been incremented simply because the latter never were either.
So, as stated in the introduction, the global major version would be incremented whenever something is moved or removed in any Forgejo component, and so would the REST API's major version.
Option B - Separately versioning the REST API
In this case, the REST API's major version number would only be incremented when something is moved or removed in the REST API, while the global major version number would remain unchanged.
However, the global major version would be incremented when an old version of the REST API would be dropped.
Option C - Removing/ignoring the REST API versioning
Since the REST API was never semantically versioned, and since the project as a whole would become semantically versioned, it could be somehow acceptable to drop separate versioning for the API :
- by removing the version number from the route path (i.e. only
GET /api/user would work)
- or by ignoring whatever value is passed (i.e.
GET /api/v1/user would continue to work but so would GET /api/v2/user, GET /api/v314/api/user and GET /api/whatever/user)
- and eventually making it optional (i.e.
GET /api/user would also work).
Getting started
In order to actually adopt SemVer, a semantic version will eventually be created for the first time, but there are multiple options available as to where start from, exactly.
Option A - Migrate existing Forgejo versions to SemVer starting from scratch
v1.18.0-rc0 would become v1.0.0-rc.0 ;
v1.18.0-rc1 would become v1.0.0-rc.1 ;
v1.18.0-rc1-1 would become v1.0.0-rc.1+1 ;
v1.18.0-rc1-2 would become v1.0.0-rc.1+2 ;
v1.18.0-0 would become v1.0.0+0 (or v1.0.0) ;
v1.18.0-1 would become v1.0.0+1.
Option B - Migrate future Forgejo versions to SemVer starting from scratch
v1.18.0-1 & older would remain as-is ;
- the next one will be
v1.0.0.
Option C - Migrate existing Forgejo versions to SemVer starting from the previous Gitea version
The previous version number (1.17.4) would be incremented according to SemVer based on changes occured in the last version (i.e. 1.18.0 would remain as-is or replaced by 1.17.5 or 2.O.O).
Option D - Migrate future Forgejo versions to SemVer starting from the last Forgejo version
The last version number (1.18.0) will be incremented according to SemVer (i.e. to 1.18.1, 1.19.0 or 2.0.0).
Related discussions
Personally, I ordered options according to my own preferences.
Thanks
Progress report
| Task |
Issue |
PR |
Release |
Create semantic version & /api/forgejo/v1/version endpoint returning it |
#212 |
#242 |
1.19.0-0 |
| Name binaries after semantic version |
#455 |
- |
- |
| Redirect tag references to Gitea version |
- |
- |
- |
| Name tag after semantic version |
- |
- |
- |
# Introduction
[SemVer](https://semver.org/spec/v2.0.0.html) allows users to understand the scope of a software update at first glance, based on the following :
- the patch number is incremented when something is fixed ;
- the minor number is incremented when something is added ;
- the major number is incremented when something is moved or removed.
*something* could be :
- a command, an option or an argument, for a CLI ;
- a route path, a query parameter or a body property, for a REST API ;
- a text node, a button or a field, for a GUI.
# Forgejo's case
## Generality
Since Forgejo has all of the above, changes to all of those components should be taken into consideration when creating a new version number.
## The REST API
A major version number is specified in Forgejo's REST API's base URL (`/api/v1`) but was never incremented.
Multiple options are available :
### Option A - Matching the REST API's version with the global version
It's actually likely that the REST API's major version number already matches the global major version number, so the former would never have been incremented simply because the latter never were either.
So, as stated in the introduction, the global major version would be incremented whenever something is moved or removed in any Forgejo component, and so would the REST API's major version.
### Option B - Separately versioning the REST API
In this case, the REST API's major version number would only be incremented when something is moved or removed in the REST API, while the global major version number would remain unchanged.
However, the global major version would be incremented when an old version of the REST API would be dropped.
### Option C - Removing/ignoring the REST API versioning
Since the REST API was never semantically versioned, and since the project as a whole would become semantically versioned, it could be somehow acceptable to drop separate versioning for the API :
- by removing the version number from the route path *(i.e. only `GET /api/user` would work)*
- or by ignoring whatever value is passed *(i.e. `GET /api/v1/user` would continue to work but so would `GET /api/v2/user`, `GET /api/v314/api/user` and `GET /api/whatever/user`)*
- and eventually making it optional *(i.e. `GET /api/user` would also work)*.
## Getting started
In order to actually adopt SemVer, a semantic version will eventually be created for the first time, but there are multiple options available as to *where* start from, exactly.
### Option A - Migrate existing Forgejo versions to SemVer starting from scratch
- `v1.18.0-rc0` would become `v1.0.0-rc.0` ;
- `v1.18.0-rc1` would become `v1.0.0-rc.1` ;
- `v1.18.0-rc1-1` would become `v1.0.0-rc.1+1` ;
- `v1.18.0-rc1-2` would become `v1.0.0-rc.1+2` ;
- `v1.18.0-0` would become `v1.0.0+0` (or `v1.0.0`) ;
- `v1.18.0-1` would become `v1.0.0+1`.
### Option B - Migrate future Forgejo versions to SemVer starting from scratch
- `v1.18.0-1` & older would remain as-is ;
- the next one will be `v1.0.0`.
### Option C - Migrate existing Forgejo versions to SemVer starting from the previous Gitea version
The previous version number (`1.17.4`) would be incremented according to SemVer based on changes occured in the last version (i.e. `1.18.0` would remain as-is or replaced by `1.17.5` or `2.O.O`).
### Option D - Migrate future Forgejo versions to SemVer starting from the last Forgejo version
The last version number (`1.18.0`) will be incremented according to SemVer (i.e. to `1.18.1`, `1.19.0` or `2.0.0`).
## Related discussions
- [`forgejo/meta#60`](/forgejo/meta/issues/60)
- [`forgejo/forgejo#43`](/forgejo/forgejo/issues/43)
---
Personally, I ordered options according to my own preferences.
Thanks
---
### Progress report
| Task | Issue | PR | Release |
| --- | --- | --- | --- |
| Create semantic version & `/api/forgejo/v1/version` endpoint returning it | #212 | #242 | `1.19.0-0` |
| Name binaries after semantic version | #455 | - | - |
| Redirect tag references to Gitea version | - | - | - |
| Name tag after semantic version | - | - | - |