From e30f059fce4242956bd289e6690b150ddc6cd0d5 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 15 Jan 2026 12:50:59 +0100 Subject: dashboard: add a manuallyUpstreamed helper This helper function can be used in the reporting filtering rules to skip certain reporting stages depending on whether the previous stage(s) have been manually upstreamed. Add tests that it does have the intended effect. Cc #6554. --- dashboard/app/reporting.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dashboard/app/reporting.go') diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go index 61bee541d..ad55ac6c3 100644 --- a/dashboard/app/reporting.go +++ b/dashboard/app/reporting.go @@ -387,6 +387,14 @@ func (bug *Bug) managerConfig(c context.Context) *ConfigManager { return &mgr } +func (bug *Bug) manuallyUpstreamed(name string) bool { + reporting := bugReportingByName(bug, name) + if reporting == nil { + return false + } + return !reporting.Closed.IsZero() && !reporting.Auto +} + func createNotification(c context.Context, typ dashapi.BugNotif, public bool, text string, bug *Bug, reporting *Reporting, bugReporting *BugReporting) (*dashapi.BugNotification, error) { reportingConfig, err := json.Marshal(reporting.Config) -- cgit mrf-deployment