From 4d9fdfa461729263f3e6134019fc4feb812381d2 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 7 Jul 2025 19:20:14 +0200 Subject: syz-cluster: adjust the title generation logic Add [moderation/CI] prefix for moderation emails. Add a prefix with the service name for reports. --- syz-cluster/email-reporter/handler.go | 4 ++++ syz-cluster/email-reporter/handler_test.go | 4 ++-- 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) } -- cgit mrf-deployment