Skip to content

Commit

Permalink
dashboard/app: split repo and branch by space
Browse files Browse the repository at this point in the history
We currently split them with / which makes it hard
to copy paste and generally understand that these
are 2 separate things.
Split them with a space. User request:
https://groups.google.com/forum/#!msg/syzkaller-bugs/yNFv3qgXY3I/ejPrxLCdBAAJ
  • Loading branch information
dvyukov committed Sep 3, 2018
1 parent bfe906c commit ffd18c6
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 20 deletions.
5 changes: 5 additions & 0 deletions dashboard/app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ var testConfig = &GlobalConfig{
},
},
},
KernelRepos: map[string]KernelRepo{
"repo10/branch10": {
Alias: "repo10alias",
},
},
}

const (
Expand Down
14 changes: 7 additions & 7 deletions dashboard/app/email_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestEmailReport(t *testing.T) {
syzbot found the following crash on:
HEAD commit: 111111111111 kernel_commit_title1
git tree: repo1/branch1
git tree: repo1 branch1
console output: %[2]v
kernel config: %[3]v
dashboard link: https://testapp.appspot.com/bug?extid=%[1]v
Expand Down Expand Up @@ -148,7 +148,7 @@ For more options, visit https://groups.google.com/d/optout.
body := fmt.Sprintf(`syzbot has found a reproducer for the following crash on:
HEAD commit: 111111111111 kernel_commit_title1
git tree: repo1/branch1
git tree: repo1 branch1
console output: %[3]v
kernel config: %[4]v
dashboard link: https://testapp.appspot.com/bug?extid=%[1]v
Expand Down Expand Up @@ -200,7 +200,7 @@ report1
syzbot found the following crash on:
HEAD commit: 111111111111 kernel_commit_title1
git tree: repo1/branch1
git tree: repo1 branch1
console output: %[3]v
kernel config: %[4]v
dashboard link: https://testapp.appspot.com/bug?extid=%[1]v
Expand Down Expand Up @@ -246,7 +246,7 @@ Content-Type: text/plain
c.expectOK(c.POST("/_ah/mail/", incoming3))

// Now upload a C reproducer.
build2 := testBuild(2)
build2 := testBuild(10)
build2.KernelCommitTitle = "a really long title, longer than 80 chars, really long-long-long-long-long-long title"
c.client2.UploadBuild(build2)
crash.BuildID = build2.ID
Expand Down Expand Up @@ -275,12 +275,12 @@ Content-Type: text/plain
c.expectEQ(len(msg.Attachments), 0)
body := fmt.Sprintf(`syzbot has found a reproducer for the following crash on:
HEAD commit: 222222222222 a really long title, longer than 80 chars, re..
git tree: repo2/branch2
HEAD commit: 101010101010 a really long title, longer than 80 chars, re..
git tree: repo10alias
console output: %[4]v
kernel config: %[5]v
dashboard link: https://testapp.appspot.com/bug?extid=%[1]v
compiler: compiler2
compiler: compiler10
syz repro: %[3]v
C reproducer: %[2]v
Expand Down
5 changes: 4 additions & 1 deletion dashboard/app/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,10 @@ func kernelRepoInfoRaw(repo, branch string) KernelRepo {
}
info := config.KernelRepos[repoID]
if info.Alias == "" {
info.Alias = repoID
info.Alias = repo
if branch != "" {
info.Alias += " " + branch
}
}
return info
}
Expand Down
8 changes: 4 additions & 4 deletions dashboard/app/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ test crash report
Tested on:
commit: 111111111111 kernel_commit_title1
git tree: repo1/branch1
git tree: repo1 branch1
console output: %[3]v
kernel config: %[2]v
compiler: compiler1
Expand Down Expand Up @@ -188,7 +188,7 @@ failed to apply patch
Tested on:
commit: 111111111111 kernel_commit_title1
git tree: repo1/branch1
git tree: repo1 branch1
kernel config: %[2]v
compiler: compiler1
patch: %[1]v
Expand Down Expand Up @@ -233,7 +233,7 @@ Error text is too large and was truncated, full error text is at:
Tested on:
commit: 111111111111 kernel_commit_title1
git tree: repo1/branch1
git tree: repo1 branch1
kernel config: %[4]v
compiler: compiler1
patch: %[3]v
Expand Down Expand Up @@ -271,7 +271,7 @@ Reported-and-tested-by: syzbot+%v@testapp.appspotmail.com
Tested on:
commit: 111111111111 kernel_commit_title1
git tree: repo1/branch1
git tree: repo1 branch1
kernel config: %[3]v
compiler: compiler1
patch: %[2]v
Expand Down
25 changes: 17 additions & 8 deletions dashboard/app/reporting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"testing"
"time"

"github.com/google/go-cmp/cmp"
"github.com/google/syzkaller/dashboard/dashapi"
)

Expand Down Expand Up @@ -49,7 +50,7 @@ func TestReportBug(t *testing.T) {
Maintainers: []string{"bar@foo.com", "foo@bar.com"},
CompilerID: "compiler1",
KernelRepo: "repo1",
KernelRepoAlias: "repo1/branch1",
KernelRepoAlias: "repo1 branch1",
KernelBranch: "branch1",
KernelCommit: "1111111111111111111111111111111111111111",
KernelCommitTitle: build.KernelCommitTitle,
Expand All @@ -62,9 +63,11 @@ func TestReportBug(t *testing.T) {
ReportLink: externalLink(c.ctx, textCrashReport, dbCrash.Report),
CrashID: rep.CrashID,
NumCrashes: 1,
HappenedOn: []string{"repo1/branch1"},
HappenedOn: []string{"repo1 branch1"},
}
if diff := cmp.Diff(want, rep); diff != "" {
t.Fatal(diff)
}
c.expectEQ(rep, want)

// Since we did not update bug status yet, should get the same report again.
c.expectEQ(c.client.pollBug(), want)
Expand All @@ -85,7 +88,9 @@ func TestReportBug(t *testing.T) {
want.ReproSyzLink = externalLink(c.ctx, textReproSyz, dbCrash.ReproSyz)
want.LogLink = externalLink(c.ctx, textCrashLog, dbCrash.Log)
want.ReportLink = externalLink(c.ctx, textCrashReport, dbCrash.Report)
c.expectEQ(rep1, want)
if diff := cmp.Diff(want, rep1); diff != "" {
t.Fatal(diff)
}

reply, _ := c.client.ReportingUpdate(&dashapi.BugUpdate{
ID: rep.ID,
Expand Down Expand Up @@ -119,7 +124,9 @@ func TestReportBug(t *testing.T) {
want.First = true
want.Config = []byte(`{"Index":2}`)
want.NumCrashes = 3
c.expectEQ(rep2, want)
if diff := cmp.Diff(want, rep2); diff != "" {
t.Fatal(diff)
}

// Check that that we can't upstream the bug in the final reporting.
reply, _ = c.client.ReportingUpdate(&dashapi.BugUpdate{
Expand Down Expand Up @@ -190,7 +197,7 @@ func TestInvalidBug(t *testing.T) {
Title: "title1 (2)",
CompilerID: "compiler1",
KernelRepo: "repo1",
KernelRepoAlias: "repo1/branch1",
KernelRepoAlias: "repo1 branch1",
KernelBranch: "branch1",
KernelCommit: "1111111111111111111111111111111111111111",
KernelCommitTitle: build.KernelCommitTitle,
Expand All @@ -205,9 +212,11 @@ func TestInvalidBug(t *testing.T) {
ReproCLink: externalLink(c.ctx, textReproC, dbCrash.ReproC),
CrashID: rep.CrashID,
NumCrashes: 1,
HappenedOn: []string{"repo1/branch1"},
HappenedOn: []string{"repo1 branch1"},
}
if diff := cmp.Diff(want, rep); diff != "" {
t.Fatal(diff)
}
c.expectEQ(rep, want)
c.client.ReportFailedRepro(testCrashID(crash1))
}

Expand Down

0 comments on commit ffd18c6

Please sign in to comment.