aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-07-12 15:34:46 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-07-13 08:20:02 +0000
commitbfb20202da73451f997b711447ee68bc3635868e (patch)
treee8fbdbd6a8761a6a73711301deb655572749c70e
parent860811962461dbc8d8fb3af4fd7f65cf50857661 (diff)
dashboard: always return full UserSpaceArch
Currently we return an empty value for amd64, so that it's not reported. Let's make the API more flexible -- return the value as is and let specific reporters decide whether to mention amd64 or not.
-rw-r--r--dashboard/app/reporting.go2
-rw-r--r--dashboard/app/reporting_email.go5
-rw-r--r--dashboard/app/reporting_test.go2
3 files changed, 7 insertions, 2 deletions
diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go
index 071d67339..e29d2da16 100644
--- a/dashboard/app/reporting.go
+++ b/dashboard/app/reporting.go
@@ -1569,8 +1569,6 @@ func kernelArch(arch string) string {
switch arch {
case targets.I386:
return "i386"
- case targets.AMD64:
- return "" // this is kinda the default, so we don't notify about it
default:
return arch
}
diff --git a/dashboard/app/reporting_email.go b/dashboard/app/reporting_email.go
index 35f104d71..071def054 100644
--- a/dashboard/app/reporting_email.go
+++ b/dashboard/app/reporting_email.go
@@ -22,6 +22,7 @@ import (
"github.com/google/syzkaller/pkg/email"
"github.com/google/syzkaller/pkg/email/lore"
"github.com/google/syzkaller/pkg/html"
+ "github.com/google/syzkaller/sys/targets"
"golang.org/x/net/context"
"google.golang.org/appengine/v2"
db "google.golang.org/appengine/v2/datastore"
@@ -331,6 +332,10 @@ func emailReport(c context.Context, rep *dashapi.BugReport) error {
if err := json.Unmarshal(rep.Config, cfg); err != nil {
return fmt.Errorf("failed to unmarshal email config: %v", err)
}
+ if rep.UserSpaceArch == targets.AMD64 {
+ // This is default, so don't include the info.
+ rep.UserSpaceArch = ""
+ }
templ := ""
switch rep.Type {
case dashapi.ReportNew, dashapi.ReportRepro:
diff --git a/dashboard/app/reporting_test.go b/dashboard/app/reporting_test.go
index 26ce564cd..166faf55c 100644
--- a/dashboard/app/reporting_test.go
+++ b/dashboard/app/reporting_test.go
@@ -55,6 +55,7 @@ func TestReportBug(t *testing.T) {
OS: targets.Linux,
Arch: targets.AMD64,
VMArch: targets.AMD64,
+ UserSpaceArch: targets.AMD64,
First: true,
Moderation: true,
Title: "title1",
@@ -228,6 +229,7 @@ func TestInvalidBug(t *testing.T) {
OS: targets.Linux,
Arch: targets.AMD64,
VMArch: targets.AMD64,
+ UserSpaceArch: targets.AMD64,
First: true,
Moderation: true,
Title: "title1 (2)",