Skip to content

Commit 722ac32

Browse files
committed
dashboard: fix manuallyUpstreamed
The function returned incorrect result when the reporting stage of interest was completely skipped and never reported.
1 parent 5757a3d commit 722ac32

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

dashboard/app/app_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,12 @@ var testConfig = &GlobalConfig{
650650
DailyLimit: 1000,
651651
Config: &TestConfig{Index: 1},
652652
Embargo: 4 * 24 * time.Hour,
653+
Filter: func(bug *Bug) FilterResult {
654+
if bug.Title == "skip reporting1" {
655+
return FilterSkip
656+
}
657+
return FilterReport
658+
},
653659
},
654660
{
655661
Name: "reporting2",

dashboard/app/reporting.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ func (bug *Bug) manuallyUpstreamed(name string) bool {
392392
if reporting == nil {
393393
return false
394394
}
395+
if reporting.Reported.IsZero() {
396+
// Either not reported yet, or fully skipped (if Closed is not empty).
397+
return false
398+
}
395399
return !reporting.Closed.IsZero() && !reporting.Auto
396400
}
397401

dashboard/app/reporting_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,4 +1466,16 @@ func TestSkipStage(t *testing.T) {
14661466
client.pollNotifs(0)
14671467
client.pollBugs(0)
14681468
}
1469+
1470+
{
1471+
// Don't react to skipped reporting stages.
1472+
crash := testCrash(build, 4)
1473+
crash.Title = "skip reporting1"
1474+
client.ReportCrash(crash)
1475+
rep := client.pollBug()
1476+
c.expectEQ(string(rep.Config), `{"Index":2}`)
1477+
// If we do react, there would be an upstreaming notification.
1478+
client.pollNotifs(0)
1479+
c.client.updateBug(rep.ID, dashapi.BugStatusInvalid, "")
1480+
}
14691481
}

0 commit comments

Comments
 (0)