diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-04-03 10:36:02 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-04-03 12:19:04 +0200 |
| commit | 888ff08c4a1b7a937b0ebe65ddcb275b05aea4c1 (patch) | |
| tree | 74f7a021e555d27b53396bbfc768dc777ebb65ac | |
| parent | d04ac3a54895a36998e3f1da27c2ce33f7a80c5a (diff) | |
dashboard: display the correct bug number in subsystem reports
Fixes #3775.
| -rw-r--r-- | dashboard/app/reporting_lists.go | 17 | ||||
| -rw-r--r-- | dashboard/app/subsystem_test.go | 4 |
2 files changed, 13 insertions, 8 deletions
diff --git a/dashboard/app/reporting_lists.go b/dashboard/app/reporting_lists.go index 93d9d27dc..a82598d16 100644 --- a/dashboard/app/reporting_lists.go +++ b/dashboard/app/reporting_lists.go @@ -236,16 +236,14 @@ func findSubsystemReportByID(c context.Context, ID string) (*Subsystem, // querySubsystemReport queries the open bugs and constructs a new SubsystemReport object. func querySubsystemReport(c context.Context, subsystem *Subsystem, reporting *Reporting, config *BugListReportingConfig) (*SubsystemReport, error) { - rawOpenBugs, fixedBugs, err := queryMatchingBugs(c, subsystem.Namespace, subsystem.Name) + rawOpenBugs, fixedBugs, err := queryMatchingBugs(c, subsystem.Namespace, + subsystem.Name, reporting.AccessLevel) if err != nil { return nil, err } withRepro, noRepro := []*Bug{}, []*Bug{} for _, bug := range rawOpenBugs { - currReporting, _, _, _, err := currentReporting(c, bug) - if err != nil { - return nil, fmt.Errorf("failed to query current reporting: %w", err) - } + currReporting, _, _, _, _ := currentReporting(c, bug) if reporting.Name != currReporting.Name { // The big is not at the expected reporting stage. continue @@ -325,7 +323,7 @@ func makeSubsystemReportStats(c context.Context, open, fixed []*Bug, days int) S } } -func queryMatchingBugs(c context.Context, ns, name string) ([]*Bug, []*Bug, error) { +func queryMatchingBugs(c context.Context, ns, name string, accessLevel AccessLevel) ([]*Bug, []*Bug, error) { allOpenBugs, _, err := loadAllBugs(c, func(query *db.Query) *db.Query { return query.Filter("Namespace=", ns). Filter("Status=", BugStatusOpen). @@ -349,6 +347,13 @@ func queryMatchingBugs(c context.Context, ns, name string) ([]*Bug, []*Bug, erro fixed = append(fixed, bug) continue } + currReporting, _, _, _, err := currentReporting(c, bug) + if err != nil { + continue + } + if currReporting.AccessLevel > accessLevel { + continue + } open = append(open, bug) } return open, fixed, nil diff --git a/dashboard/app/subsystem_test.go b/dashboard/app/subsystem_test.go index 65897b1c9..2ce3980d7 100644 --- a/dashboard/app/subsystem_test.go +++ b/dashboard/app/subsystem_test.go @@ -297,8 +297,8 @@ This is a 30-day syzbot report for the subsystemA subsystem. All related reports/information can be found at: https://testapp.appspot.com/subsystem-reminders/s/subsystemA -During the period, 3 new issues were detected and 0 were fixed. -In total, 3 issues are still open. +During the period, 2 new issues were detected and 0 were fixed. +In total, 2 issues are still open. Some of the still happening issues: |
