{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/64471925","id":64471925,"diff_hunk":"@@ -927,110 +933,138 @@ func (sq *SubmitQueue) handleGithubE2EAndMerge() {\n \t\t\tcontinue\n \t\t}\n \n-\t\tsq.Lock()\n-\t\tif len(sq.githubE2EQueue) == 0 {\n-\t\t\tsq.Unlock()\n+\t\tobj := sq.selectPullRequest()\n+\t\tif obj == nil {\n \t\t\tcontinue\n \t\t}\n-\t\tkeys := sq.orderedE2EQueue()\n-\t\tobj := sq.githubE2EQueue[keys[0]]\n-\t\tsq.githubE2ERunning = obj\n-\t\tsq.Unlock()\n \n \t\t// re-test and maybe merge\n-\t\tsq.doGithubE2EAndMerge(obj)\n+\t\tif sq.doGithubE2EAndMerge(obj) {\n+\t\t\t// remove it from the map after we finish testing\n+\t\t\tsq.Lock()\n+\t\t\tsq.githubE2ERunning = nil\n+\t\t\tdelete(sq.githubE2EQueue, *obj.Issue.Number)\n+\t\t\tsq.Unlock()\n+\t\t}\n+\t}\n+}\n \n-\t\t// remove it from the map after we finish testing\n-\t\tsq.Lock()\n-\t\tsq.githubE2ERunning = nil\n-\t\tdelete(sq.githubE2EQueue, keys[0])\n-\t\tsq.Unlock()\n+func (sq *SubmitQueue) mergePullRequest(obj *github.MungeObject) {\n+\tobj.MergePR(\"submit-queue\")\n+\tsq.updateMergeRate()\n+\tsq.SetMergeStatus(obj, merged)\n+}\n+\n+func (sq *SubmitQueue) reportFailedPullRequest(obj *github.MungeObject, err string) {\n+\tsq.SetMergeStatus(obj, err)\n+}\n+\n+func (sq *SubmitQueue) selectPullRequest() *github.MungeObject {\n+\tif sq.interruptedObj != nil {\n+\t\treturn sq.interruptedObj.obj\n+\t}\n+\tsq.Lock()\n+\tdefer sq.Unlock()\n+\tif len(sq.githubE2EQueue) == 0 {\n+\t\treturn nil\n+\t}\n+\tkeys := sq.orderedE2EQueue()\n+\tobj := sq.githubE2EQueue[keys[0]]\n+\tsq.githubE2ERunning = obj\n+\n+\treturn obj\n+}\n+\n+func (interruptedObj *submitQueueInterruptedObject) hasSHAChanged() bool {\n+\theadSHA, baseRef, gotHeadSHA := interruptedObj.obj.GetHeadAndBase()\n+\tif !gotHeadSHA {\n+\t\treturn true\n+\t}\n+\n+\tbaseSHA, gotBaseSHA := interruptedObj.obj.GetSHAFromRef(baseRef)\n+\tif !gotBaseSHA {\n+\t\treturn true\n+\t}\n+\n+\treturn interruptedObj.interruptedMergeBaseSHA != baseSHA ||\n+\t\tinterruptedObj.interruptedMergeHeadSHA != headSHA\n+}\n+\n+func newInterruptedObject(obj *github.MungeObject) *submitQueueInterruptedObject {\n+\tif headSHA, baseRef, gotHeadSHA := obj.GetHeadAndBase(); !gotHeadSHA {\n+\t\treturn nil\n+\t} else if baseSHA, gotBaseSHA := obj.GetSHAFromRef(baseRef); !gotBaseSHA {\n+\t\treturn nil\n+\t} else {\n+\t\treturn &submitQueueInterruptedObject{obj, headSHA, baseSHA}\n \t}\n }\n \n-func (sq *SubmitQueue) doGithubE2EAndMerge(obj *github.MungeObject) {\n+func (sq *SubmitQueue) doGithubE2EAndMerge(obj *github.MungeObject) bool {","path":"mungegithub/mungers/submit-queue.go","position":115,"original_position":115,"commit_id":"6c227900a238cff65468fb58fa3bfb63719f24f0","original_commit_id":"6c227900a238cff65468fb58fa3bfb63719f24f0","user":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},"body":"+1","created_at":"2016-05-24T20:53:03Z","updated_at":"2016-05-24T20:53:03Z","html_url":"https://github.com/kubernetes/contrib/pull/1044#discussion_r64471925","pull_request_url":"https://api.github.com/repos/kubernetes/contrib/pulls/1044","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/64471925"},"html":{"href":"https://github.com/kubernetes/contrib/pull/1044#discussion_r64471925"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/1044"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/1044","id":71138263,"html_url":"https://github.com/kubernetes/contrib/pull/1044","diff_url":"https://github.com/kubernetes/contrib/pull/1044.diff","patch_url":"https://github.com/kubernetes/contrib/pull/1044.patch","issue_url":"https://api.github.com/repos/kubernetes/contrib/issues/1044","number":1044,"state":"open","locked":false,"title":"Keep test pr on top redo","user":{"login":"apelisse","id":1929644,"avatar_url":"https://avatars.githubusercontent.com/u/1929644?v=3","gravatar_id":"","url":"https://api.github.com/users/apelisse","html_url":"https://github.com/apelisse","followers_url":"https://api.github.com/users/apelisse/followers","following_url":"https://api.github.com/users/apelisse/following{/other_user}","gists_url":"https://api.github.com/users/apelisse/gists{/gist_id}","starred_url":"https://api.github.com/users/apelisse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apelisse/subscriptions","organizations_url":"https://api.github.com/users/apelisse/orgs","repos_url":"https://api.github.com/users/apelisse/repos","events_url":"https://api.github.com/users/apelisse/events{/privacy}","received_events_url":"https://api.github.com/users/apelisse/received_events","type":"User","site_admin":false},"body":"Try to fix #1016 ","created_at":"2016-05-23T23:47:48Z","updated_at":"2016-05-24T20:53:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"942ee67bbba84b1693936ba23ff34f96903f795b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/contrib/pulls/1044/commits","review_comments_url":"https://api.github.com/repos/kubernetes/contrib/pulls/1044/comments","review_comment_url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/contrib/issues/1044/comments","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/6c227900a238cff65468fb58fa3bfb63719f24f0","head":{"label":"apelisse:keep-test-pr-on-top-redo","ref":"keep-test-pr-on-top-redo","sha":"6c227900a238cff65468fb58fa3bfb63719f24f0","user":{"login":"apelisse","id":1929644,"avatar_url":"https://avatars.githubusercontent.com/u/1929644?v=3","gravatar_id":"","url":"https://api.github.com/users/apelisse","html_url":"https://github.com/apelisse","followers_url":"https://api.github.com/users/apelisse/followers","following_url":"https://api.github.com/users/apelisse/following{/other_user}","gists_url":"https://api.github.com/users/apelisse/gists{/gist_id}","starred_url":"https://api.github.com/users/apelisse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apelisse/subscriptions","organizations_url":"https://api.github.com/users/apelisse/orgs","repos_url":"https://api.github.com/users/apelisse/repos","events_url":"https://api.github.com/users/apelisse/events{/privacy}","received_events_url":"https://api.github.com/users/apelisse/received_events","type":"User","site_admin":false},"repo":{"id":58003482,"name":"contrib","full_name":"apelisse/contrib","owner":{"login":"apelisse","id":1929644,"avatar_url":"https://avatars.githubusercontent.com/u/1929644?v=3","gravatar_id":"","url":"https://api.github.com/users/apelisse","html_url":"https://github.com/apelisse","followers_url":"https://api.github.com/users/apelisse/followers","following_url":"https://api.github.com/users/apelisse/following{/other_user}","gists_url":"https://api.github.com/users/apelisse/gists{/gist_id}","starred_url":"https://api.github.com/users/apelisse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apelisse/subscriptions","organizations_url":"https://api.github.com/users/apelisse/orgs","repos_url":"https://api.github.com/users/apelisse/repos","events_url":"https://api.github.com/users/apelisse/events{/privacy}","received_events_url":"https://api.github.com/users/apelisse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apelisse/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core.","fork":true,"url":"https://api.github.com/repos/apelisse/contrib","forks_url":"https://api.github.com/repos/apelisse/contrib/forks","keys_url":"https://api.github.com/repos/apelisse/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apelisse/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apelisse/contrib/teams","hooks_url":"https://api.github.com/repos/apelisse/contrib/hooks","issue_events_url":"https://api.github.com/repos/apelisse/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/apelisse/contrib/events","assignees_url":"https://api.github.com/repos/apelisse/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/apelisse/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/apelisse/contrib/tags","blobs_url":"https://api.github.com/repos/apelisse/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apelisse/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apelisse/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/apelisse/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apelisse/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/apelisse/contrib/languages","stargazers_url":"https://api.github.com/repos/apelisse/contrib/stargazers","contributors_url":"https://api.github.com/repos/apelisse/contrib/contributors","subscribers_url":"https://api.github.com/repos/apelisse/contrib/subscribers","subscription_url":"https://api.github.com/repos/apelisse/contrib/subscription","commits_url":"https://api.github.com/repos/apelisse/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/apelisse/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/apelisse/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/apelisse/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/apelisse/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/apelisse/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apelisse/contrib/merges","archive_url":"https://api.github.com/repos/apelisse/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apelisse/contrib/downloads","issues_url":"https://api.github.com/repos/apelisse/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/apelisse/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/apelisse/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/apelisse/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apelisse/contrib/labels{/name}","releases_url":"https://api.github.com/repos/apelisse/contrib/releases{/id}","deployments_url":"https://api.github.com/repos/apelisse/contrib/deployments","created_at":"2016-05-03T21:43:44Z","updated_at":"2016-05-03T21:43:47Z","pushed_at":"2016-05-23T23:46:09Z","git_url":"git://github.com/apelisse/contrib.git","ssh_url":"git@github.com:apelisse/contrib.git","clone_url":"https://github.com/apelisse/contrib.git","svn_url":"https://github.com/apelisse/contrib","homepage":"","size":27153,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"f0b178c2440f1ee9c110562afb91fdade50a1337","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":40686014,"name":"contrib","full_name":"kubernetes/contrib","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core. Consider creating a new repo instead.","fork":false,"url":"https://api.github.com/repos/kubernetes/contrib","forks_url":"https://api.github.com/repos/kubernetes/contrib/forks","keys_url":"https://api.github.com/repos/kubernetes/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/contrib/teams","hooks_url":"https://api.github.com/repos/kubernetes/contrib/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/contrib/events","assignees_url":"https://api.github.com/repos/kubernetes/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/contrib/tags","blobs_url":"https://api.github.com/repos/kubernetes/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/contrib/languages","stargazers_url":"https://api.github.com/repos/kubernetes/contrib/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/contrib/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/contrib/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/contrib/subscription","commits_url":"https://api.github.com/repos/kubernetes/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/contrib/merges","archive_url":"https://api.github.com/repos/kubernetes/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/contrib/downloads","issues_url":"https://api.github.com/repos/kubernetes/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/contrib/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/contrib/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/contrib/deployments","created_at":"2015-08-13T23:18:26Z","updated_at":"2016-05-24T15:36:26Z","pushed_at":"2016-05-24T20:41:41Z","git_url":"git://github.com/kubernetes/contrib.git","ssh_url":"git@github.com:kubernetes/contrib.git","clone_url":"https://github.com/kubernetes/contrib.git","svn_url":"https://github.com/kubernetes/contrib","homepage":"","size":49563,"stargazers_count":293,"watchers_count":293,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":276,"mirror_url":null,"open_issues_count":244,"forks":276,"open_issues":244,"watchers":293,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/1044"},"html":{"href":"https://github.com/kubernetes/contrib/pull/1044"},"issue":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/1044"},"comments":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/1044/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/1044/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/1044/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/contrib/statuses/6c227900a238cff65468fb58fa3bfb63719f24f0"}}}}
{"actor":{"display_login":"lavalamp"}}