aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-07-07 19:20:14 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-07-08 13:37:33 +0000
commit4d9fdfa461729263f3e6134019fc4feb812381d2 (patch)
tree802172ad91b9c80c6529bd6a52f546999fa00c25
parent5560041e5bb99f76eba3749c94dfe4710539dc76 (diff)
syz-cluster: adjust the title generation logic
Add [moderation/CI] prefix for moderation emails. Add a prefix with the service name for reports.
-rw-r--r--syz-cluster/email-reporter/handler.go4
-rw-r--r--syz-cluster/email-reporter/handler_test.go4
2 files changed, 6 insertions, 2 deletions
diff --git a/syz-cluster/email-reporter/handler.go b/syz-cluster/email-reporter/handler.go
index c362d8f24..14c7d78ed 100644
--- a/syz-cluster/email-reporter/handler.go
+++ b/syz-cluster/email-reporter/handler.go
@@ -75,7 +75,11 @@ func (h *Handler) report(ctx context.Context, rep *api.SessionReport) error {
}
if rep.Moderation {
toSend.To = []string{h.emailConfig.ModerationList}
+ toSend.Subject = "[moderation/CI] " + toSend.Subject
} else {
+ if h.emailConfig.Name != "" {
+ toSend.Subject = fmt.Sprintf("[%s] %s", h.emailConfig.Name, toSend.Subject)
+ }
// We assume that email reporting is used for series received over emails.
toSend.InReplyTo = rep.Series.ExtID
toSend.To = rep.Cc
diff --git a/syz-cluster/email-reporter/handler_test.go b/syz-cluster/email-reporter/handler_test.go
index 3008b0b24..b5eba8ce2 100644
--- a/syz-cluster/email-reporter/handler_test.go
+++ b/syz-cluster/email-reporter/handler_test.go
@@ -31,7 +31,7 @@ func TestModerationReportFlow(t *testing.T) {
receivedEmail.Body = nil // for now don't validate the body
assert.Equal(t, &emailclient.Email{
To: []string{testEmailConfig.ModerationList},
- Subject: "Re: " + testSeries.Title,
+ Subject: "[moderation/CI] Re: " + testSeries.Title,
// Note that InReplyTo and Cc are nil.
}, receivedEmail)
@@ -56,7 +56,7 @@ func TestModerationReportFlow(t *testing.T) {
assert.Equal(t, &emailclient.Email{
To: testSeries.Cc,
Cc: []string{testEmailConfig.ArchiveList},
- Subject: "Re: " + testSeries.Title,
+ Subject: "[name] Re: " + testSeries.Title,
InReplyTo: testSeries.ExtID,
}, receivedEmail)
}