about summary refs log tree commit diff
path: root/tools/gerrit-hook
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-06-26 16:22:55 -0700
committerFranck Cuny <franck@fcuny.net>2022-06-26 16:26:02 -0700
commit3e482aa6d2582a538b96d2cab34d2ae765008a5f (patch)
treea4feb33a1de60c16045a8069e662cef6817f8e35 /tools/gerrit-hook
parentfeat(tools/gerrit-hook): run CI pipeline for all the repositories (diff)
downloadworld-3e482aa6d2582a538b96d2cab34d2ae765008a5f.tar.gz
fix(tools/gerrit-hook): replace `.' with `-dot-' in project's name
If the name of the project has a `.' in it's name (for example
`Emacs.d'), buildKite automatically replace it with `-dot'. Which means
that we also have to do this conversion here otherwise we're trying to
build against a pipeline that does not exists.

Change-Id: I54a7dce40da854f125ff43bfbd252b0cd5bfcb29
Reviewed-on: https://cl.fcuny.net/c/world/+/561
Reviewed-by: Franck Cuny <franck@fcuny.net>
Tested-by: CI
Diffstat (limited to 'tools/gerrit-hook')
-rw-r--r--tools/gerrit-hook/gerrit.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/gerrit-hook/gerrit.go b/tools/gerrit-hook/gerrit.go
index 04de53d..4854427 100644
--- a/tools/gerrit-hook/gerrit.go
+++ b/tools/gerrit-hook/gerrit.go
@@ -13,6 +13,7 @@ import (
 	"os"
 	"regexp"
 	"strconv"
+	"strings"
 	"time"
 )
 
@@ -76,6 +77,10 @@ func triggerForPatchsetCreated() (*buildTrigger, error) {
 
 	flag.Parse()
 
+	// if the name of the repository has  dot in it's name,  we
+	// replace it with the string `-dot-'.
+	trigger.project = strings.Replace(trigger.project, ".", "-dot-", -1)
+
 	// if the name of the targetted branch is not `main', we don't
 	// care about running the tests.
 	if trigger.branch != "main" {