aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-03-24 10:58:17 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2023-03-24 14:00:26 +0100
commitee89d73c09ca894a72f5d8a9945630001801f031 (patch)
tree462aaaf870f2eaf2409d98e7119ea27a4abcb50c
parentadb42342dddda144a981f67bb633a8e61153e302 (diff)
dashboard: configure the minimal number of bugs in a reminder
2 seems as a reasonable number, but at the beginning we'll likely want to reduce the number of reports, thus increasing the bar.
-rw-r--r--dashboard/app/config.go8
-rw-r--r--dashboard/app/reporting_lists.go2
2 files changed, 9 insertions, 1 deletions
diff --git a/dashboard/app/config.go b/dashboard/app/config.go
index 9023646ae..d3763920f 100644
--- a/dashboard/app/config.go
+++ b/dashboard/app/config.go
@@ -126,6 +126,9 @@ type BugListReportingConfig struct {
// Bugs that were first discovered less than MinBugAge ago, will not be included.
// The default value is 2 weeks.
MinBugAge time.Duration
+ // Reports will only be sent if there are at least MinBugsCount bugs to notify about.
+ // The default value is 2.
+ MinBugsCount int
// SourceReporting is the name of the reporting stage from which bugs should be taken.
SourceReporting string
// If ModerationConfig is set, bug lists will be first sent there for human confirmation.
@@ -417,6 +420,11 @@ func checkSubsystems(ns string, cfg *Config) {
if reminder.MinBugAge == 0 {
reminder.MinBugAge = 24 * time.Hour * 14
}
+ if reminder.MinBugsCount == 0 {
+ reminder.MinBugsCount = 2
+ } else if reminder.MinBugsCount < 0 {
+ panic(fmt.Sprintf("%v: Reminder.MinBugsCount must be > 0", ns))
+ }
}
func checkKernelRepos(ns string, cfg *Config) {
diff --git a/dashboard/app/reporting_lists.go b/dashboard/app/reporting_lists.go
index 44a84a25f..19cf178ef 100644
--- a/dashboard/app/reporting_lists.go
+++ b/dashboard/app/reporting_lists.go
@@ -247,7 +247,7 @@ func querySubsystemReport(c context.Context, subsystem *Subsystem, reporting *Re
}
}
// Let's reduce noise and don't remind about just one bug.
- if len(noRepro)+len(withRepro) < 2 {
+ if len(noRepro)+len(withRepro) < config.MinBugsCount {
return nil, nil
}
// Even if we have enough bugs with a reproducer, there might still be bugs