diff options
author | David Symonds <dsymonds@golang.org> | 2012-07-30 13:51:21 +1000 |
---|---|---|
committer | David Symonds <dsymonds@golang.org> | 2012-07-30 13:51:21 +1000 |
commit | 9e98bd4eff3cee22780096c3b79909400c96e0a0 (patch) | |
tree | 89e3f7494f88d55cfba3f7355a07da4c102f547d /misc/dashboard | |
parent | 38cf7c5ac012d9b4a4de2882a67e5fef9003165a (diff) | |
download | go-9e98bd4eff3cee22780096c3b79909400c96e0a0.tar.gz |
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
http://codereview.appspot.com/6458044
Diffstat (limited to 'misc/dashboard')
-rw-r--r-- | misc/dashboard/codereview/dashboard/cl.go | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/misc/dashboard/codereview/dashboard/cl.go b/misc/dashboard/codereview/dashboard/cl.go index 1b05e8ffd..a53a28628 100644 --- a/misc/dashboard/codereview/dashboard/cl.go +++ b/misc/dashboard/codereview/dashboard/cl.go @@ -294,12 +294,13 @@ func updateCL(c appengine.Context, n string) error { } var apiResp struct { - Description string `json:"description"` - Created string `json:"created"` - OwnerEmail string `json:"owner_email"` - Modified string `json:"modified"` - Closed bool `json:"closed"` - Subject string `json:"subject"` + Description string `json:"description"` + Reviewers []string `json:"reviewers"` + Created string `json:"created"` + OwnerEmail string `json:"owner_email"` + Modified string `json:"modified"` + Closed bool `json:"closed"` + Subject string `json:"subject"` Messages []struct { Text string `json:"text"` Sender string `json:"sender"` @@ -334,6 +335,13 @@ func updateCL(c appengine.Context, n string) error { if i := strings.Index(cl.FirstLine, "\n"); i >= 0 { 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) notLGTM := make(map[string]bool) rcpt := make(map[string]bool) |