From 73aba437a774237b1130837b856f3b40b3ec3bf0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 22 Dec 2017 19:59:56 +0100 Subject: dashboard/app: bump max repros per bug to 10 We badly need repros. Developers complain. --- dashboard/app/api.go | 4 +++- dashboard/app/app_test.go | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dashboard/app/api.go b/dashboard/app/api.go index 5a0d3cdf3..44e5d6ce3 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -51,6 +51,8 @@ type JSONHandler func(c context.Context, r *http.Request) (interface{}, error) type APIHandler func(c context.Context, r *http.Request) (interface{}, error) type APINamespaceHandler func(c context.Context, ns string, r *http.Request) (interface{}, error) +const maxReproPerBug = 10 + // Overridable for testing. var timeNow = func(c context.Context) time.Time { return time.Now() @@ -747,7 +749,7 @@ func needRepro(c context.Context, bug *Bug) bool { func needReproForBug(bug *Bug) bool { return bug.ReproLevel < ReproLevelC && - bug.NumRepro < 5 && + bug.NumRepro < maxReproPerBug && len(bug.Commits) == 0 && bug.Title != corruptedReportTitle } diff --git a/dashboard/app/app_test.go b/dashboard/app/app_test.go index e30cc92d4..990247a02 100644 --- a/dashboard/app/app_test.go +++ b/dashboard/app/app_test.go @@ -283,7 +283,7 @@ func testNeedRepro3(t *testing.T, crashCtor func(c *Ctx) *dashapi.Crash) { cid := testCrashID(crash1) needReproResp := new(dashapi.NeedReproResp) - for i := 0; i < 5; i++ { + for i := 0; i < maxReproPerBug; i++ { c.expectOK(c.API(client1, key1, "report_crash", crash1, resp)) c.expectEQ(resp.NeedRepro, true) @@ -317,7 +317,7 @@ func testNeedRepro4(t *testing.T, crashCtor func(c *Ctx) *dashapi.Crash) { cid := testCrashID(crash1) needReproResp := new(dashapi.NeedReproResp) - for i := 0; i < 4; i++ { + for i := 0; i < maxReproPerBug-1; i++ { c.expectOK(c.API(client1, key1, "report_crash", crash1, resp)) c.expectEQ(resp.NeedRepro, true) @@ -348,7 +348,7 @@ func testNeedRepro5(t *testing.T, crashCtor func(c *Ctx) *dashapi.Crash) { cid := testCrashID(crash1) needReproResp := new(dashapi.NeedReproResp) - for i := 0; i < 4; i++ { + for i := 0; i < maxReproPerBug-1; i++ { c.expectOK(c.API(client1, key1, "report_crash", crash1, resp)) c.expectEQ(resp.NeedRepro, true) -- cgit mrf-deployment