From 973bdb61b3e9e480a737fb3b075a3b45f9ae54be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 23 Oct 2020 17:41:00 +0200 Subject: [PATCH] nix: make status-go matching regex more lax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- nix/tools/utils.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/tools/utils.nix b/nix/tools/utils.nix index cab5d30809..486a035dc9 100644 --- a/nix/tools/utils.nix +++ b/nix/tools/utils.nix @@ -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