From d829a3314a66aa0ab0656453d542929bb2fe6510 Mon Sep 17 00:00:00 2001 From: Xavier Calland Date: Tue, 30 Apr 2024 14:40:13 +0200 Subject: [PATCH 1/2] zoekt-indexserver: handle gerrit-mirror RepoNameFormat config --- cmd/zoekt-indexserver/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/zoekt-indexserver/config.go b/cmd/zoekt-indexserver/config.go index 0a8bc3662..954bb9b17 100644 --- a/cmd/zoekt-indexserver/config.go +++ b/cmd/zoekt-indexserver/config.go @@ -50,6 +50,7 @@ type ConfigEntry struct { ExcludeTopics []string Active bool NoArchived bool + RepoNameFormat string } func randomize(entries []ConfigEntry) []ConfigEntry { @@ -259,6 +260,9 @@ func executeMirror(cfg []ConfigEntry, repoDir string, pendingRepos chan<- string if c.Active { cmd.Args = append(cmd.Args, "-active") } + if c.RepoNameFormat != "" { + cmd.Args = append(cmd.Args, "-repo-name-format", c.RepoNameFormat) + } cmd.Args = append(cmd.Args, c.GerritApiURL) } else { log.Printf("executeMirror: ignoring config, because it does not contain any valid repository definition: %v", c) From e3826423b33cd7f3d2058499776d8c6e05ba1cdd Mon Sep 17 00:00:00 2001 From: Xavier Calland Date: Thu, 2 May 2024 10:55:41 +0200 Subject: [PATCH 2/2] prefix configuration parameter name with "Gerrit" --- cmd/zoekt-indexserver/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/zoekt-indexserver/config.go b/cmd/zoekt-indexserver/config.go index 954bb9b17..91536f9e0 100644 --- a/cmd/zoekt-indexserver/config.go +++ b/cmd/zoekt-indexserver/config.go @@ -50,7 +50,7 @@ type ConfigEntry struct { ExcludeTopics []string Active bool NoArchived bool - RepoNameFormat string + GerritRepoNameFormat string } func randomize(entries []ConfigEntry) []ConfigEntry { @@ -260,8 +260,8 @@ func executeMirror(cfg []ConfigEntry, repoDir string, pendingRepos chan<- string if c.Active { cmd.Args = append(cmd.Args, "-active") } - if c.RepoNameFormat != "" { - cmd.Args = append(cmd.Args, "-repo-name-format", c.RepoNameFormat) + if c.GerritRepoNameFormat != "" { + cmd.Args = append(cmd.Args, "-repo-name-format", c.GerritRepoNameFormat) } cmd.Args = append(cmd.Args, c.GerritApiURL) } else {