Skip to content
Permalink
Browse files

syz-ci: fix filling of kernel commit in bisection jobs

There is a bit of a mess: dashboard expects the start commit
in build info, but syz-ci sends the resulting cause commit.
Moreover for inconclusive bisection the commit is not filled at all.
Fill start commit in build info on start.

Update #501
  • Loading branch information...
dvyukov committed Mar 22, 2019
1 parent 8f92118 commit 4d9d915eae5984d25a3e7f557106935546a6563f
Showing with 32 additions and 31 deletions.
  1. +13 −11 dashboard/app/jobs.go
  2. +14 −12 dashboard/dashapi/dashapi.go
  3. +5 −8 syz-ci/jobs.go
@@ -394,17 +394,19 @@ func createJobResp(c context.Context, job *Job, jobKey *datastore.Key) (*dashapi
return nil, true, nil
}
resp := &dashapi.JobPollResp{
ID: jobID,
Manager: job.Manager,
KernelRepo: job.KernelRepo,
KernelBranch: job.KernelBranch,
KernelCommit: build.KernelCommit,
KernelConfig: kernelConfig,
SyzkallerCommit: build.SyzkallerCommit,
Patch: patch,
ReproOpts: crash.ReproOpts,
ReproSyz: reproSyz,
ReproC: reproC,
ID: jobID,
Manager: job.Manager,
KernelRepo: job.KernelRepo,
KernelBranch: job.KernelBranch,
KernelCommit: build.KernelCommit,
KernelCommitTitle: build.KernelCommitTitle,
KernelCommitDate: build.KernelCommitDate,
KernelConfig: kernelConfig,
SyzkallerCommit: build.SyzkallerCommit,
Patch: patch,
ReproOpts: crash.ReproOpts,
ReproSyz: reproSyz,
ReproC: reproC,
}
switch job.Type {
case JobTestPatch:
@@ -126,18 +126,20 @@ type JobPollReq struct {
}

type JobPollResp struct {
ID string
Type JobType
Manager string
KernelRepo string
KernelBranch string
KernelCommit string
KernelConfig []byte
SyzkallerCommit string
Patch []byte
ReproOpts []byte
ReproSyz []byte
ReproC []byte
ID string
Type JobType
Manager string
KernelRepo string
KernelBranch string
KernelCommit string
KernelCommitTitle string
KernelCommitDate time.Time
KernelConfig []byte
SyzkallerCommit string
Patch []byte
ReproOpts []byte
ReproSyz []byte
ReproC []byte
}

type JobDoneReq struct {
@@ -296,7 +296,6 @@ func (jp *JobProcessor) process(job *Job) *dashapi.JobDoneReq {
OS: mgr.managercfg.TargetOS,
Arch: mgr.managercfg.TargetArch,
VMArch: mgr.managercfg.TargetVMArch,
KernelCommit: "[unknown]",
SyzkallerCommit: req.SyzkallerCommit,
},
}
@@ -307,10 +306,15 @@ func (jp *JobProcessor) process(job *Job) *dashapi.JobDoneReq {
resp.Build.CompilerID = mgr.compilerID
resp.Build.KernelRepo = req.KernelRepo
resp.Build.KernelBranch = req.KernelBranch
resp.Build.KernelCommit = "[unknown]"
case dashapi.JobBisectCause, dashapi.JobBisectFix:
mgrcfg.Name += "-bisect-job"
resp.Build.KernelRepo = mgr.mgrcfg.Repo
resp.Build.KernelBranch = mgr.mgrcfg.Branch
resp.Build.KernelCommit = req.KernelCommit
resp.Build.KernelCommitTitle = req.KernelCommitTitle
resp.Build.KernelCommitDate = req.KernelCommitDate
resp.Build.KernelConfig = req.KernelConfig
default:
err := fmt.Errorf("bad job type %v", req.Type)
job.resp.Error = []byte(err.Error())
@@ -401,13 +405,6 @@ func (jp *JobProcessor) bisect(job *Job, mgrcfg *mgrconfig.Config) error {
Date: com.Date,
})
}
if len(commits) == 1 {
com := commits[0]
resp.Build.KernelCommit = com.Hash
resp.Build.KernelCommitTitle = com.Title
resp.Build.KernelCommitDate = com.Date
resp.Build.KernelConfig = req.KernelConfig
}
if rep != nil {
resp.CrashTitle = rep.Title
resp.CrashReport = rep.Report

0 comments on commit 4d9d915

Please sign in to comment.
You can’t perform that action at this time.