diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2019-08-13 14:11:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-13 14:11:21 +0200 |
| commit | 74d61399c29bb1e38da47fa7fd02a80f06639f7f (patch) | |
| tree | 2ba70a0de1fca01803f1f4af9448ee89037286fb | |
| parent | 8620c2c2581732b54045bd75ae1220982fbb650f (diff) | |
dashboard: allow to view bugs happened on a particular manager (#1331)
As a result all bugs from the ci2-upstream-usb instance can be viewed here:
https://syzkaller.appspot.com/upstream?manager=ci2-upstream-usb
| -rw-r--r-- | dashboard/app/entities.go | 2 | ||||
| -rw-r--r-- | dashboard/app/index.yaml | 11 | ||||
| -rw-r--r-- | dashboard/app/main.go | 38 |
3 files changed, 37 insertions, 14 deletions
diff --git a/dashboard/app/entities.go b/dashboard/app/entities.go index c6d26c476..0d368a953 100644 --- a/dashboard/app/entities.go +++ b/dashboard/app/entities.go @@ -89,7 +89,7 @@ type Bug struct { Reporting []BugReporting Commits []string // titles of fixing commmits CommitInfo []Commit // additional info for commits (for historical reasons parallel array to Commits) - HappenedOn []string `datastore:",noindex"` // list of managers + HappenedOn []string // list of managers PatchedOn []string `datastore:",noindex"` // list of managers UNCC []string // don't CC these emails on this bug } diff --git a/dashboard/app/index.yaml b/dashboard/app/index.yaml index 3b38b3fc6..7100bcea9 100644 --- a/dashboard/app/index.yaml +++ b/dashboard/app/index.yaml @@ -18,6 +18,17 @@ indexes: - kind: Bug properties: - name: Namespace + - name: HappenedOn + +- kind: Bug + properties: + - name: Namespace + - name: Status + - name: HappenedOn + +- kind: Bug + properties: + - name: Namespace - name: Title - name: Seq direction: desc diff --git a/dashboard/app/main.go b/dashboard/app/main.go index cc73a88a8..55d077660 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -211,15 +211,20 @@ func handleMain(c context.Context, w http.ResponseWriter, r *http.Request) error if err != nil { return err } - groups, fixedCount, err := fetchNamespaceBugs(c, accessLevel, hdr.Namespace) + manager := r.FormValue("manager") + groups, fixedCount, err := fetchNamespaceBugs(c, accessLevel, hdr.Namespace, manager) if err != nil { return err } + fixedLink := fmt.Sprintf("/%v/fixed", hdr.Namespace) + if manager != "" { + fixedLink = fmt.Sprintf("%v?manager=%v", fixedLink, manager) + } data := &uiMainPage{ Header: hdr, Now: timeNow(c), FixedCount: fixedCount, - FixedLink: fmt.Sprintf("/%v/fixed", hdr.Namespace), + FixedLink: fixedLink, Groups: groups, Managers: managers, } @@ -258,7 +263,8 @@ func handleTerminalBugList(c context.Context, w http.ResponseWriter, r *http.Req return err } hdr.Subpage = typ.Subpage - bugs, err := fetchTerminalBugs(c, accessLevel, hdr.Namespace, typ) + manager := r.FormValue("manager") + bugs, err := fetchTerminalBugs(c, accessLevel, hdr.Namespace, manager, typ) if err != nil { return err } @@ -490,12 +496,15 @@ func textFilename(tag string) string { } } -func fetchNamespaceBugs(c context.Context, accessLevel AccessLevel, ns string) ([]*uiBugGroup, int, error) { +func fetchNamespaceBugs(c context.Context, accessLevel AccessLevel, + ns, manager string) ([]*uiBugGroup, int, error) { var bugs []*Bug - _, err := db.NewQuery("Bug"). - Filter("Namespace=", ns). - GetAll(c, &bugs) - if err != nil { + query := db.NewQuery("Bug"). + Filter("Namespace=", ns) + if manager != "" { + query = query.Filter("HappenedOn=", manager) + } + if _, err := query.GetAll(c, &bugs); err != nil { return nil, 0, err } state, err := loadReportingState(c) @@ -581,13 +590,16 @@ func fetchNamespaceBugs(c context.Context, accessLevel AccessLevel, ns string) ( return uiGroups, fixedCount, nil } -func fetchTerminalBugs(c context.Context, accessLevel AccessLevel, ns string, typ *TerminalBug) (*uiBugGroup, error) { +func fetchTerminalBugs(c context.Context, accessLevel AccessLevel, + ns, manager string, typ *TerminalBug) (*uiBugGroup, error) { var bugs []*Bug - _, err := db.NewQuery("Bug"). + query := db.NewQuery("Bug"). Filter("Namespace=", ns). - Filter("Status=", typ.Status). - GetAll(c, &bugs) - if err != nil { + Filter("Status=", typ.Status) + if manager != "" { + query = query.Filter("HappenedOn=", manager) + } + if _, err := query.GetAll(c, &bugs); err != nil { return nil, err } state, err := loadReportingState(c) |
