nix: make status-go matching regex more lax
We had an issue where the `1.7.0` release was using the `v0.62.3.hotfix.3` version of `status-go` which didn't match the regex we use to verify if the specified version is a valid version according to [Semantic Versioning](https://semver.org/). You can check the current regex here: https://regex101.com/r/OeTQCv/3 I also added a trace message to show when we mark a build as `develop`. Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
663f5f41a0
commit
973bdb61b3
|
@ -48,14 +48,14 @@ let
|
|||
|
||||
# paths don't like slashes in them
|
||||
dropSlashes = builtins.replaceStrings [ "/" ] [ "_" ];
|
||||
# if version doesn't match this it's probably a commit
|
||||
versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-[[:alnum:].]+)?$";
|
||||
# if version doesn't match this it's probably a commit, it's lax semver
|
||||
versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+[[:alnum:]_.-]*$";
|
||||
sanitizeVersion = version:
|
||||
if (builtins.match versionRegex version) != null
|
||||
# Geth forces a 'v' prefix for all versions
|
||||
then lib.removePrefix "v" (dropSlashes version)
|
||||
# reduce metrics cardinality in Prometheus
|
||||
else "develop";
|
||||
else lib.traceValFn (v: "WARNING: Marking build version as 'develop'!") "develop";
|
||||
|
||||
in {
|
||||
inherit sanitizeVersion
|
||||
|
|
Loading…
Reference in New Issue