aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-04-25 16:04:23 +0200
committerAleksandr Nogikh <wp32pw@gmail.com>2023-04-26 11:50:12 +0200
commitca8bc64d93af67c23642000020cd08760fa3b5f3 (patch)
treed50f4adaa672cd90bb7d39b34141608e0b0847ff
parent7560799c75f65327fe726b5b4b256d23b341709c (diff)
dashboard: include month into monthly reports
To make reports better distinguishable, include the month and the year when the report was generated. E.g. "Monthly ext4 report (Jan 2000)".
-rw-r--r--dashboard/app/reporting_email.go7
-rw-r--r--dashboard/app/reporting_lists.go1
-rw-r--r--dashboard/app/subsystem_test.go12
-rw-r--r--dashboard/dashapi/dashapi.go1
4 files changed, 12 insertions, 9 deletions
diff --git a/dashboard/app/reporting_email.go b/dashboard/app/reporting_email.go
index 6119411f6..9cce961df 100644
--- a/dashboard/app/reporting_email.go
+++ b/dashboard/app/reporting_email.go
@@ -372,9 +372,10 @@ func emailListReport(c context.Context, rep *dashapi.BugListReport, cfg *EmailCo
templateName: "mail_subsystem.txt",
templateArg: args,
cfg: cfg,
- title: fmt.Sprintf("Monthly %s report", rep.Subsystem),
- reportID: rep.ID,
- maintainers: rep.Maintainers,
+ title: fmt.Sprintf("Monthly %s report (%s)",
+ rep.Subsystem, rep.Created.Format("Jan 2006")),
+ reportID: rep.ID,
+ maintainers: rep.Maintainers,
})
}
diff --git a/dashboard/app/reporting_lists.go b/dashboard/app/reporting_lists.go
index 8f3332338..286b067d6 100644
--- a/dashboard/app/reporting_lists.go
+++ b/dashboard/app/reporting_lists.go
@@ -418,6 +418,7 @@ func reportingBugListReport(c context.Context, subsystemReport *SubsystemReport,
}
ret := &dashapi.BugListReport{
ID: stage.ID,
+ Created: subsystemReport.Created,
Config: configJSON,
Link: fmt.Sprintf("%v/%s/s/%s", appURL(c), ns, name),
Subsystem: name,
diff --git a/dashboard/app/subsystem_test.go b/dashboard/app/subsystem_test.go
index 80dd7863c..847140d86 100644
--- a/dashboard/app/subsystem_test.go
+++ b/dashboard/app/subsystem_test.go
@@ -288,7 +288,7 @@ func TestPeriodicSubsystemReminders(t *testing.T) {
// Expect the reminder for subsystemA.
reply := client.pollEmailBug()
- c.expectEQ(reply.Subject, "[moderation] Monthly subsystemA report")
+ c.expectEQ(reply.Subject, "[moderation] Monthly subsystemA report (Jan 2000)")
c.expectEQ(reply.To, []string{"moderation@syzkaller.com"})
c.expectEQ(reply.Cc, []string(nil))
c.expectEQ(reply.Body, fmt.Sprintf(`Hello subsystemA maintainers/developers,
@@ -319,7 +319,7 @@ syzbot engineers can be reached at syzkaller@googlegroups.com.
// Expect the reminder for subsystemB.
reply = client.pollEmailBug()
- c.expectEQ(reply.Subject, "[moderation] Monthly subsystemB report")
+ c.expectEQ(reply.Subject, "[moderation] Monthly subsystemB report (Jan 2000)")
c.expectEQ(reply.To, []string{"moderation@syzkaller.com"})
c.expectEQ(reply.Cc, []string(nil))
c.expectEQ(reply.Body, fmt.Sprintf(`Hello subsystemB maintainers/developers,
@@ -387,7 +387,7 @@ func TestSubsystemRemindersModeration(t *testing.T) {
// Expect the reminder for subsystemA.
replyA := client.pollEmailBug()
- c.expectEQ(replyA.Subject, "[moderation] Monthly subsystemA report")
+ c.expectEQ(replyA.Subject, "[moderation] Monthly subsystemA report (Jan 2000)")
// Moderate the subsystemA list.
c.advanceTime(time.Hour)
@@ -399,7 +399,7 @@ func TestSubsystemRemindersModeration(t *testing.T) {
// Expect the normal report.
reply := client.pollEmailBug()
- c.expectEQ(reply.Subject, "[syzbot] Monthly subsystemA report")
+ c.expectEQ(reply.Subject, "[syzbot] Monthly subsystemA report (Jan 2000)")
c.expectEQ(reply.To, []string{"bugs@syzkaller.com", "subsystemA@list.com", "subsystemA@person.com"})
c.expectEQ(reply.Cc, []string(nil))
c.expectEQ(reply.Body, fmt.Sprintf(`Hello subsystemA maintainers/developers,
@@ -513,7 +513,7 @@ func TestSubsystemReportGeneration(t *testing.T) {
c.expectOK(err)
reply := client.pollEmailBug()
- c.expectEQ(reply.Subject, "[moderation] Monthly subsystemA report")
+ c.expectEQ(reply.Subject, "[moderation] Monthly subsystemA report (Feb 2000)")
c.expectEQ(reply.To, []string{"moderation@syzkaller.com"})
c.expectEQ(reply.Cc, []string(nil))
c.expectEQ(reply.Body, fmt.Sprintf(`Hello subsystemA maintainers/developers,
@@ -568,7 +568,7 @@ syzbot engineers can be reached at syzkaller@googlegroups.com.
c.expectOK(err)
secondReply := client.pollEmailBug()
- c.expectEQ(secondReply.Subject, "[moderation] Monthly subsystemA report")
+ c.expectEQ(secondReply.Subject, "[moderation] Monthly subsystemA report (Feb 2000)")
c.expectNE(reply.Sender, secondReply.Sender)
c.expectTrue(strings.Contains(secondReply.Body, `7 Yes WARNING: has repro 6`))
}
diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go
index 11e56c6df..9dc5aa700 100644
--- a/dashboard/dashapi/dashapi.go
+++ b/dashboard/dashapi/dashapi.go
@@ -454,6 +454,7 @@ type BisectResult struct {
type BugListReport struct {
ID string
+ Created time.Time
Config []byte
Bugs []BugListItem
TotalStats BugListReportStats