From 3e482aa6d2582a538b96d2cab34d2ae765008a5f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 26 Jun 2022 16:22:55 -0700 Subject: 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 Tested-by: CI --- tools/gerrit-hook/gerrit.go | 5 +++++ 1 file changed, 5 insertions(+) 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" { -- cgit 1.4.1