From 1d4715781ca8954d8c20e7a7420a7775fd671416 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 19 Dec 2021 19:47:04 +0300 Subject: fix(ops/besadii): Only set branch to CL when building patchsets If we set this for canon, then stuff starts to fail in non-obvious ways. Change-Id: I3bf38e29151c6066aaf4eba68ae387272d8a82c2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4463 Tested-by: BuildkiteCI Autosubmit: tazjin Reviewed-by: grfn --- ops/besadii/main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ops/besadii/main.go') diff --git a/ops/besadii/main.go b/ops/besadii/main.go index b382821bcc..d4dcc40b95 100644 --- a/ops/besadii/main.go +++ b/ops/besadii/main.go @@ -195,6 +195,7 @@ func updateGerrit(cfg *config, review reviewInput, changeId, patchset string) { // Trigger a build of a given branch & commit on Buildkite func triggerBuild(cfg *config, log *syslog.Writer, trigger *buildTrigger) error { env := make(map[string]string) + branch := trigger.ref // Pass information about the originating Gerrit change to the // build, if it is for a patchset. @@ -207,10 +208,11 @@ func triggerBuild(cfg *config, log *syslog.Writer, trigger *buildTrigger) error env["GERRIT_CHANGE_ID"] = trigger.changeId env["GERRIT_PATCHSET"] = trigger.patchset headBuild = false - } - // The branch doesn't have to be a real ref (it's just used to group builds), so make it the identifier for the CL - branch := fmt.Sprintf("cl/%v", strings.Split(trigger.ref, "/")[3]) + // The branch doesn't have to be a real ref (it's just used to + // group builds), so make it the identifier for the CL + branch = fmt.Sprintf("cl/%v", strings.Split(trigger.ref, "/")[3]) + } build := Build{ Commit: trigger.commit, -- cgit 1.4.1