{"action":"created","comment":{"url":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/comments/244623050","pull_request_review_id":188541644,"id":244623050,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDYyMzA1MA==","diff_hunk":"@@ -0,0 +1,91 @@\n+package githubpr\n+\n+import (\n+\t\"context\"\n+\t\"log\"\n+\t\"os\"\n+\n+\t\"github.com/google/go-github/github\"\n+\t\"github.com/mongodb/grip/level\"\n+\t\"github.com/mongodb/grip/message\"\n+\t\"github.com/mongodb/grip/send\"\n+\t\"github.com/pkg/errors\"\n+\t\"golang.org/x/oauth2\"\n+)\n+\n+type githubPRLogger struct {\n+\tprService    *github.PullRequestsService\n+\tstatusSender send.Sender\n+\t*send.Base\n+}\n+\n+// NewGithubPRLogger creates a new Sender implementation that\n+// merges a pull request\n+// Specify an OAuth token for GitHub authentication\n+func NewGithubPRLogger(name string, token string, statusSender send.Sender) (send.Sender, error) {\n+\tctx := context.TODO()\n+\tts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})\n+\ttc := oauth2.NewClient(ctx, ts)\n+\tgithubClient := github.NewClient(tc)\n+\ts := &githubPRLogger{\n+\t\tBase:         send.NewBase(name),\n+\t\tprService:    githubClient.GetPullRequests(),\n+\t\tstatusSender: statusSender,\n+\t}\n+\n+\tfallback := log.New(os.Stdout, \"\", log.LstdFlags)\n+\tif err := s.SetErrorHandler(send.ErrorHandlerFromLogger(fallback)); err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\treturn s, nil\n+}\n+\n+func (s *githubPRLogger) Send(m message.Composer) {\n+\tif !s.Level().ShouldLog(m) {\n+\t\treturn\n+\t}\n+\n+\tmsg := m.Raw().(*GithubMergePR)\n+\tmergeOpts := &github.PullRequestOptions{\n+\t\tMergeMethod: string(msg.MergeMethod),\n+\t\tCommitTitle: msg.CommitTitle,\n+\t}\n+\n+\tctx := context.TODO()","path":"model/commitq/githubpr/github_pr_sender.go","position":null,"original_position":55,"commit_id":"719811fde448b6cfe547312997aef49260c9447c","original_commit_id":"5b2fe325dd531510747f26b8a58fd482de426add","user":{"login":"ybrill","id":17027265,"node_id":"MDQ6VXNlcjE3MDI3MjY1","avatar_url":"https://avatars3.githubusercontent.com/u/17027265?v=4","gravatar_id":"","url":"https://api.github.com/users/ybrill","html_url":"https://github.com/ybrill","followers_url":"https://api.github.com/users/ybrill/followers","following_url":"https://api.github.com/users/ybrill/following{/other_user}","gists_url":"https://api.github.com/users/ybrill/gists{/gist_id}","starred_url":"https://api.github.com/users/ybrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybrill/subscriptions","organizations_url":"https://api.github.com/users/ybrill/orgs","repos_url":"https://api.github.com/users/ybrill/repos","events_url":"https://api.github.com/users/ybrill/events{/privacy}","received_events_url":"https://api.github.com/users/ybrill/received_events","type":"User","site_admin":false},"body":"Here changed to context.WithTimeout","created_at":"2018-12-31T23:04:50Z","updated_at":"2018-12-31T23:04:50Z","html_url":"https://github.com/evergreen-ci/evergreen/pull/1899#discussion_r244623050","pull_request_url":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/1899","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/comments/244623050"},"html":{"href":"https://github.com/evergreen-ci/evergreen/pull/1899#discussion_r244623050"},"pull_request":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/1899"}},"in_reply_to_id":244598888},"pull_request":{"url":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/1899","id":241376026,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMzc2MDI2","html_url":"https://github.com/evergreen-ci/evergreen/pull/1899","diff_url":"https://github.com/evergreen-ci/evergreen/pull/1899.diff","patch_url":"https://github.com/evergreen-ci/evergreen/pull/1899.patch","issue_url":"https://api.github.com/repos/evergreen-ci/evergreen/issues/1899","number":1899,"state":"open","locked":false,"title":"EVG-5580: GitHub merge logger","user":{"login":"ybrill","id":17027265,"node_id":"MDQ6VXNlcjE3MDI3MjY1","avatar_url":"https://avatars3.githubusercontent.com/u/17027265?v=4","gravatar_id":"","url":"https://api.github.com/users/ybrill","html_url":"https://github.com/ybrill","followers_url":"https://api.github.com/users/ybrill/followers","following_url":"https://api.github.com/users/ybrill/following{/other_user}","gists_url":"https://api.github.com/users/ybrill/gists{/gist_id}","starred_url":"https://api.github.com/users/ybrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybrill/subscriptions","organizations_url":"https://api.github.com/users/ybrill/orgs","repos_url":"https://api.github.com/users/ybrill/repos","events_url":"https://api.github.com/users/ybrill/events{/privacy}","received_events_url":"https://api.github.com/users/ybrill/received_events","type":"User","site_admin":false},"body":"Creating a message/receiver pair to send the merge command for a PR to GitHub.","created_at":"2018-12-28T18:22:36Z","updated_at":"2018-12-31T23:04:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6ee74f985fb5c3d13d0db3cc231011923d31d41","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/1899/commits","review_comments_url":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/1899/comments","review_comment_url":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/evergreen-ci/evergreen/issues/1899/comments","statuses_url":"https://api.github.com/repos/evergreen-ci/evergreen/statuses/719811fde448b6cfe547312997aef49260c9447c","head":{"label":"ybrill:EVG-5580_Github_Merge_Logger","ref":"EVG-5580_Github_Merge_Logger","sha":"719811fde448b6cfe547312997aef49260c9447c","user":{"login":"ybrill","id":17027265,"node_id":"MDQ6VXNlcjE3MDI3MjY1","avatar_url":"https://avatars3.githubusercontent.com/u/17027265?v=4","gravatar_id":"","url":"https://api.github.com/users/ybrill","html_url":"https://github.com/ybrill","followers_url":"https://api.github.com/users/ybrill/followers","following_url":"https://api.github.com/users/ybrill/following{/other_user}","gists_url":"https://api.github.com/users/ybrill/gists{/gist_id}","starred_url":"https://api.github.com/users/ybrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybrill/subscriptions","organizations_url":"https://api.github.com/users/ybrill/orgs","repos_url":"https://api.github.com/users/ybrill/repos","events_url":"https://api.github.com/users/ybrill/events{/privacy}","received_events_url":"https://api.github.com/users/ybrill/received_events","type":"User","site_admin":false},"repo":{"id":151641054,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE2NDEwNTQ=","name":"evergreen","full_name":"ybrill/evergreen","private":false,"owner":{"login":"ybrill","id":17027265,"node_id":"MDQ6VXNlcjE3MDI3MjY1","avatar_url":"https://avatars3.githubusercontent.com/u/17027265?v=4","gravatar_id":"","url":"https://api.github.com/users/ybrill","html_url":"https://github.com/ybrill","followers_url":"https://api.github.com/users/ybrill/followers","following_url":"https://api.github.com/users/ybrill/following{/other_user}","gists_url":"https://api.github.com/users/ybrill/gists{/gist_id}","starred_url":"https://api.github.com/users/ybrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybrill/subscriptions","organizations_url":"https://api.github.com/users/ybrill/orgs","repos_url":"https://api.github.com/users/ybrill/repos","events_url":"https://api.github.com/users/ybrill/events{/privacy}","received_events_url":"https://api.github.com/users/ybrill/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ybrill/evergreen","description":"A Distributed Continuous Integration System from MongoDB","fork":true,"url":"https://api.github.com/repos/ybrill/evergreen","forks_url":"https://api.github.com/repos/ybrill/evergreen/forks","keys_url":"https://api.github.com/repos/ybrill/evergreen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ybrill/evergreen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ybrill/evergreen/teams","hooks_url":"https://api.github.com/repos/ybrill/evergreen/hooks","issue_events_url":"https://api.github.com/repos/ybrill/evergreen/issues/events{/number}","events_url":"https://api.github.com/repos/ybrill/evergreen/events","assignees_url":"https://api.github.com/repos/ybrill/evergreen/assignees{/user}","branches_url":"https://api.github.com/repos/ybrill/evergreen/branches{/branch}","tags_url":"https://api.github.com/repos/ybrill/evergreen/tags","blobs_url":"https://api.github.com/repos/ybrill/evergreen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ybrill/evergreen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ybrill/evergreen/git/refs{/sha}","trees_url":"https://api.github.com/repos/ybrill/evergreen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ybrill/evergreen/statuses/{sha}","languages_url":"https://api.github.com/repos/ybrill/evergreen/languages","stargazers_url":"https://api.github.com/repos/ybrill/evergreen/stargazers","contributors_url":"https://api.github.com/repos/ybrill/evergreen/contributors","subscribers_url":"https://api.github.com/repos/ybrill/evergreen/subscribers","subscription_url":"https://api.github.com/repos/ybrill/evergreen/subscription","commits_url":"https://api.github.com/repos/ybrill/evergreen/commits{/sha}","git_commits_url":"https://api.github.com/repos/ybrill/evergreen/git/commits{/sha}","comments_url":"https://api.github.com/repos/ybrill/evergreen/comments{/number}","issue_comment_url":"https://api.github.com/repos/ybrill/evergreen/issues/comments{/number}","contents_url":"https://api.github.com/repos/ybrill/evergreen/contents/{+path}","compare_url":"https://api.github.com/repos/ybrill/evergreen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ybrill/evergreen/merges","archive_url":"https://api.github.com/repos/ybrill/evergreen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ybrill/evergreen/downloads","issues_url":"https://api.github.com/repos/ybrill/evergreen/issues{/number}","pulls_url":"https://api.github.com/repos/ybrill/evergreen/pulls{/number}","milestones_url":"https://api.github.com/repos/ybrill/evergreen/milestones{/number}","notifications_url":"https://api.github.com/repos/ybrill/evergreen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ybrill/evergreen/labels{/name}","releases_url":"https://api.github.com/repos/ybrill/evergreen/releases{/id}","deployments_url":"https://api.github.com/repos/ybrill/evergreen/deployments","created_at":"2018-10-04T21:58:36Z","updated_at":"2018-12-05T20:36:30Z","pushed_at":"2018-12-31T22:56:19Z","git_url":"git://github.com/ybrill/evergreen.git","ssh_url":"git@github.com:ybrill/evergreen.git","clone_url":"https://github.com/ybrill/evergreen.git","svn_url":"https://github.com/ybrill/evergreen","homepage":"http://evergreen.mongodb.com","size":70174,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"evergreen-ci:master","ref":"master","sha":"2333e5417e0149837846485c562db69a3d88f152","user":{"login":"evergreen-ci","id":10089490,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDg5NDkw","avatar_url":"https://avatars3.githubusercontent.com/u/10089490?v=4","gravatar_id":"","url":"https://api.github.com/users/evergreen-ci","html_url":"https://github.com/evergreen-ci","followers_url":"https://api.github.com/users/evergreen-ci/followers","following_url":"https://api.github.com/users/evergreen-ci/following{/other_user}","gists_url":"https://api.github.com/users/evergreen-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/evergreen-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evergreen-ci/subscriptions","organizations_url":"https://api.github.com/users/evergreen-ci/orgs","repos_url":"https://api.github.com/users/evergreen-ci/repos","events_url":"https://api.github.com/users/evergreen-ci/events{/privacy}","received_events_url":"https://api.github.com/users/evergreen-ci/received_events","type":"Organization","site_admin":false},"repo":{"id":36385798,"node_id":"MDEwOlJlcG9zaXRvcnkzNjM4NTc5OA==","name":"evergreen","full_name":"evergreen-ci/evergreen","private":false,"owner":{"login":"evergreen-ci","id":10089490,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDg5NDkw","avatar_url":"https://avatars3.githubusercontent.com/u/10089490?v=4","gravatar_id":"","url":"https://api.github.com/users/evergreen-ci","html_url":"https://github.com/evergreen-ci","followers_url":"https://api.github.com/users/evergreen-ci/followers","following_url":"https://api.github.com/users/evergreen-ci/following{/other_user}","gists_url":"https://api.github.com/users/evergreen-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/evergreen-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evergreen-ci/subscriptions","organizations_url":"https://api.github.com/users/evergreen-ci/orgs","repos_url":"https://api.github.com/users/evergreen-ci/repos","events_url":"https://api.github.com/users/evergreen-ci/events{/privacy}","received_events_url":"https://api.github.com/users/evergreen-ci/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/evergreen-ci/evergreen","description":"A Distributed Continuous Integration System from MongoDB","fork":false,"url":"https://api.github.com/repos/evergreen-ci/evergreen","forks_url":"https://api.github.com/repos/evergreen-ci/evergreen/forks","keys_url":"https://api.github.com/repos/evergreen-ci/evergreen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evergreen-ci/evergreen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evergreen-ci/evergreen/teams","hooks_url":"https://api.github.com/repos/evergreen-ci/evergreen/hooks","issue_events_url":"https://api.github.com/repos/evergreen-ci/evergreen/issues/events{/number}","events_url":"https://api.github.com/repos/evergreen-ci/evergreen/events","assignees_url":"https://api.github.com/repos/evergreen-ci/evergreen/assignees{/user}","branches_url":"https://api.github.com/repos/evergreen-ci/evergreen/branches{/branch}","tags_url":"https://api.github.com/repos/evergreen-ci/evergreen/tags","blobs_url":"https://api.github.com/repos/evergreen-ci/evergreen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evergreen-ci/evergreen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evergreen-ci/evergreen/git/refs{/sha}","trees_url":"https://api.github.com/repos/evergreen-ci/evergreen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evergreen-ci/evergreen/statuses/{sha}","languages_url":"https://api.github.com/repos/evergreen-ci/evergreen/languages","stargazers_url":"https://api.github.com/repos/evergreen-ci/evergreen/stargazers","contributors_url":"https://api.github.com/repos/evergreen-ci/evergreen/contributors","subscribers_url":"https://api.github.com/repos/evergreen-ci/evergreen/subscribers","subscription_url":"https://api.github.com/repos/evergreen-ci/evergreen/subscription","commits_url":"https://api.github.com/repos/evergreen-ci/evergreen/commits{/sha}","git_commits_url":"https://api.github.com/repos/evergreen-ci/evergreen/git/commits{/sha}","comments_url":"https://api.github.com/repos/evergreen-ci/evergreen/comments{/number}","issue_comment_url":"https://api.github.com/repos/evergreen-ci/evergreen/issues/comments{/number}","contents_url":"https://api.github.com/repos/evergreen-ci/evergreen/contents/{+path}","compare_url":"https://api.github.com/repos/evergreen-ci/evergreen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evergreen-ci/evergreen/merges","archive_url":"https://api.github.com/repos/evergreen-ci/evergreen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evergreen-ci/evergreen/downloads","issues_url":"https://api.github.com/repos/evergreen-ci/evergreen/issues{/number}","pulls_url":"https://api.github.com/repos/evergreen-ci/evergreen/pulls{/number}","milestones_url":"https://api.github.com/repos/evergreen-ci/evergreen/milestones{/number}","notifications_url":"https://api.github.com/repos/evergreen-ci/evergreen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evergreen-ci/evergreen/labels{/name}","releases_url":"https://api.github.com/repos/evergreen-ci/evergreen/releases{/id}","deployments_url":"https://api.github.com/repos/evergreen-ci/evergreen/deployments","created_at":"2015-05-27T18:03:09Z","updated_at":"2018-12-31T20:14:02Z","pushed_at":"2018-12-31T22:56:20Z","git_url":"git://github.com/evergreen-ci/evergreen.git","ssh_url":"git@github.com:evergreen-ci/evergreen.git","clone_url":"https://github.com/evergreen-ci/evergreen.git","svn_url":"https://github.com/evergreen-ci/evergreen","homepage":"http://evergreen.mongodb.com","size":70145,"stargazers_count":188,"watchers_count":188,"language":"Go","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":58,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":58,"open_issues":6,"watchers":188,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/1899"},"html":{"href":"https://github.com/evergreen-ci/evergreen/pull/1899"},"issue":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/issues/1899"},"comments":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/issues/1899/comments"},"review_comments":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/1899/comments"},"review_comment":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/pulls/1899/commits"},"statuses":{"href":"https://api.github.com/repos/evergreen-ci/evergreen/statuses/719811fde448b6cfe547312997aef49260c9447c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ybrill"}}