{"action":"created","comment":{"url":"https://api.github.com/repos/onetwotrip/jira/pulls/comments/183363449","pull_request_review_id":114345129,"id":183363449,"diff_hunk":"@@ -6,40 +6,87 @@ def find_by_filter(issue, filter)\n       issue.jql(\"filter=#{filter}\")\n     rescue JIRA::HTTPError => jira_error\n       error_message = jira_error.response['body_exists'] ? jira_error.message : jira_error.response.body\n-      puts \"Error in JIRA with the search by filter #{error_message}\".red\n+      LOGGER.info \"Error in JIRA with the search by filter #{error_message}\".red\n       []\n     end\n \n     def check_issue(issue_task)\n+      LOGGER.info \"Start check #{issue_task.key} issue\".green\n       issue_task.api_pullrequests.each do |pr|\n-        diff_in_pr = pr.diff\n-        commit_id = pr.source['commit']['hash']\n-        commit = BITBUCKET.repo(pr.repo_owner, pr.repo_slug).commit(commit_id)\n-        status_of_build = commit.build_statuses.collect.last\n-        conflict_flag = diff_in_pr.include? '<<<<<<<'\n-        log_string = \"Status of pullrequest #{pr.title} is #{status_of_build.name}:#{status_of_build.state} and \".green\n-        conflict_flag_log = \"conflict_flag is #{conflict_flag}\".green\n-        conflict_flag_log = \"conflict_flag is #{conflict_flag}\".red if conflict_flag\n-\n-        log_string += conflict_flag_log + \" with link https://bitbucket.org/OneTwoTrip/#{pr.repo_slug}/\".green +\n-                      \"pull-requests/#{pr.id}\".green\n-        puts log_string\n+        begin\n+          diff_in_pr      = pr.diff\n+          commit_id       = pr.source['commit']['hash']\n+          commit          = BITBUCKET.repo(pr.repo_owner, pr.repo_slug).commit(commit_id)\n+          status_of_build = commit.build_statuses.collect.last\n+          if status_of_build.state.upcase.include? 'FAILED'\n+            LOGGER.info \"Detected build status error in #{issue_task.key}. Writing comment in ticket...\".red\n+            issue_task.post_comment 'Ticket has build error status, pls check it'\n+          end\n+          conflict_flag     = diff_in_pr.include? '<<<<<<<'\n+          log_string        = \"Status of pullrequest #{pr.title} is #{status_of_build.name}:#{status_of_build.state} and \".green\n+          conflict_flag_log = \"conflict_flag is #{conflict_flag}\".green\n+          if conflict_flag\n+            LOGGER.info \"Find conflicts in #{issue_task.key}. Writing comment in ticket...\"\n+            conflict_flag_log = \"conflict_flag is #{conflict_flag}\".red\n+            issue_task.post_comment 'After last release this issue started to have merge conflicts. Please fix it'\n+            LOGGER.info \"Finished writing merge conflict message in #{issue_task.key}\"\n+          end\n+\n+          log_string += conflict_flag_log + \" with link https://bitbucket.org/OneTwoTrip/#{pr.repo_slug}/\".green +\n+            \"pull-requests/#{pr.id}\".green\n+          LOGGER.info log_string\n+","path":"lib/scenarios/checkconflicts.rb","position":46,"original_position":46,"commit_id":"ac579b06c2e5bbebd2a73621c0354e6d9c48a89d","original_commit_id":"ac579b06c2e5bbebd2a73621c0354e6d9c48a89d","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Layout/EmptyLinesAroundExceptionHandlingKeywords: Extra empty line detected before the rescue.","created_at":"2018-04-23T11:39:49Z","updated_at":"2018-04-23T11:39:50Z","html_url":"https://github.com/onetwotrip/jira/pull/158#discussion_r183363449","pull_request_url":"https://api.github.com/repos/onetwotrip/jira/pulls/158","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/onetwotrip/jira/pulls/comments/183363449"},"html":{"href":"https://github.com/onetwotrip/jira/pull/158#discussion_r183363449"},"pull_request":{"href":"https://api.github.com/repos/onetwotrip/jira/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/onetwotrip/jira/pulls/158","id":183406389,"html_url":"https://github.com/onetwotrip/jira/pull/158","diff_url":"https://github.com/onetwotrip/jira/pull/158.diff","patch_url":"https://github.com/onetwotrip/jira/pull/158.patch","issue_url":"https://api.github.com/repos/onetwotrip/jira/issues/158","number":158,"state":"open","locked":false,"title":"Srv 3361 checkconflicts","user":{"login":"Kerem356","id":13794799,"avatar_url":"https://avatars1.githubusercontent.com/u/13794799?v=4","gravatar_id":"","url":"https://api.github.com/users/Kerem356","html_url":"https://github.com/Kerem356","followers_url":"https://api.github.com/users/Kerem356/followers","following_url":"https://api.github.com/users/Kerem356/following{/other_user}","gists_url":"https://api.github.com/users/Kerem356/gists{/gist_id}","starred_url":"https://api.github.com/users/Kerem356/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kerem356/subscriptions","organizations_url":"https://api.github.com/users/Kerem356/orgs","repos_url":"https://api.github.com/users/Kerem356/repos","events_url":"https://api.github.com/users/Kerem356/events{/privacy}","received_events_url":"https://api.github.com/users/Kerem356/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-23T11:39:41Z","updated_at":"2018-04-23T11:39:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a03735cd42961b6a657c08826ee388ac816bd9e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/onetwotrip/jira/pulls/158/commits","review_comments_url":"https://api.github.com/repos/onetwotrip/jira/pulls/158/comments","review_comment_url":"https://api.github.com/repos/onetwotrip/jira/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onetwotrip/jira/issues/158/comments","statuses_url":"https://api.github.com/repos/onetwotrip/jira/statuses/ac579b06c2e5bbebd2a73621c0354e6d9c48a89d","head":{"label":"Kerem356:SRV-3361_checkconflicts","ref":"SRV-3361_checkconflicts","sha":"ac579b06c2e5bbebd2a73621c0354e6d9c48a89d","user":{"login":"Kerem356","id":13794799,"avatar_url":"https://avatars1.githubusercontent.com/u/13794799?v=4","gravatar_id":"","url":"https://api.github.com/users/Kerem356","html_url":"https://github.com/Kerem356","followers_url":"https://api.github.com/users/Kerem356/followers","following_url":"https://api.github.com/users/Kerem356/following{/other_user}","gists_url":"https://api.github.com/users/Kerem356/gists{/gist_id}","starred_url":"https://api.github.com/users/Kerem356/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kerem356/subscriptions","organizations_url":"https://api.github.com/users/Kerem356/orgs","repos_url":"https://api.github.com/users/Kerem356/repos","events_url":"https://api.github.com/users/Kerem356/events{/privacy}","received_events_url":"https://api.github.com/users/Kerem356/received_events","type":"User","site_admin":false},"repo":{"id":127244916,"name":"jira","full_name":"Kerem356/jira","owner":{"login":"Kerem356","id":13794799,"avatar_url":"https://avatars1.githubusercontent.com/u/13794799?v=4","gravatar_id":"","url":"https://api.github.com/users/Kerem356","html_url":"https://github.com/Kerem356","followers_url":"https://api.github.com/users/Kerem356/followers","following_url":"https://api.github.com/users/Kerem356/following{/other_user}","gists_url":"https://api.github.com/users/Kerem356/gists{/gist_id}","starred_url":"https://api.github.com/users/Kerem356/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kerem356/subscriptions","organizations_url":"https://api.github.com/users/Kerem356/orgs","repos_url":"https://api.github.com/users/Kerem356/repos","events_url":"https://api.github.com/users/Kerem356/events{/privacy}","received_events_url":"https://api.github.com/users/Kerem356/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kerem356/jira","description":"Applications for OTT CI","fork":true,"url":"https://api.github.com/repos/Kerem356/jira","forks_url":"https://api.github.com/repos/Kerem356/jira/forks","keys_url":"https://api.github.com/repos/Kerem356/jira/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kerem356/jira/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kerem356/jira/teams","hooks_url":"https://api.github.com/repos/Kerem356/jira/hooks","issue_events_url":"https://api.github.com/repos/Kerem356/jira/issues/events{/number}","events_url":"https://api.github.com/repos/Kerem356/jira/events","assignees_url":"https://api.github.com/repos/Kerem356/jira/assignees{/user}","branches_url":"https://api.github.com/repos/Kerem356/jira/branches{/branch}","tags_url":"https://api.github.com/repos/Kerem356/jira/tags","blobs_url":"https://api.github.com/repos/Kerem356/jira/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kerem356/jira/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kerem356/jira/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kerem356/jira/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kerem356/jira/statuses/{sha}","languages_url":"https://api.github.com/repos/Kerem356/jira/languages","stargazers_url":"https://api.github.com/repos/Kerem356/jira/stargazers","contributors_url":"https://api.github.com/repos/Kerem356/jira/contributors","subscribers_url":"https://api.github.com/repos/Kerem356/jira/subscribers","subscription_url":"https://api.github.com/repos/Kerem356/jira/subscription","commits_url":"https://api.github.com/repos/Kerem356/jira/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kerem356/jira/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kerem356/jira/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kerem356/jira/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kerem356/jira/contents/{+path}","compare_url":"https://api.github.com/repos/Kerem356/jira/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kerem356/jira/merges","archive_url":"https://api.github.com/repos/Kerem356/jira/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kerem356/jira/downloads","issues_url":"https://api.github.com/repos/Kerem356/jira/issues{/number}","pulls_url":"https://api.github.com/repos/Kerem356/jira/pulls{/number}","milestones_url":"https://api.github.com/repos/Kerem356/jira/milestones{/number}","notifications_url":"https://api.github.com/repos/Kerem356/jira/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kerem356/jira/labels{/name}","releases_url":"https://api.github.com/repos/Kerem356/jira/releases{/id}","deployments_url":"https://api.github.com/repos/Kerem356/jira/deployments","created_at":"2018-03-29T06:09:58Z","updated_at":"2018-03-29T06:10:00Z","pushed_at":"2018-04-23T11:38:35Z","git_url":"git://github.com/Kerem356/jira.git","ssh_url":"git@github.com:Kerem356/jira.git","clone_url":"https://github.com/Kerem356/jira.git","svn_url":"https://github.com/Kerem356/jira","homepage":"","size":204,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"onetwotrip:master","ref":"master","sha":"acbd9cc69d2e5c17ff6497ba9de32ecde1b6e3ce","user":{"login":"onetwotrip","id":8199655,"avatar_url":"https://avatars1.githubusercontent.com/u/8199655?v=4","gravatar_id":"","url":"https://api.github.com/users/onetwotrip","html_url":"https://github.com/onetwotrip","followers_url":"https://api.github.com/users/onetwotrip/followers","following_url":"https://api.github.com/users/onetwotrip/following{/other_user}","gists_url":"https://api.github.com/users/onetwotrip/gists{/gist_id}","starred_url":"https://api.github.com/users/onetwotrip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onetwotrip/subscriptions","organizations_url":"https://api.github.com/users/onetwotrip/orgs","repos_url":"https://api.github.com/users/onetwotrip/repos","events_url":"https://api.github.com/users/onetwotrip/events{/privacy}","received_events_url":"https://api.github.com/users/onetwotrip/received_events","type":"Organization","site_admin":false},"repo":{"id":53054606,"name":"jira","full_name":"onetwotrip/jira","owner":{"login":"onetwotrip","id":8199655,"avatar_url":"https://avatars1.githubusercontent.com/u/8199655?v=4","gravatar_id":"","url":"https://api.github.com/users/onetwotrip","html_url":"https://github.com/onetwotrip","followers_url":"https://api.github.com/users/onetwotrip/followers","following_url":"https://api.github.com/users/onetwotrip/following{/other_user}","gists_url":"https://api.github.com/users/onetwotrip/gists{/gist_id}","starred_url":"https://api.github.com/users/onetwotrip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onetwotrip/subscriptions","organizations_url":"https://api.github.com/users/onetwotrip/orgs","repos_url":"https://api.github.com/users/onetwotrip/repos","events_url":"https://api.github.com/users/onetwotrip/events{/privacy}","received_events_url":"https://api.github.com/users/onetwotrip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onetwotrip/jira","description":"Applications for OTT CI","fork":false,"url":"https://api.github.com/repos/onetwotrip/jira","forks_url":"https://api.github.com/repos/onetwotrip/jira/forks","keys_url":"https://api.github.com/repos/onetwotrip/jira/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onetwotrip/jira/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onetwotrip/jira/teams","hooks_url":"https://api.github.com/repos/onetwotrip/jira/hooks","issue_events_url":"https://api.github.com/repos/onetwotrip/jira/issues/events{/number}","events_url":"https://api.github.com/repos/onetwotrip/jira/events","assignees_url":"https://api.github.com/repos/onetwotrip/jira/assignees{/user}","branches_url":"https://api.github.com/repos/onetwotrip/jira/branches{/branch}","tags_url":"https://api.github.com/repos/onetwotrip/jira/tags","blobs_url":"https://api.github.com/repos/onetwotrip/jira/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onetwotrip/jira/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onetwotrip/jira/git/refs{/sha}","trees_url":"https://api.github.com/repos/onetwotrip/jira/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onetwotrip/jira/statuses/{sha}","languages_url":"https://api.github.com/repos/onetwotrip/jira/languages","stargazers_url":"https://api.github.com/repos/onetwotrip/jira/stargazers","contributors_url":"https://api.github.com/repos/onetwotrip/jira/contributors","subscribers_url":"https://api.github.com/repos/onetwotrip/jira/subscribers","subscription_url":"https://api.github.com/repos/onetwotrip/jira/subscription","commits_url":"https://api.github.com/repos/onetwotrip/jira/commits{/sha}","git_commits_url":"https://api.github.com/repos/onetwotrip/jira/git/commits{/sha}","comments_url":"https://api.github.com/repos/onetwotrip/jira/comments{/number}","issue_comment_url":"https://api.github.com/repos/onetwotrip/jira/issues/comments{/number}","contents_url":"https://api.github.com/repos/onetwotrip/jira/contents/{+path}","compare_url":"https://api.github.com/repos/onetwotrip/jira/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onetwotrip/jira/merges","archive_url":"https://api.github.com/repos/onetwotrip/jira/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onetwotrip/jira/downloads","issues_url":"https://api.github.com/repos/onetwotrip/jira/issues{/number}","pulls_url":"https://api.github.com/repos/onetwotrip/jira/pulls{/number}","milestones_url":"https://api.github.com/repos/onetwotrip/jira/milestones{/number}","notifications_url":"https://api.github.com/repos/onetwotrip/jira/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onetwotrip/jira/labels{/name}","releases_url":"https://api.github.com/repos/onetwotrip/jira/releases{/id}","deployments_url":"https://api.github.com/repos/onetwotrip/jira/deployments","created_at":"2016-03-03T14:03:22Z","updated_at":"2018-04-19T06:21:38Z","pushed_at":"2018-04-23T11:39:42Z","git_url":"git://github.com/onetwotrip/jira.git","ssh_url":"git@github.com:onetwotrip/jira.git","clone_url":"https://github.com/onetwotrip/jira.git","svn_url":"https://github.com/onetwotrip/jira","homepage":"","size":208,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":6,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onetwotrip/jira/pulls/158"},"html":{"href":"https://github.com/onetwotrip/jira/pull/158"},"issue":{"href":"https://api.github.com/repos/onetwotrip/jira/issues/158"},"comments":{"href":"https://api.github.com/repos/onetwotrip/jira/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/onetwotrip/jira/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/onetwotrip/jira/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onetwotrip/jira/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/onetwotrip/jira/statuses/ac579b06c2e5bbebd2a73621c0354e6d9c48a89d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}