Merge pull request #11476 from owncloud/feat/ocisdev-3

feat: allow alphabetical `introductionVersion`
This commit is contained in:
Martin authored and GitHub committed 2025-07-03 10:45:18 +02:00
commit 10c914be20
4 files changed
+20 -12

No files matched your search

+4 -2
View File
@@ -5,13 +5,14 @@
#
# valid examples:
#
# introductionVersion:"%%NEXT%%"
# introductionVersion:"pre5.0"
# introductionVersion:"5.0"
# introductionVersion:"4.9.3-rc5"
# introductionVersion:"5.0.1-cheesecake"
# introductionVersion:"5.10.100.15"
# introductionVersion:"0.0"
# introductionVersion:"releaseX" # acceptable alphabetical version
# introductionVersion:"Addams" # another alphabetical example
#
# invalid examples:
#
@@ -24,8 +25,9 @@
ERROR=0
SEMVER_REGEX="([0-9]|[1-9][0-9]*)(\.([0-9]|[1-9][0-9]*)){1,2}(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?"
ALPHA_REGEX="[A-Za-z]+[A-Za-z0-9-]*"
QUERY_INTRO=$(git grep -n "env:" -- '*.go' |grep -v -P "introductionVersion:\"($SEMVER_REGEX|(pre5\.0)|(%%NEXT%%))\""|grep -v "_test.go"|grep -v "vendor/")
QUERY_INTRO=$(git grep -n "env:" -- '*.go' |grep -v -P "introductionVersion:\"($SEMVER_REGEX|(pre5\\.0)|($ALPHA_REGEX))\""|grep -v "_test.go"|grep -v "vendor/")
RESULTS_INTRO=$(echo "${QUERY_INTRO}"|wc -l)
if [ "${QUERY_INTRO}" != "" ] && [ "${RESULTS_INTRO}" -gt 0 ]; then
echo "==============================================================================================="
@@ -186,7 +186,7 @@ func main() {
func replaceEnvVarPlaceHolder(s string) string {
return strings.Replace(
strings.Replace(s, "%%NEXT%%", "next", -1),
s,
"%%NEXT_PRODUCTION_VERSION%%",
"next-prod",
-1,
@@ -25,7 +25,8 @@ The relevant annotations in the envvar struct tag are:
Only if it is going to be replaced, not necessary if removed.
{{< hint warning >}}
During the development cycle, the value for the `removalVersion` must be set to `%%NEXT_PRODUCTION_VERSION%%`. This placeholder will be replaced by the real version number during the production releasing process.
* During the development cycle, the value for the `removalVersion` must be set to `%%NEXT_PRODUCTION_VERSION%%`. This placeholder will be replaced by the real semantic-version number during the production releasing process.
* Compared when introducing new envvars where you can use arbitrary alphabetic identifyers, the string for deprecation is fixed and cannot be altered.
{{< /hint >}}
For the documentation to show the correct value for the `removalVersion`, our docs helper scripts will automatically generate the correct version to be printed in the documentation. If `%%NEXT_PRODUCTION_VERSION%%` is found in the query, it will be replaced with `next-prod`, else the value found is used.
@@ -45,7 +46,7 @@ There are four different annotation variables that need to be filled:
| Annotation |Description| Format|
|---|---|---|
| deprecationVersion | The version the variable will be deprecated | semver (e.g. 3.0)|
| removalVersion| The version the variable will be removed from the codebase. Note that according to semver, a removal **MUST NOT** be made in a minor or patch version change, but only in a major release | `%%NEXT_PRODUCTION_VERSION%%` |
| removalVersion | The version the variable will be removed from the codebase. Consider semver rules when finally removing a deprecated ennvar | `%%NEXT_PRODUCTION_VERSION%%` |
| deprecationInfo | Information why the variable is deprecated, must start with the name of the variable in order to avoid confusion, when there are multiple options in the `env:`-field | string (e.g. NATS_NATS_HOST is confusing) |
| deprecationReplacement | The name of the variable that is going to replace the deprecated one.| string (e.g. NATS_HOST_ADDRESS) |
+12 -7
View File
@@ -19,14 +19,14 @@ The scope of an environment variable can be derived from its name. Therefore, it
- A variable that is only used in a particular service is a **local envvar**.
- A variable that is used in more than one service is a **global envvar**.
- Mandatory when used in a service, a global envvar must have a local counterpart.
- Variables that do not belong to any service are by definition global.
- If applicapable, a global envvar has a local counterpart.
- Variables that are not limited to any service are by definition global.
## Naming Scope
### Local Envvars
A local envvar always starts with the service name like `POSTPROCESSING_LOG_FILE`.
A local envvar always starts with the service name such as `POSTPROCESSING_LOG_FILE`.
### Global Envvars
@@ -50,13 +50,18 @@ The envvar struct tag contains at maximum the following key/value pairs to docum
If a new envvar is introduced, only the `introductionVersion` is required.
{{< hint warning >}}
During the development cycle, the value for the `introductionVersion` must be set to `%%NEXT%%`. This placeholder will be removed by the real version number during the production releasing process.
{{< hint info >}}
* During development, set `introductionVersion` to a short, **alphabetic code name** that represents the upcoming release (e.g. `releaseX`).
* This identifier stays constant until the release receives its final production semantic-version number.
{{< /hint >}}
For the documentation to show the correct value for the `IV` (introduction version), our docs helper scripts will automatically generate the correct version to be printed in the documentation. If `%%NEXT%%` is found in the query, it will be replaced with `next`, else the value found is used.
The docs helper scripts render these alphabetic identifiers verbatim. They appear in the next (master) branch of the admin docs as rendered here.
During the releasing process for a production release, the placeholder `%%NEXT%%` has to be replaced with the new production version number like `%%NEXT%%` → `7.0.0`.
Once the release is cut, before tagging, replace them with the actual semantic version (e.g. `releaseX` → `7.2.0`).
{{< hint info >}}
A new production version **MUST NOT** contain any alphabetic identifyers but the semantic version only.
{{< /hint >}}
### Adding Envvars to Existing Ones