commit dafe2435106c71c9888655cd4a761f4d2871acb4
parent f678360098c1a21300193d9d22688008f0dfd324
Author: Russ Cox <rsc@golang.org>
Date: Wed, 5 Oct 2016 22:54:35 -0400
issuedb: ignore pull requests, fix milestone corner case in dashboard
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/issuedb/dash.go b/issuedb/dash.go
@@ -62,7 +62,9 @@ func dashActions() ([]action, int) {
case "issue":
actions = append(actions, action{h.Time, opCreate, h.Issue, ""})
case "milestone?", "milestoned":
- actions = append(actions, action{h.Time, opMilestone, h.Issue, h.Text})
+ if h.Text != "" {
+ actions = append(actions, action{h.Time, opMilestone, h.Issue, h.Text})
+ }
case "demilestoned":
actions = append(actions, action{h.Time, opDemilestone, h.Issue, h.Text})
case "close?", "closed":
@@ -162,6 +164,9 @@ func plotRelease(actions []action, maxIssue int, release string) {
}
switch issue.milestone {
case "":
+ if time == "2016-10-05" {
+ println("NONE", id)
+ }
numNone++
case release:
numRelease++
diff --git a/issuedb/main.go b/issuedb/main.go
@@ -467,7 +467,8 @@ type ghIssue struct {
Milestone struct {
Title string `json:"title"`
} `json:"milestone"`
- State string `json:"state"`
+ State string `json:"state"`
+ PullRequest *struct{} `json:"pull_request"`
}
func refill() {
@@ -578,6 +579,9 @@ func refill() {
h.Time = ev.CreatedAt // best we can do
h.Who = ev.User.Login
h.Action = "issue"
+ if ev.PullRequest != nil {
+ h.Action = "pullrequest"
+ }
h.Text = ev.Body
if err := storage.Insert(tx, &h); err != nil {
log.Fatal(err)