about summary refs log tree commit diff
path: root/ops/besadii
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-12-19T16·47+0300
committertazjin <mail@tazj.in>2021-12-19T16·53+0000
commit1d4715781ca8954d8c20e7a7420a7775fd671416 (patch)
tree7eb16c3b934e9b8c98c5cbc0d44c7da6322645f3 /ops/besadii
parentf8b4029b1744bea77cc3f941d59c09d11f714f47 (diff)
fix(ops/besadii): Only set branch to CL when building patchsets r/3306
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 <mail@tazj.in>
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'ops/besadii')
-rw-r--r--ops/besadii/main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/ops/besadii/main.go b/ops/besadii/main.go
index b382821bcce7..d4dcc40b9533 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,