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 <mail@tazj.in>
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2021-12-19 19:47:04 +03:00 committed by tazjin
parent f8b4029b17
commit 1d4715781c

View file

@ -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,