about summary refs log tree commit diff
path: root/ops/besadii/main.go
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-12-15T18·51-0500
committergrfn <grfn@gws.fyi>2021-12-15T19·01+0000
commit50b43cfb66a46fb5579e71d0e55174bb77fa2858 (patch)
tree8b92034003a4ebf521737742b5e464f17344ec91 /ops/besadii/main.go
parent6b285f008d9cc79ec3dc4f4be10005ce35af12aa (diff)
fix(ops/besadii): Don't send notifications for CI status r/3253
Don't notify reviewers ever on CI status changes, and only notify the
owner if the build fails.

Change-Id: If2cf63581b49e3de77181024ce8a4213031f4bd5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4337
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Autosubmit: grfn <grfn@gws.fyi>
Diffstat (limited to 'ops/besadii/main.go')
-rw-r--r--ops/besadii/main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/ops/besadii/main.go b/ops/besadii/main.go
index 5567251852..dd009e6bab 100644
--- a/ops/besadii/main.go
+++ b/ops/besadii/main.go
@@ -98,6 +98,7 @@ type reviewInput struct {
 	OmitDuplicateComments          bool           `json:"omit_duplicate_comments"`
 	IgnoreDefaultAttentionSetRules bool           `json:"ignore_default_attention_set_rules"`
 	Tag                            string         `json:"tag"`
+	Notify                         string         `json:"notify,omitempty"`
 }
 
 func defaultConfigLocation() (string, error) {
@@ -262,6 +263,8 @@ func triggerBuild(cfg *config, log *syslog.Writer, trigger *buildTrigger) error
 
 		// Do not update the attention set for this comment.
 		IgnoreDefaultAttentionSetRules: true,
+
+		Notify: "NONE",
 	}
 	updateGerrit(cfg, review, trigger.changeId, trigger.patchset)
 
@@ -449,13 +452,16 @@ func postCommandMain(cfg *config) {
 
 	var vote int
 	var verb string
+	var notify string
 
 	if os.Getenv("BUILDKITE_COMMAND_EXIT_STATUS") == "0" {
 		vote = 1 // automation passed: +1 in Gerrit
 		verb = "passed"
+		notify = "NONE"
 	} else {
 		vote = -1
 		verb = "failed"
+		notify = "OWNER"
 	}
 
 	msg := fmt.Sprintf("Build of patchset %s %s: %s", patchset, verb, os.Getenv("BUILDKITE_BUILD_URL"))
@@ -470,6 +476,8 @@ func postCommandMain(cfg *config) {
 		IgnoreDefaultAttentionSetRules: vote == 1,
 
 		Tag: "autogenerated:buildkite~result",
+
+		Notify: notify,
 	}
 	updateGerrit(cfg, review, changeId, patchset)
 }