From b075b1df9de2af1f3880857595d2f53c5a830e0a Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Wed, 15 Dec 2021 18:35:57 -0500 Subject: feat(ops/besadii): Make branch key cl/XXXX The branch key for buildkite builds isn't actually used to fetch if a commit is given - instead, it's just a visual grouping of multiple builds. This means we can just make the branch key cl/, which is the convention we already use to refer to CLs and gets us a nice visual grouping of builds of successive patchsets of the same CL number, even though the ref we're providing isn't a real ref. Change-Id: Iaa9111297a88f965fda94cd8266240106f58a100 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4347 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: grfn --- ops/besadii/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ops/besadii/main.go') diff --git a/ops/besadii/main.go b/ops/besadii/main.go index dd009e6bab..e051bb367e 100644 --- a/ops/besadii/main.go +++ b/ops/besadii/main.go @@ -28,6 +28,7 @@ import ( "path" "regexp" "strconv" + "strings" ) // Regular expression to extract change ID out of a URL @@ -202,9 +203,12 @@ func triggerBuild(cfg *config, log *syslog.Writer, trigger *buildTrigger) error 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]) + build := Build{ Commit: trigger.commit, - Branch: trigger.ref, + Branch: branch, Env: env, Author: Author{ Name: trigger.author, -- cgit 1.4.1