aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/reporting.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-12-13 12:25:52 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2022-12-13 17:02:33 +0100
commitf6511626584e1f100818d9036909e0480ffd34c1 (patch)
treeb6c603e11403b1829389a838da6bc919997242b4 /dashboard/app/reporting.go
parente660de910a08eb32c8551c48b39317fff1136c1b (diff)
dashboard: return bisection info as BugReport object
Bisection jobs can refer to other crashes/builds, so for the full bug info we need complete BugReport objects.
Diffstat (limited to 'dashboard/app/reporting.go')
-rw-r--r--dashboard/app/reporting.go23
1 files changed, 19 insertions, 4 deletions
diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go
index c3d5c9683..befae2c62 100644
--- a/dashboard/app/reporting.go
+++ b/dashboard/app/reporting.go
@@ -1321,19 +1321,18 @@ func loadFullBugInfo(c context.Context, bug *Bug, bugKey *db.Key,
}
ret := &dashapi.FullBugInfo{}
// Query bisections.
+ var err error
if bug.BisectCause > BisectPending {
- job, _, _, _, err := loadBisectJob(c, bug, JobBisectCause)
+ ret.BisectCause, err = prepareBisectionReport(c, bug, JobBisectCause, reporting)
if err != nil {
return nil, err
}
- ret.BisectCause, _ = bisectFromJob(c, job)
}
if bug.BisectFix > BisectPending {
- job, _, _, _, err := loadBisectJob(c, bug, JobBisectFix)
+ ret.BisectFix, err = prepareBisectionReport(c, bug, JobBisectFix, reporting)
if err != nil {
return nil, err
}
- ret.BisectFix, _ = bisectFromJob(c, job)
}
// Query similar bugs.
similar, err := loadSimilarBugs(c, bug)
@@ -1372,6 +1371,22 @@ func loadFullBugInfo(c context.Context, bug *Bug, bugKey *db.Key,
return ret, nil
}
+func prepareBisectionReport(c context.Context, bug *Bug, jobType JobType,
+ reporting *Reporting) (*dashapi.BugReport, error) {
+ job, _, jobKey, _, err := loadBisectJob(c, bug, jobType)
+ if err != nil {
+ return nil, err
+ }
+ if job.Reporting != "" {
+ ret, err := createBugReportForJob(c, job, jobKey, reporting.Config)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create the job bug report: %w", err)
+ }
+ return ret, nil
+ }
+ return nil, nil
+}
+
type crashWithKey struct {
crash *Crash
key *db.Key