From ee89d73c09ca894a72f5d8a9945630001801f031 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 24 Mar 2023 10:58:17 +0100 Subject: 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. --- dashboard/app/config.go | 8 ++++++++ dashboard/app/reporting_lists.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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 -- cgit mrf-deployment