diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-08-28 14:47:28 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-08-30 10:00:47 +0000 |
| commit | efdc800d3fd41aa3d65cdd3475e0d895614f460b (patch) | |
| tree | 875a9ced394f80b594a852215b8fd41a8a892e59 | |
| parent | 9d88bcc2e3a17738c9e9364bcb4193af3044548f (diff) | |
dashboard: support per-Manager priority
There are cases when we want to give priority to bugs from particular
managers, e.g. we want to make qemu crashes stay below GCE-based ones.
Add a Priority field to ConfigManager.
There should be no problems rolling this out -- newer crashes of
high-priority crashes will get a higher priority than before, but that's
good, we do want newer crashes to be higher.
| -rw-r--r-- | dashboard/app/api.go | 3 | ||||
| -rw-r--r-- | dashboard/app/config.go | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go index bca45f6e9..92e4ee899 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -855,6 +855,9 @@ func (crash *Crash) UpdateReportingPriority(c context.Context, build *Build, bug if crash.Title == bug.Title { prio += 1e8 // prefer reporting crash that matches bug title } + if _, mgrConfig := activeManager(crash.Manager, bug.Namespace); mgrConfig != nil { + prio += int64((mgrConfig.Priority - MinManagerPriority) * 1e5) + } if build.Arch == targets.AMD64 { prio += 1e3 } diff --git a/dashboard/app/config.go b/dashboard/app/config.go index e845852fc..9715c632a 100644 --- a/dashboard/app/config.go +++ b/dashboard/app/config.go @@ -204,8 +204,16 @@ type ConfigManager struct { FixBisectionDisabled bool // CC for all bugs that happened only on this manager. CC CCConfig + // Other parameters being equal, Priority helps to order bug's crashes. + // Priority is an integer in the range [-3;3]. + Priority int } +const ( + MinManagerPriority = -3 + MaxManagerPriority = 3 +) + // One reporting stage. type Reporting struct { // See GlobalConfig.AccessLevel. @@ -626,6 +634,10 @@ func checkManager(ns, name string, mgr ConfigManager) { if mgr.ObsoletingMinPeriod != 0 && mgr.ObsoletingMinPeriod < 24*time.Hour { panic(fmt.Sprintf("manager %v/%v obsoleting: too low MinPeriod", ns, name)) } + if mgr.Priority < MinManagerPriority && mgr.Priority > MaxManagerPriority { + panic(fmt.Sprintf("manager %v/%v priority is not in the [%d;%d] range", + ns, name, MinManagerPriority, MaxManagerPriority)) + } checkCC(&mgr.CC) } |
