maintner: increase test coverage for github.go and maintner.go

This change set increases the coverage around Event parsing and handling in github.go.

Fixes golang/go#30122

Change-Id: Id0349be892ba14820bdbe2132ed4acd092902f84
GitHub-Last-Rev: cc57f3d07334ffacfb9715cc5f31f29eb56e586f
GitHub-Pull-Request: golang/build#16
Reviewed-on: https://go-review.googlesource.com/c/build/+/157437
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/maintner/github.go b/maintner/github.go
index 3a2c006..8283a20 100644
--- a/maintner/github.go
+++ b/maintner/github.go
@@ -1498,6 +1498,7 @@
 		gr:            gr,
 		githubDirect:  github.NewClient(&http.Client{Transport: directTransport}),
 		githubCaching: github.NewClient(&http.Client{Transport: cachingTransport}),
+		client:        http.DefaultClient,
 	}
 	activityCh := gr.github.c.activityChan("github:" + gr.id.String())
 	var expectChanges bool // got webhook update, but haven't seen new data yet
@@ -1545,6 +1546,10 @@
 	}
 }
 
+type httpClient interface {
+	Do(req *http.Request) (*http.Response, error)
+}
+
 // A githubRepoPoller updates the Corpus (gr.c) to have the latest
 // version of the GitHub repo rp, using the GitHub client ghc.
 type githubRepoPoller struct {
@@ -1554,6 +1559,7 @@
 	lastUpdate    time.Time // modified by sync
 	githubCaching *github.Client
 	githubDirect  *github.Client // not caching
+	client        httpClient     // the client used to poll github
 }
 
 func (p *githubRepoPoller) Owner() string { return p.gr.id.Owner }
@@ -2065,7 +2071,7 @@
 			ctx, cancel := context.WithTimeout(ctx, time.Minute)
 			defer cancel()
 			req = req.WithContext(ctx)
-			res, err := http.DefaultClient.Do(req)
+			res, err := p.client.Do(req)
 			if err != nil {
 				log.Printf("Fetching %s: %v", u, err)
 				return nil, nil, err
@@ -2077,6 +2083,7 @@
 				log.Printf("GitHub error %s: %v", u, ghResp)
 				return nil, nil, err
 			}
+
 			evts, err := parseGithubEvents(res.Body)
 			if err != nil {
 				return nil, nil, fmt.Errorf("%s: parse github events: %v", u, err)
diff --git a/maintner/github_test.go b/maintner/github_test.go
index de5c3cb..8639942 100644
--- a/maintner/github_test.go
+++ b/maintner/github_test.go
@@ -5,14 +5,22 @@
 package maintner
 
 import (
+	"bytes"
+	"context"
 	"fmt"
+	"io/ioutil"
+	"net/http"
+	"net/http/httptest"
+	"path/filepath"
 	"reflect"
+	"sort"
 	"strings"
 	"testing"
 	"time"
 
 	"github.com/golang/protobuf/ptypes"
 	"github.com/golang/protobuf/ptypes/timestamp"
+	"github.com/google/go-github/github"
 
 	"golang.org/x/build/maintner/maintpb"
 )
@@ -517,6 +525,220 @@
 	t.Logf("Tested event types: %q", eventTypes)
 }
 
+func TestParseMultipleGithubEvents(t *testing.T) {
+	content, err := ioutil.ReadFile(filepath.Join("testdata", "TestParseMultipleGithubEvents.json"))
+	if err != nil {
+		t.Errorf("error while loading testdata: %s\n", err.Error())
+	}
+	evts, err := parseGithubEvents(strings.NewReader(string(content)))
+	if err != nil {
+		t.Errorf("error was not expected: %s\n", err.Error())
+	}
+	if len(evts) != 7 {
+		t.Errorf("there should have been three events. was: %d\n", len(evts))
+	}
+	lastEvent := evts[len(evts)-1]
+	if lastEvent.Type != "closed" {
+		t.Errorf("the last event's type should have been closed. was: %s\n", lastEvent.Type)
+	}
+}
+
+func TestParseMultipleGithubEventsWithForeach(t *testing.T) {
+	issue := &GitHubIssue{
+		PullRequest: true,
+		events: map[int64]*GitHubIssueEvent{
+			0: &GitHubIssueEvent{
+				Type: "labelled",
+			},
+			1: &GitHubIssueEvent{
+				Type: "milestone",
+			},
+			2: &GitHubIssueEvent{
+				Type: "closed",
+			},
+		},
+	}
+	eventTypes := []string{"closed", "labelled", "milestone"}
+	gatheredTypes := make([]string, 0)
+	issue.ForeachEvent(func(e *GitHubIssueEvent) error {
+		gatheredTypes = append(gatheredTypes, e.Type)
+		return nil
+	})
+	sort.Strings(gatheredTypes)
+	if !reflect.DeepEqual(eventTypes, gatheredTypes) {
+		t.Fatalf("want event types: %v; got: %v\n", eventTypes, gatheredTypes)
+	}
+}
+
+type ClientMock struct {
+	err        error
+	status     string
+	statusCode int
+	testdata   string
+}
+
+var timesDoWasCalled = 0
+
+func (c *ClientMock) Do(req *http.Request) (*http.Response, error) {
+	if len(c.testdata) < 1 {
+		c.testdata = "TestParseMultipleGithubEvents.json"
+	}
+	timesDoWasCalled++
+	content, _ := ioutil.ReadFile(filepath.Join("testdata", c.testdata))
+	headers := make(http.Header, 0)
+	t := time.Now()
+	var b []byte
+	headers["Date"] = []string{string(t.AppendFormat(b, "Mon Jan _2 15:04:05 2006"))}
+	return &http.Response{
+		Body:       ioutil.NopCloser(bytes.NewReader(content)),
+		Status:     c.status,
+		StatusCode: c.statusCode,
+		Header:     headers,
+	}, c.err
+}
+
+type MockLogger struct {
+}
+
+var eventLog = make([]string, 0)
+
+func (m *MockLogger) Log(mut *maintpb.Mutation) error {
+	for _, e := range mut.GithubIssue.Event {
+		eventLog = append(eventLog, e.EventType)
+	}
+	return nil
+}
+
+func TestSyncEvents(t *testing.T) {
+	var c Corpus
+	c.initGithub()
+	c.mutationLogger = &MockLogger{}
+	gr := c.github.getOrCreateRepo("foowner", "bar")
+	issue := &GitHubIssue{
+		ID:          1001,
+		PullRequest: true,
+		events:      map[int64]*GitHubIssueEvent{},
+	}
+	gr.issues = map[int32]*GitHubIssue{
+		1001: issue,
+	}
+	server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
+		rw.Write([]byte("OK"))
+	}))
+	defer server.Close()
+	p := &githubRepoPoller{
+		c:             &c,
+		token:         "foobar",
+		gr:            gr,
+		githubDirect:  github.NewClient(server.Client()),
+		githubCaching: github.NewClient(server.Client()),
+	}
+	t.Run("successful sync", func(t2 *testing.T) {
+		defer func() { eventLog = make([]string, 0) }()
+		timesDoWasCalled = 0
+		ctx := context.Background()
+		p.client = &ClientMock{
+			status:     "OK",
+			statusCode: http.StatusOK,
+			err:        nil,
+			testdata:   "TestParseMultipleGithubEvents.json",
+		}
+		err := p.syncEventsOnIssue(ctx, int32(issue.ID))
+		if err != nil {
+			t2.Error(err)
+		}
+		want := []string{"labeled", "labeled", "labeled", "labeled", "labeled", "milestoned", "closed"}
+		if !reflect.DeepEqual(want, eventLog) {
+			t2.Errorf("want: %v; got: %v\n", want, eventLog)
+		}
+
+		wantTimesCalled := 1
+		if timesDoWasCalled != wantTimesCalled {
+			t.Errorf("client.Do should have been called %d times. got: %d\n", wantTimesCalled, timesDoWasCalled)
+		}
+	})
+	t.Run("successful sync missing milestones", func(t2 *testing.T) {
+		defer func() { eventLog = make([]string, 0) }()
+		timesDoWasCalled = 0
+		ctx := context.Background()
+		p.client = &ClientMock{
+			status:     "OK",
+			statusCode: http.StatusOK,
+			err:        nil,
+			testdata:   "TestMissingMilestoneEvents.json",
+		}
+		err := p.syncEventsOnIssue(ctx, int32(issue.ID))
+		if err != nil {
+			t2.Error(err)
+		}
+		want := []string{"mentioned", "subscribed", "mentioned", "subscribed", "assigned", "labeled", "labeled", "milestoned", "renamed", "demilestoned", "milestoned"}
+		sort.Strings(want)
+		sort.Strings(eventLog)
+		if !reflect.DeepEqual(want, eventLog) {
+			t2.Errorf("want: %v; got: %v\n", want, eventLog)
+		}
+
+		wantTimesCalled := 1
+		if timesDoWasCalled != wantTimesCalled {
+			t.Errorf("client.Do should have been called %d times. got: %d\n", wantTimesCalled, timesDoWasCalled)
+		}
+	})
+}
+
+func TestSyncMultipleConsecutiveEvents(t *testing.T) {
+	var c Corpus
+	c.initGithub()
+	c.mutationLogger = &MockLogger{}
+	gr := c.github.getOrCreateRepo("foowner", "bar")
+	issue := &GitHubIssue{
+		ID:          1001,
+		PullRequest: true,
+		events:      map[int64]*GitHubIssueEvent{},
+	}
+	gr.issues = map[int32]*GitHubIssue{
+		1001: issue,
+	}
+	server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
+		rw.Write([]byte("OK"))
+	}))
+	defer server.Close()
+	p := &githubRepoPoller{
+		c:             &c,
+		token:         "foobar",
+		gr:            gr,
+		githubDirect:  github.NewClient(server.Client()),
+		githubCaching: github.NewClient(server.Client()),
+	}
+	t.Run("successful sync", func(t2 *testing.T) {
+		defer func() { eventLog = make([]string, 0) }()
+		timesDoWasCalled = 0
+		ctx := context.Background()
+		for i := 1; i < 5; i++ {
+			testdata := fmt.Sprintf("TestParseMultipleGithubEvents_p%d.json", i)
+			p.client = &ClientMock{
+				status:     "OK",
+				statusCode: http.StatusOK,
+				err:        nil,
+				testdata:   testdata,
+			}
+			err := p.syncEventsOnIssue(ctx, int32(issue.ID))
+			if err != nil {
+				t2.Fatal(err)
+			}
+		}
+
+		want := []string{"labeled", "labeled", "labeled", "labeled", "labeled", "milestoned", "closed"}
+		if !reflect.DeepEqual(want, eventLog) {
+			t2.Errorf("want: %v; got: %v\n", want, eventLog)
+		}
+
+		wantTimesCalled := 4
+		if timesDoWasCalled != wantTimesCalled {
+			t.Errorf("client.Do should have been called %d times. got: %d\n", wantTimesCalled, timesDoWasCalled)
+		}
+	})
+}
+
 func TestParseGitHubReviews(t *testing.T) {
 	tests := []struct {
 		name string                // test
diff --git a/maintner/maintner_test.go b/maintner/maintner_test.go
index d51c441..94c485c 100644
--- a/maintner/maintner_test.go
+++ b/maintner/maintner_test.go
@@ -5,6 +5,7 @@
 package maintner
 
 import (
+	"context"
 	"errors"
 	"fmt"
 	"reflect"
@@ -211,6 +212,44 @@
 	}
 }
 
+func TestSync(t *testing.T) {
+	c := new(Corpus)
+	assignees := []*GitHubUser{u1, u2}
+	issue := &GitHubIssue{
+		Number:    3,
+		User:      u1,
+		Body:      "some body",
+		Created:   t2,
+		Updated:   t2,
+		Assignees: assignees,
+	}
+	gr := &GitHubRepo{
+		id: GitHubRepoID{"golang", "go"},
+		issues: map[int32]*GitHubIssue{
+			3: issue,
+		},
+	}
+	c.github = &GitHub{
+		users: map[int64]*GitHubUser{
+			u1.ID: u1,
+		},
+		repos: map[GitHubRepoID]*GitHubRepo{
+			GitHubRepoID{"golang", "go"}: gr,
+		},
+	}
+
+	mutation := gr.newMutationFromIssue(issue, &github.Issue{
+		Number:    github.Int(3),
+		Assignees: []*github.User{&github.User{ID: github.Int64(u2.ID)}},
+	})
+	c.addMutation(mutation)
+	ctx := context.Background()
+	err := c.sync(ctx, false)
+	if err != nil {
+		t.Fatal("error: ", err)
+	}
+}
+
 func DeepDiff(got, want interface{}) error {
 	return diffPath(reflect.ValueOf(got), reflect.ValueOf(want))
 }
diff --git a/maintner/testdata/TestMissingMilestoneEvents.json b/maintner/testdata/TestMissingMilestoneEvents.json
new file mode 100644
index 0000000..392382e
--- /dev/null
+++ b/maintner/testdata/TestMissingMilestoneEvents.json
@@ -0,0 +1,382 @@
+[
+    {
+      "id": 1918052007,
+      "node_id": "MDE0Ok1lbnRpb25lZEV2ZW50MTkxODA1MjAwNw==",
+      "url": "https://api.github.com/repos/golang/go/issues/events/1918052007",
+      "actor": {
+        "login": "robpike",
+        "id": 4324516,
+        "node_id": "MDQ6VXNlcjQzMjQ1MTY=",
+        "avatar_url": "https://avatars0.githubusercontent.com/u/4324516?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/robpike",
+        "html_url": "https://github.com/robpike",
+        "followers_url": "https://api.github.com/users/robpike/followers",
+        "following_url": "https://api.github.com/users/robpike/following{/other_user}",
+        "gists_url": "https://api.github.com/users/robpike/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/robpike/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/robpike/subscriptions",
+        "organizations_url": "https://api.github.com/users/robpike/orgs",
+        "repos_url": "https://api.github.com/users/robpike/repos",
+        "events_url": "https://api.github.com/users/robpike/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/robpike/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "mentioned",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-10-22T17:20:31Z"
+    },
+    {
+      "id": 1918052009,
+      "node_id": "MDE1OlN1YnNjcmliZWRFdmVudDE5MTgwNTIwMDk=",
+      "url": "https://api.github.com/repos/golang/go/issues/events/1918052009",
+      "actor": {
+        "login": "robpike",
+        "id": 4324516,
+        "node_id": "MDQ6VXNlcjQzMjQ1MTY=",
+        "avatar_url": "https://avatars0.githubusercontent.com/u/4324516?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/robpike",
+        "html_url": "https://github.com/robpike",
+        "followers_url": "https://api.github.com/users/robpike/followers",
+        "following_url": "https://api.github.com/users/robpike/following{/other_user}",
+        "gists_url": "https://api.github.com/users/robpike/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/robpike/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/robpike/subscriptions",
+        "organizations_url": "https://api.github.com/users/robpike/orgs",
+        "repos_url": "https://api.github.com/users/robpike/repos",
+        "events_url": "https://api.github.com/users/robpike/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/robpike/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "subscribed",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-10-22T17:20:31Z"
+    },
+    {
+      "id": 1918747291,
+      "node_id": "MDE0Ok1lbnRpb25lZEV2ZW50MTkxODc0NzI5MQ==",
+      "url": "https://api.github.com/repos/golang/go/issues/events/1918747291",
+      "actor": {
+        "login": "rsc",
+        "id": 104030,
+        "node_id": "MDQ6VXNlcjEwNDAzMA==",
+        "avatar_url": "https://avatars1.githubusercontent.com/u/104030?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/rsc",
+        "html_url": "https://github.com/rsc",
+        "followers_url": "https://api.github.com/users/rsc/followers",
+        "following_url": "https://api.github.com/users/rsc/following{/other_user}",
+        "gists_url": "https://api.github.com/users/rsc/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/rsc/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/rsc/subscriptions",
+        "organizations_url": "https://api.github.com/users/rsc/orgs",
+        "repos_url": "https://api.github.com/users/rsc/repos",
+        "events_url": "https://api.github.com/users/rsc/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/rsc/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "mentioned",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-10-22T22:25:24Z"
+    },
+    {
+      "id": 1918747292,
+      "node_id": "MDE1OlN1YnNjcmliZWRFdmVudDE5MTg3NDcyOTI=",
+      "url": "https://api.github.com/repos/golang/go/issues/events/1918747292",
+      "actor": {
+        "login": "rsc",
+        "id": 104030,
+        "node_id": "MDQ6VXNlcjEwNDAzMA==",
+        "avatar_url": "https://avatars1.githubusercontent.com/u/104030?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/rsc",
+        "html_url": "https://github.com/rsc",
+        "followers_url": "https://api.github.com/users/rsc/followers",
+        "following_url": "https://api.github.com/users/rsc/following{/other_user}",
+        "gists_url": "https://api.github.com/users/rsc/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/rsc/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/rsc/subscriptions",
+        "organizations_url": "https://api.github.com/users/rsc/orgs",
+        "repos_url": "https://api.github.com/users/rsc/repos",
+        "events_url": "https://api.github.com/users/rsc/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/rsc/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "subscribed",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-10-22T22:25:24Z"
+    },
+    {
+      "id": 1921453627,
+      "node_id": "MDEzOkFzc2lnbmVkRXZlbnQxOTIxNDUzNjI3",
+      "url": "https://api.github.com/repos/golang/go/issues/events/1921453627",
+      "actor": {
+        "login": "rsc",
+        "id": 104030,
+        "node_id": "MDQ6VXNlcjEwNDAzMA==",
+        "avatar_url": "https://avatars1.githubusercontent.com/u/104030?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/rsc",
+        "html_url": "https://github.com/rsc",
+        "followers_url": "https://api.github.com/users/rsc/followers",
+        "following_url": "https://api.github.com/users/rsc/following{/other_user}",
+        "gists_url": "https://api.github.com/users/rsc/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/rsc/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/rsc/subscriptions",
+        "organizations_url": "https://api.github.com/users/rsc/orgs",
+        "repos_url": "https://api.github.com/users/rsc/repos",
+        "events_url": "https://api.github.com/users/rsc/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/rsc/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "assigned",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-10-23T19:06:48Z",
+      "assignee": {
+        "login": "rsc",
+        "id": 104030,
+        "node_id": "MDQ6VXNlcjEwNDAzMA==",
+        "avatar_url": "https://avatars1.githubusercontent.com/u/104030?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/rsc",
+        "html_url": "https://github.com/rsc",
+        "followers_url": "https://api.github.com/users/rsc/followers",
+        "following_url": "https://api.github.com/users/rsc/following{/other_user}",
+        "gists_url": "https://api.github.com/users/rsc/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/rsc/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/rsc/subscriptions",
+        "organizations_url": "https://api.github.com/users/rsc/orgs",
+        "repos_url": "https://api.github.com/users/rsc/repos",
+        "events_url": "https://api.github.com/users/rsc/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/rsc/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "assigner": {
+        "login": "bcmills",
+        "id": 5200974,
+        "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+        "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/bcmills",
+        "html_url": "https://github.com/bcmills",
+        "followers_url": "https://api.github.com/users/bcmills/followers",
+        "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+        "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+        "organizations_url": "https://api.github.com/users/bcmills/orgs",
+        "repos_url": "https://api.github.com/users/bcmills/repos",
+        "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/bcmills/received_events",
+        "type": "User",
+        "site_admin": false
+      }
+    },
+    {
+      "id": 1921456957,
+      "node_id": "MDEyOkxhYmVsZWRFdmVudDE5MjE0NTY5NTc=",
+      "url": "https://api.github.com/repos/golang/go/issues/events/1921456957",
+      "actor": {
+        "login": "bcmills",
+        "id": 5200974,
+        "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+        "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/bcmills",
+        "html_url": "https://github.com/bcmills",
+        "followers_url": "https://api.github.com/users/bcmills/followers",
+        "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+        "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+        "organizations_url": "https://api.github.com/users/bcmills/orgs",
+        "repos_url": "https://api.github.com/users/bcmills/repos",
+        "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/bcmills/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "labeled",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-10-23T19:08:20Z",
+      "label": {
+        "name": "Documentation",
+        "color": "aaffaa"
+      }
+    },
+    {
+      "id": 1921457078,
+      "node_id": "MDEyOkxhYmVsZWRFdmVudDE5MjE0NTcwNzg=",
+      "url": "https://api.github.com/repos/golang/go/issues/events/1921457078",
+      "actor": {
+        "login": "bcmills",
+        "id": 5200974,
+        "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+        "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/bcmills",
+        "html_url": "https://github.com/bcmills",
+        "followers_url": "https://api.github.com/users/bcmills/followers",
+        "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+        "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+        "organizations_url": "https://api.github.com/users/bcmills/orgs",
+        "repos_url": "https://api.github.com/users/bcmills/repos",
+        "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/bcmills/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "labeled",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-10-23T19:08:24Z",
+      "label": {
+        "name": "NeedsInvestigation",
+        "color": "ededed"
+      }
+    },
+    {
+      "id": 1921457176,
+      "node_id": "MDE1Ok1pbGVzdG9uZWRFdmVudDE5MjE0NTcxNzY=",
+      "url": "https://api.github.com/repos/golang/go/issues/events/1921457176",
+      "actor": {
+        "login": "bcmills",
+        "id": 5200974,
+        "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+        "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/bcmills",
+        "html_url": "https://github.com/bcmills",
+        "followers_url": "https://api.github.com/users/bcmills/followers",
+        "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+        "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+        "organizations_url": "https://api.github.com/users/bcmills/orgs",
+        "repos_url": "https://api.github.com/users/bcmills/repos",
+        "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/bcmills/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "milestoned",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-10-23T19:08:26Z",
+      "milestone": {
+        "title": "Go1.12"
+      }
+    },
+    {
+      "id": 2019875816,
+      "node_id": "MDE3OlJlbmFtZWRUaXRsZUV2ZW50MjAxOTg3NTgxNg==",
+      "url": "https://api.github.com/repos/golang/go/issues/events/2019875816",
+      "actor": {
+        "login": "ianlancetaylor",
+        "id": 3194333,
+        "node_id": "MDQ6VXNlcjMxOTQzMzM=",
+        "avatar_url": "https://avatars2.githubusercontent.com/u/3194333?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/ianlancetaylor",
+        "html_url": "https://github.com/ianlancetaylor",
+        "followers_url": "https://api.github.com/users/ianlancetaylor/followers",
+        "following_url": "https://api.github.com/users/ianlancetaylor/following{/other_user}",
+        "gists_url": "https://api.github.com/users/ianlancetaylor/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/ianlancetaylor/subscriptions",
+        "organizations_url": "https://api.github.com/users/ianlancetaylor/orgs",
+        "repos_url": "https://api.github.com/users/ianlancetaylor/repos",
+        "events_url": "https://api.github.com/users/ianlancetaylor/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/ianlancetaylor/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "renamed",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-12-11T21:09:35Z",
+      "rename": {
+        "from": "doc/go_mem.html: \"threads\" should read \"goroutines\"",
+        "to": "doc: in Go memory model \"threads\" should read \"goroutines\""
+      }
+    },
+    {
+      "id": 2019875996,
+      "node_id": "MDE3OkRlbWlsZXN0b25lZEV2ZW50MjAxOTg3NTk5Ng==",
+      "url": "https://api.github.com/repos/golang/go/issues/events/2019875996",
+      "actor": {
+        "login": "ianlancetaylor",
+        "id": 3194333,
+        "node_id": "MDQ6VXNlcjMxOTQzMzM=",
+        "avatar_url": "https://avatars2.githubusercontent.com/u/3194333?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/ianlancetaylor",
+        "html_url": "https://github.com/ianlancetaylor",
+        "followers_url": "https://api.github.com/users/ianlancetaylor/followers",
+        "following_url": "https://api.github.com/users/ianlancetaylor/following{/other_user}",
+        "gists_url": "https://api.github.com/users/ianlancetaylor/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/ianlancetaylor/subscriptions",
+        "organizations_url": "https://api.github.com/users/ianlancetaylor/orgs",
+        "repos_url": "https://api.github.com/users/ianlancetaylor/repos",
+        "events_url": "https://api.github.com/users/ianlancetaylor/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/ianlancetaylor/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "demilestoned",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-12-11T21:09:39Z",
+      "milestone": {
+        "title": "Go1.12"
+      }
+    },
+    {
+      "id": 2019875998,
+      "node_id": "MDE1Ok1pbGVzdG9uZWRFdmVudDIwMTk4NzU5OTg=",
+      "url": "https://api.github.com/repos/golang/go/issues/events/2019875998",
+      "actor": {
+        "login": "ianlancetaylor",
+        "id": 3194333,
+        "node_id": "MDQ6VXNlcjMxOTQzMzM=",
+        "avatar_url": "https://avatars2.githubusercontent.com/u/3194333?v=4",
+        "gravatar_id": "",
+        "url": "https://api.github.com/users/ianlancetaylor",
+        "html_url": "https://github.com/ianlancetaylor",
+        "followers_url": "https://api.github.com/users/ianlancetaylor/followers",
+        "following_url": "https://api.github.com/users/ianlancetaylor/following{/other_user}",
+        "gists_url": "https://api.github.com/users/ianlancetaylor/gists{/gist_id}",
+        "starred_url": "https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}",
+        "subscriptions_url": "https://api.github.com/users/ianlancetaylor/subscriptions",
+        "organizations_url": "https://api.github.com/users/ianlancetaylor/orgs",
+        "repos_url": "https://api.github.com/users/ianlancetaylor/repos",
+        "events_url": "https://api.github.com/users/ianlancetaylor/events{/privacy}",
+        "received_events_url": "https://api.github.com/users/ianlancetaylor/received_events",
+        "type": "User",
+        "site_admin": false
+      },
+      "event": "milestoned",
+      "commit_id": null,
+      "commit_url": null,
+      "created_at": "2018-12-11T21:09:39Z",
+      "milestone": {
+        "title": "Unplanned"
+      }
+    }
+  ]
\ No newline at end of file
diff --git a/maintner/testdata/TestParseMultipleGithubEvents.json b/maintner/testdata/TestParseMultipleGithubEvents.json
new file mode 100644
index 0000000..4904dd8
--- /dev/null
+++ b/maintner/testdata/TestParseMultipleGithubEvents.json
@@ -0,0 +1,226 @@
+[{
+    "id": 1943301510,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTA=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301510",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "Testing",
+    "color": "aaffaa"
+    }
+},
+{
+    "id": 1943301512,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTI=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301512",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "help wanted",
+    "color": "fbca04"
+    }
+},
+{
+    "id": 1943301514,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTQ=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301514",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "OS-OpenBSD",
+    "color": "ededed"
+    }
+},
+{
+    "id": 1943301515,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTU=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301515",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "Builders",
+    "color": "ededed"
+    }
+},
+{
+    "id": 1943301516,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTY=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301516",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "NeedsInvestigation",
+    "color": "ededed"
+    }
+},
+{
+    "id": 1943301518,
+    "node_id": "MDE1Ok1pbGVzdG9uZWRFdmVudDE5NDMzMDE1MTg=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301518",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "milestoned",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "milestone": {
+    "title": "Go1.12"
+    }
+},
+{
+    "id": 1943494698,
+    "node_id": "MDExOkNsb3NlZEV2ZW50MTk0MzQ5NDY5OA==",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943494698",
+    "actor": {
+    "login": "ianlancetaylor",
+    "id": 3194333,
+    "node_id": "MDQ6VXNlcjMxOTQzMzM=",
+    "avatar_url": "https://avatars2.githubusercontent.com/u/3194333?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/ianlancetaylor",
+    "html_url": "https://github.com/ianlancetaylor",
+    "followers_url": "https://api.github.com/users/ianlancetaylor/followers",
+    "following_url": "https://api.github.com/users/ianlancetaylor/following{/other_user}",
+    "gists_url": "https://api.github.com/users/ianlancetaylor/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/ianlancetaylor/subscriptions",
+    "organizations_url": "https://api.github.com/users/ianlancetaylor/orgs",
+    "repos_url": "https://api.github.com/users/ianlancetaylor/repos",
+    "events_url": "https://api.github.com/users/ianlancetaylor/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/ianlancetaylor/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "closed",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T17:27:53Z"
+}]
\ No newline at end of file
diff --git a/maintner/testdata/TestParseMultipleGithubEvents_p1.json b/maintner/testdata/TestParseMultipleGithubEvents_p1.json
new file mode 100644
index 0000000..d3a5507
--- /dev/null
+++ b/maintner/testdata/TestParseMultipleGithubEvents_p1.json
@@ -0,0 +1,66 @@
+[{
+    "id": 1943301510,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTA=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301510",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "Testing",
+    "color": "aaffaa"
+    }
+},
+{
+    "id": 1943301512,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTI=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301512",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "help wanted",
+    "color": "fbca04"
+    }
+}]
\ No newline at end of file
diff --git a/maintner/testdata/TestParseMultipleGithubEvents_p2.json b/maintner/testdata/TestParseMultipleGithubEvents_p2.json
new file mode 100644
index 0000000..9249be6
--- /dev/null
+++ b/maintner/testdata/TestParseMultipleGithubEvents_p2.json
@@ -0,0 +1,66 @@
+[{
+    "id": 1943301514,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTQ=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301514",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "OS-OpenBSD",
+    "color": "ededed"
+    }
+},
+{
+    "id": 1943301515,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTU=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301515",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "Builders",
+    "color": "ededed"
+    }
+}]
\ No newline at end of file
diff --git a/maintner/testdata/TestParseMultipleGithubEvents_p3.json b/maintner/testdata/TestParseMultipleGithubEvents_p3.json
new file mode 100644
index 0000000..584fdd9
--- /dev/null
+++ b/maintner/testdata/TestParseMultipleGithubEvents_p3.json
@@ -0,0 +1,65 @@
+[{
+    "id": 1943301516,
+    "node_id": "MDEyOkxhYmVsZWRFdmVudDE5NDMzMDE1MTY=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301516",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "labeled",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "label": {
+    "name": "NeedsInvestigation",
+    "color": "ededed"
+    }
+},
+{
+    "id": 1943301518,
+    "node_id": "MDE1Ok1pbGVzdG9uZWRFdmVudDE5NDMzMDE1MTg=",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943301518",
+    "actor": {
+    "login": "bcmills",
+    "id": 5200974,
+    "node_id": "MDQ6VXNlcjUyMDA5NzQ=",
+    "avatar_url": "https://avatars3.githubusercontent.com/u/5200974?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/bcmills",
+    "html_url": "https://github.com/bcmills",
+    "followers_url": "https://api.github.com/users/bcmills/followers",
+    "following_url": "https://api.github.com/users/bcmills/following{/other_user}",
+    "gists_url": "https://api.github.com/users/bcmills/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/bcmills/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/bcmills/subscriptions",
+    "organizations_url": "https://api.github.com/users/bcmills/orgs",
+    "repos_url": "https://api.github.com/users/bcmills/repos",
+    "events_url": "https://api.github.com/users/bcmills/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/bcmills/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "milestoned",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T15:53:59Z",
+    "milestone": {
+    "title": "Go1.12"
+    }
+}]
\ No newline at end of file
diff --git a/maintner/testdata/TestParseMultipleGithubEvents_p4.json b/maintner/testdata/TestParseMultipleGithubEvents_p4.json
new file mode 100644
index 0000000..1cd0894
--- /dev/null
+++ b/maintner/testdata/TestParseMultipleGithubEvents_p4.json
@@ -0,0 +1,29 @@
+[{
+    "id": 1943494698,
+    "node_id": "MDExOkNsb3NlZEV2ZW50MTk0MzQ5NDY5OA==",
+    "url": "https://api.github.com/repos/golang/go/issues/events/1943494698",
+    "actor": {
+    "login": "ianlancetaylor",
+    "id": 3194333,
+    "node_id": "MDQ6VXNlcjMxOTQzMzM=",
+    "avatar_url": "https://avatars2.githubusercontent.com/u/3194333?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/ianlancetaylor",
+    "html_url": "https://github.com/ianlancetaylor",
+    "followers_url": "https://api.github.com/users/ianlancetaylor/followers",
+    "following_url": "https://api.github.com/users/ianlancetaylor/following{/other_user}",
+    "gists_url": "https://api.github.com/users/ianlancetaylor/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/ianlancetaylor/subscriptions",
+    "organizations_url": "https://api.github.com/users/ianlancetaylor/orgs",
+    "repos_url": "https://api.github.com/users/ianlancetaylor/repos",
+    "events_url": "https://api.github.com/users/ianlancetaylor/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/ianlancetaylor/received_events",
+    "type": "User",
+    "site_admin": false
+    },
+    "event": "closed",
+    "commit_id": null,
+    "commit_url": null,
+    "created_at": "2018-11-02T17:27:53Z"
+}]
\ No newline at end of file