From c03873ec186a3b88b345caaa713a57c5f6ea9c9b Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 6 Aug 2025 11:19:56 +0200 Subject: pkg/manager: embed BugInfo into UICrashType This reduces the redundancy a bit. --- pkg/manager/html/crash.html | 2 +- pkg/manager/html/main.html | 8 ++++---- pkg/manager/http.go | 32 ++++++++++---------------------- 3 files changed, 15 insertions(+), 27 deletions(-) (limited to 'pkg') diff --git a/pkg/manager/html/crash.html b/pkg/manager/html/crash.html index 48c50ab71..85e2e7619 100644 --- a/pkg/manager/html/crash.html +++ b/pkg/manager/html/crash.html @@ -3,7 +3,7 @@ Copyright 2024 syzkaller project authors. All rights reserved. Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. */}} -{{.Description}} +{{.Title}} {{if .Triaged}} Report: {{.Triaged}} diff --git a/pkg/manager/html/main.html b/pkg/manager/html/main.html index eb3644bba..d034fdded 100644 --- a/pkg/manager/html/main.html +++ b/pkg/manager/html/main.html @@ -30,8 +30,8 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{range $c := $.Crashes}} - {{$c.Description}} - {{$c.Count}} + {{$c.Title}} + {{len $c.Crashes}} {{formatTime $c.FirstTime}} {{formatTime $c.LastTime}} @@ -39,8 +39,8 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{if $c.Triaged}} {{$c.Triaged}} {{end}} - {{if $c.Strace}} - Strace + {{if $c.StraceFile}} + Strace {{end}} diff --git a/pkg/manager/http.go b/pkg/manager/http.go index 3e7ba6fcf..e6a7d6b46 100644 --- a/pkg/manager/http.go +++ b/pkg/manager/http.go @@ -355,17 +355,11 @@ func makeUICrashType(info *BugInfo, startTime time.Time, repros map[string]bool) triaged := reproStatus(info.HasRepro, info.HasCRepro, repros[info.Title], info.ReproAttempts >= MaxReproAttempts) return UICrashType{ - Description: info.Title, - FirstTime: info.FirstTime, - LastTime: info.LastTime, - New: info.FirstTime.After(startTime), - Active: info.LastTime.After(startTime), - ID: info.ID, - Count: len(info.Crashes), - Triaged: triaged, - Strace: info.StraceFile, - Crashes: crashes, - ReproAttempts: info.ReproAttempts, + BugInfo: *info, + New: info.FirstTime.After(startTime), + Active: info.LastTime.After(startTime), + Triaged: triaged, + Crashes: crashes, } } @@ -1029,17 +1023,11 @@ type UICrashPage struct { } type UICrashType struct { - Description string - FirstTime time.Time - LastTime time.Time - New bool // was first found in the current run - Active bool // was found in the current run - ID string - Count int - Triaged string - Strace string - ReproAttempts int - Crashes []UICrash + BugInfo + New bool // was first found in the current run + Active bool // was found in the current run + Triaged string + Crashes []UICrash } type UICrash struct { -- cgit mrf-deployment