diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-08-16 15:54:14 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-08-26 12:33:44 +0200 |
| commit | 741e7a9558cea71b96d87fb280f68346da4937e4 (patch) | |
| tree | 4539197bc8a66ba9fbf4191bbfe546356a7d12f7 /dashboard | |
| parent | 2f3b44ea4305aa200432fef587ba1a6dc89a00f3 (diff) | |
syz-ci, dashboard: return alt titles in job results
Diffstat (limited to 'dashboard')
| -rw-r--r-- | dashboard/app/entities.go | 13 | ||||
| -rw-r--r-- | dashboard/app/jobs.go | 22 | ||||
| -rw-r--r-- | dashboard/dashapi/dashapi.go | 15 |
3 files changed, 35 insertions, 15 deletions
diff --git a/dashboard/app/entities.go b/dashboard/app/entities.go index 14f3fd785..cc25c37f8 100644 --- a/dashboard/app/entities.go +++ b/dashboard/app/entities.go @@ -669,6 +669,19 @@ func stringInList(list []string, str string) bool { return false } +func stringListsIntersect(a, b []string) bool { + m := map[string]bool{} + for _, strA := range a { + m[strA] = true + } + for _, strB := range b { + if m[strB] { + return true + } + } + return false +} + func mergeString(list []string, str string) []string { if !stringInList(list, str) { list = append(list, str) diff --git a/dashboard/app/jobs.go b/dashboard/app/jobs.go index 1a3bf20a5..d67b3cc55 100644 --- a/dashboard/app/jobs.go +++ b/dashboard/app/jobs.go @@ -572,7 +572,7 @@ func isRetestReproJob(job *Job, build *Build) bool { job.KernelBranch == build.KernelBranch } -func handleRetestedRepro(c context.Context, now time.Time, job *Job, jobKey *db.Key, crashTitle string) error { +func handleRetestedRepro(c context.Context, now time.Time, job *Job, jobKey *db.Key, allTitles []string) error { bugKey := jobKey.Parent() crashKey := db.NewKey(c, "Crash", "", job.CrashID, bugKey) crash := new(Crash) @@ -592,7 +592,7 @@ func handleRetestedRepro(c context.Context, now time.Time, job *Job, jobKey *db. } // Update the crash. crash.LastReproRetest = now - if crashTitle == "" { + if len(allTitles) == 0 { // If there was any crash at all, the repro is still not worth discarding. crash.ReproIsRevoked = true } @@ -620,12 +620,10 @@ func handleRetestedRepro(c context.Context, now time.Time, job *Job, jobKey *db. bug.HeadReproLevel = ReproLevelSyz } } - if crashTitle != "" { + if stringInList(allTitles, bug.Title) || stringListsIntersect(bug.AltTitles, allTitles) { // We don't want to confuse users, so only update LastTime if the generated crash // really relates to the existing bug. - if stringInList(bug.AltTitles, crashTitle) { - bug.LastTime = now - } + bug.LastTime = now } if _, err := db.Put(c, bugKey, bug); err != nil { return fmt.Errorf("failed to put bug: %v", err) @@ -633,6 +631,14 @@ func handleRetestedRepro(c context.Context, now time.Time, job *Job, jobKey *db. return nil } +func gatherCrashTitles(req *dashapi.JobDoneReq) []string { + ret := append([]string{}, req.CrashAltTitles...) + if req.CrashTitle != "" { + ret = append(ret, req.CrashTitle) + } + return ret +} + // doneJob is called by syz-ci to mark completion of a job. func doneJob(c context.Context, req *dashapi.JobDoneReq) error { jobID := req.ID @@ -650,7 +656,7 @@ func doneJob(c context.Context, req *dashapi.JobDoneReq) error { return fmt.Errorf("job %v: already finished", jobID) } if job.Type == JobTestPatch { - err := handleRetestedRepro(c, now, job, jobKey, req.CrashTitle) + err := handleRetestedRepro(c, now, job, jobKey, gatherCrashTitles(req)) if err != nil { return fmt.Errorf("job %v: failed to handle retested repro, %w", jobID, err) } @@ -739,7 +745,7 @@ func updateBugBisection(c context.Context, job *Job, jobKey *db.Key, req *dashap } // The repro is not working on the HEAD commit anymore, update the repro status. if job.Type == JobBisectFix && req.Error == nil && len(req.Commits) > 0 { - err := handleRetestedRepro(c, now, job, jobKey, req.CrashTitle) + err := handleRetestedRepro(c, now, job, jobKey, gatherCrashTitles(req)) if err != nil { return err } diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index d5ccc1e0f..2a6c8df22 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -183,13 +183,14 @@ type JobPollResp struct { } type JobDoneReq struct { - ID string - Build Build - Error []byte - Log []byte // bisection log - CrashTitle string - CrashLog []byte - CrashReport []byte + ID string + Build Build + Error []byte + Log []byte // bisection log + CrashTitle string + CrashAltTitles []string + CrashLog []byte + CrashReport []byte // Bisection results: // If there is 0 commits: // - still happens on HEAD for fix bisection |
