Commit 482ceeda authored by David Symonds's avatar David Symonds

misc/dashboard/codereview: interpret zero reviewers as the CL being closed.

This is the state when the CL has been submitted by someone other than
the CL author, but before the CL author has synched their client.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6458044
parent dd166b94
...@@ -295,6 +295,7 @@ func updateCL(c appengine.Context, n string) error { ...@@ -295,6 +295,7 @@ func updateCL(c appengine.Context, n string) error {
var apiResp struct { var apiResp struct {
Description string `json:"description"` Description string `json:"description"`
Reviewers []string `json:"reviewers"`
Created string `json:"created"` Created string `json:"created"`
OwnerEmail string `json:"owner_email"` OwnerEmail string `json:"owner_email"`
Modified string `json:"modified"` Modified string `json:"modified"`
...@@ -334,6 +335,13 @@ func updateCL(c appengine.Context, n string) error { ...@@ -334,6 +335,13 @@ func updateCL(c appengine.Context, n string) error {
if i := strings.Index(cl.FirstLine, "\n"); i >= 0 { if i := strings.Index(cl.FirstLine, "\n"); i >= 0 {
cl.FirstLine = cl.FirstLine[:i] cl.FirstLine = cl.FirstLine[:i]
} }
// Treat zero reviewers as a signal that the CL is completed.
// This could be after the CL has been submitted, but before the CL author has synced,
// but it could also be a CL manually edited to remove reviewers.
if len(apiResp.Reviewers) == 0 {
cl.Closed = true
}
lgtm := make(map[string]bool) lgtm := make(map[string]bool)
notLGTM := make(map[string]bool) notLGTM := make(map[string]bool)
rcpt := make(map[string]bool) rcpt := make(map[string]bool)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment