diff options
author | Griffin Smith <grfn@gws.fyi> | 2021-12-15T23·35-0500 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2021-12-19T16·16+0000 |
commit | b075b1df9de2af1f3880857595d2f53c5a830e0a (patch) | |
tree | b9fc4b7378c9900e692df8797d99b68a9f8542d7 /ops/besadii | |
parent | 7f593781f3f2c8f0dc2446c11cf3f664f8fb8af4 (diff) |
feat(ops/besadii): Make branch key cl/XXXX r/3303
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/<cl number>, 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 <mail@tazj.in> Autosubmit: grfn <grfn@gws.fyi>
Diffstat (limited to 'ops/besadii')
-rw-r--r-- | ops/besadii/main.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ops/besadii/main.go b/ops/besadii/main.go index dd009e6babeb..e051bb367e34 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, |