{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/comments/62021404","id":62021404,"diff_hunk":"@@ -115,23 +120,40 @@ public boolean apply(GitHubPRCause cause) {\n     /**\n      * Cancel previous builds for specified PR id.\n      */\n-    private static boolean cancelQueuedBuildByPrNumber(final int id) {\n+    protected int cancelQueuedBuildByPrNumber(final int id) {\n         Queue queue = getJenkinsInstance().getQueue();\n+        //todo replace with stream?\n+        int canceled = 0;\n+        for (Queue.Item item : queue.getItems()) {\n+            if (!(item.task instanceof Job)) {\n+                LOGGER.debug(\"Item {} not instanceof job\", item);\n+                continue;\n+            }\n+\n+            final Job<?, ?> jobTask = (Job<?, ?>) item.task;\n+            if (!jobTask.getDisplayName().equals(job.getDisplayName())) {","path":"github-pullrequest-plugin/src/main/java/org/jenkinsci/plugins/github/pullrequest/trigger/JobRunnerForCause.java","position":32,"original_position":32,"commit_id":"f3925fdc50f0fb32a502f61aab5a478c67cd856a","original_commit_id":"f3925fdc50f0fb32a502f61aab5a478c67cd856a","user":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"body":"but item task implements only displayName... though i already switched to it.... may be branch not pushed 0_o","created_at":"2016-05-04T11:02:16Z","updated_at":"2016-05-04T11:02:16Z","html_url":"https://github.com/jenkinsci/github-integration-plugin/pull/82#discussion_r62021404","pull_request_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/comments/62021404"},"html":{"href":"https://github.com/jenkinsci/github-integration-plugin/pull/82#discussion_r62021404"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/82","id":68566964,"html_url":"https://github.com/jenkinsci/github-integration-plugin/pull/82","diff_url":"https://github.com/jenkinsci/github-integration-plugin/pull/82.diff","patch_url":"https://github.com/jenkinsci/github-integration-plugin/pull/82.patch","issue_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues/82","number":82,"state":"open","locked":false,"title":" Fix cancelQueued","user":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"body":"for  #81\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/jenkinsci/github-integration-plugin/82)\n<!-- Reviewable:end -->\n","created_at":"2016-05-02T14:26:08Z","updated_at":"2016-05-04T11:02:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc141fd446fa667ed7f2796d1eb4becc9d52cb21","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/82/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/82/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues/82/comments","statuses_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/statuses/f3925fdc50f0fb32a502f61aab5a478c67cd856a","head":{"label":"jenkinsci:cancelQueued","ref":"cancelQueued","sha":"f3925fdc50f0fb32a502f61aab5a478c67cd856a","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":35024150,"name":"github-integration-plugin","full_name":"jenkinsci/github-integration-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/github-integration-plugin","description":"GitHub Integration Plugin","fork":true,"url":"https://api.github.com/repos/jenkinsci/github-integration-plugin","forks_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/deployments","created_at":"2015-05-04T08:47:38Z","updated_at":"2016-04-04T16:16:53Z","pushed_at":"2016-05-04T10:48:31Z","git_url":"git://github.com/jenkinsci/github-integration-plugin.git","ssh_url":"git@github.com:jenkinsci/github-integration-plugin.git","clone_url":"https://github.com/jenkinsci/github-integration-plugin.git","svn_url":"https://github.com/jenkinsci/github-integration-plugin","homepage":"https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Integration+Plugin","size":686,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":15,"forks":9,"open_issues":15,"watchers":10,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"9b58147db5c7356068bcb03c342a4b012048562a","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":35024150,"name":"github-integration-plugin","full_name":"jenkinsci/github-integration-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/github-integration-plugin","description":"GitHub Integration Plugin","fork":true,"url":"https://api.github.com/repos/jenkinsci/github-integration-plugin","forks_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/github-integration-plugin/deployments","created_at":"2015-05-04T08:47:38Z","updated_at":"2016-04-04T16:16:53Z","pushed_at":"2016-05-04T10:48:31Z","git_url":"git://github.com/jenkinsci/github-integration-plugin.git","ssh_url":"git@github.com:jenkinsci/github-integration-plugin.git","clone_url":"https://github.com/jenkinsci/github-integration-plugin.git","svn_url":"https://github.com/jenkinsci/github-integration-plugin","homepage":"https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Integration+Plugin","size":686,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":15,"forks":9,"open_issues":15,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/82"},"html":{"href":"https://github.com/jenkinsci/github-integration-plugin/pull/82"},"issue":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues/82"},"comments":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/github-integration-plugin/statuses/f3925fdc50f0fb32a502f61aab5a478c67cd856a"}}}}