From 71197f3ac138d7cb03551b7d2159bfc4ecf5c5c2 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 19 Jan 2023 14:36:15 +0100 Subject: dashboard: show no more than 10 repro retesting jobs We do have cases [1] where a syzbot problem has led to numerous patch testing requests for a bug. There's no sense to display them all. [1] https://syzkaller.appspot.com/bug?id=0881c535c265ca965edc49c0ac3d0a9850d26eb1 --- dashboard/app/main.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dashboard/app/main.go b/dashboard/app/main.go index 34a2ddf93..9d1340425 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -543,7 +543,7 @@ func handleBug(c context.Context, w http.ResponseWriter, r *http.Request) error SampleReport: sampleReport, Crashes: crashesTable, TestPatchJobs: &uiJobList{ - Title: "Patch testing requests:", + Title: "Last patch testing requests:", PerBug: true, Jobs: testPatchJobs, }, @@ -1497,6 +1497,7 @@ func getUIJobs(keys []*db.Key, jobs []*Job) []*uiJob { func loadTestPatchJobs(c context.Context, bug *Bug) ([]*uiJob, error) { bugKey := bug.key(c) + var jobs []*Job keys, err := db.NewQuery("Job"). Ancestor(bugKey). @@ -1507,8 +1508,16 @@ func loadTestPatchJobs(c context.Context, bug *Bug) ([]*uiJob, error) { if err != nil { return nil, err } + const maxAutomaticJobs = 10 + autoJobsLeft := maxAutomaticJobs var results []*uiJob for i, job := range jobs { + if job.User == "" { + if autoJobsLeft == 0 { + continue + } + autoJobsLeft-- + } var build *Build if job.BuildID != "" { if build, err = loadBuild(c, bug.Namespace, job.BuildID); err != nil { -- cgit mrf-deployment