aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-07-11 12:23:24 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-07-22 09:10:35 +0000
commitcc2c251549aa339bba0fefed38dba52a1cde5e3a (patch)
tree01e9c0f3de1c49949d58f49850453dcf8540ca96 /dashboard
parente88f2331e7b7b97da8f178078031064a8c57a34f (diff)
dashboard: specify the types of LogToRepro replies
Diffstat (limited to 'dashboard')
-rw-r--r--dashboard/app/api.go2
-rw-r--r--dashboard/app/repro_test.go2
-rw-r--r--dashboard/dashapi/dashapi.go8
3 files changed, 12 insertions, 0 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go
index 65e28a23c..a1667a2cc 100644
--- a/dashboard/app/api.go
+++ b/dashboard/app/api.go
@@ -1748,6 +1748,7 @@ func apiLogToReproduce(c context.Context, ns string, r *http.Request, payload []
if log != nil {
return &dashapi.LogToReproResp{
CrashLog: log,
+ Type: dashapi.ManualLog,
}, nil
}
@@ -1806,6 +1807,7 @@ func logToReproForBug(c context.Context, bug *Bug, manager string) (*dashapi.Log
return &dashapi.LogToReproResp{
Title: bug.Title,
CrashLog: crashLog,
+ Type: dashapi.RetryReproLog,
}, nil
}
return nil, nil
diff --git a/dashboard/app/repro_test.go b/dashboard/app/repro_test.go
index 51b9d1049..1b2aadb9d 100644
--- a/dashboard/app/repro_test.go
+++ b/dashboard/app/repro_test.go
@@ -437,6 +437,7 @@ func TestLogToReproduce(t *testing.T) {
c.expectOK(err)
c.expectEQ(resp.Title, "title2")
c.expectEQ(resp.CrashLog, []byte("log2"))
+ c.expectEQ(resp.Type, dashapi.RetryReproLog)
// Suppose we tried to find a repro, but failed.
err = client.ReportFailedRepro(&dashapi.CrashID{
@@ -507,6 +508,7 @@ func TestReproTask(t *testing.T) {
resp, err := client.LogToRepro(&dashapi.LogToReproReq{BuildID: build.ID})
c.expectOK(err)
c.expectEQ(string(resp.CrashLog), reproValue)
+ c.expectEQ(resp.Type, dashapi.ManualLog)
}
// But no more.
diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go
index 871f096ab..4cad5aa87 100644
--- a/dashboard/dashapi/dashapi.go
+++ b/dashboard/dashapi/dashapi.go
@@ -380,9 +380,17 @@ type LogToReproReq struct {
BuildID string
}
+type LogToReproType string
+
+const (
+ ManualLog LogToReproType = "manual"
+ RetryReproLog LogToReproType = "retry"
+)
+
type LogToReproResp struct {
Title string
CrashLog []byte
+ Type LogToReproType
}
// LogToRepro are crash logs for older bugs that need to be reproduced on the