feat: allow alphabetical introductionVersion

This commit is contained in:
Michal Klos
2025-06-27 18:01:58 +02:00
parent d8d2e63dc0
commit a1110f1167
3 changed files with 9 additions and 8 deletions

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 "==============================================================================================="

View File

@@ -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,

View File

@@ -50,13 +50,12 @@ 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 semantic-version number in production.
{{< /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.
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`.
The docs helper scripts render these alphabetic identifiers verbatim; once the release is cut, replace them with the actual semantic version (e.g. `releaseX``7.0.0`).
### Adding Envvars to Existing Ones