{"action":"created","comment":{"url":"https://api.github.com/repos/rage/crowdsorceress/pulls/comments/127407628","pull_request_review_id":49988923,"id":127407628,"diff_hunk":"@@ -0,0 +1,56 @@\n+# frozen_string_literal: true\n+\n+class MessageBroadcasterJob < ApplicationJob\n+  queue_as :default\n+\n+  def perform(exercise)\n+    SubmissionStatusChannel.broadcast_to(\"SubmissionStatus_user:_#{exercise.user_id}_exercise:_#{exercise.id}\",\n+                                         JSON[message(exercise)])\n+  end\n+\n+  def message(exercise)\n+    if exercise.nil? || exercise.status_undefined?\n+      message_generator('in progress', 'Yhteys tietokantaan ok, odotetaan', 0, false, exercise)\n+    elsif exercise.saved?\n+      message_generator('in progress', 'Tehtävä tallennettu tietokantaan', 0.1, false, exercise)\n+    elsif exercise.testing_stub?\n+      message_generator('in progress', 'Testataan tehtäväpohjaa', 0.3, false, exercise)\n+    elsif exercise.testing_model_solution?\n+      message_generator('in progress', 'Testataan malliratkaisua', 0.6, false, exercise)\n+<<<<<<< HEAD\n+    elsif exercise.finished?\n+      message_generator('finished', 'Valmis, kaikki on ok', 1, true, exercise)\n+    elsif exercise.error?\n+      message = if !exercise.sandbox_results[:message].empty?\n+                  exercise.sandbox_results[:message]\n+                else\n+                  'Tehtävän lähetyksessä tapahtui virhe'\n+                end\n+      message_generator('error', message, 1, false, exercise)\n+    end\n+  end\n+\n+=======\n+    elsif exercise.half_done?\n+      message_generator('in progress', exercise.sandbox_results[:message], 0.8, false, exercise)\n+    elsif exercise.finished?\n+      message_generator('finished', 'Valmis, kaikki on ok', 1, true, exercise)\n+    elsif exercise.error?\n+      error_message(exercise)\n+    end\n+  end\n+\n+  def error_message(exercise)\n+    message = if !exercise.sandbox_results[:message].empty?\n+                exercise.sandbox_results[:message]\n+              else\n+                'Tehtävän lähetyksessä tapahtui virhe'\n+              end\n+    message_generator('error', message, 1, false, exercise)\n+  end\n+\n+>>>>>>> eacca5c9634e425b9ec3b4b7451e79b991e33e62","path":"app/jobs/message_broadcaster_job.rb","position":52,"original_position":52,"commit_id":"d9e1a70ccddd03d1e450562c076d29899ba92e30","original_commit_id":"d9e1a70ccddd03d1e450562c076d29899ba92e30","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars4.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":"unexpected token tRSHFT","created_at":"2017-07-14T08:17:21Z","updated_at":"2017-07-14T08:17:22Z","html_url":"https://github.com/rage/crowdsorceress/pull/7#discussion_r127407628","pull_request_url":"https://api.github.com/repos/rage/crowdsorceress/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/rage/crowdsorceress/pulls/comments/127407628"},"html":{"href":"https://github.com/rage/crowdsorceress/pull/7#discussion_r127407628"},"pull_request":{"href":"https://api.github.com/repos/rage/crowdsorceress/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/rage/crowdsorceress/pulls/7","id":130356603,"html_url":"https://github.com/rage/crowdsorceress/pull/7","diff_url":"https://github.com/rage/crowdsorceress/pull/7.diff","patch_url":"https://github.com/rage/crowdsorceress/pull/7.patch","issue_url":"https://api.github.com/repos/rage/crowdsorceress/issues/7","number":7,"state":"open","locked":false,"title":"Implement secret token","user":{"login":"pirtnea","id":10818109,"avatar_url":"https://avatars0.githubusercontent.com/u/10818109?v=4","gravatar_id":"","url":"https://api.github.com/users/pirtnea","html_url":"https://github.com/pirtnea","followers_url":"https://api.github.com/users/pirtnea/followers","following_url":"https://api.github.com/users/pirtnea/following{/other_user}","gists_url":"https://api.github.com/users/pirtnea/gists{/gist_id}","starred_url":"https://api.github.com/users/pirtnea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirtnea/subscriptions","organizations_url":"https://api.github.com/users/pirtnea/orgs","repos_url":"https://api.github.com/users/pirtnea/repos","events_url":"https://api.github.com/users/pirtnea/events{/privacy}","received_events_url":"https://api.github.com/users/pirtnea/received_events","type":"User","site_admin":false},"body":"Also added some tests and refactored broadcasting to frontend.\r\n\r\n:dagger:","created_at":"2017-07-13T12:21:02Z","updated_at":"2017-07-14T08:17:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce78d086231c3d47b667253a7f4a061c53c8096d","assignee":{"login":"pirtnea","id":10818109,"avatar_url":"https://avatars0.githubusercontent.com/u/10818109?v=4","gravatar_id":"","url":"https://api.github.com/users/pirtnea","html_url":"https://github.com/pirtnea","followers_url":"https://api.github.com/users/pirtnea/followers","following_url":"https://api.github.com/users/pirtnea/following{/other_user}","gists_url":"https://api.github.com/users/pirtnea/gists{/gist_id}","starred_url":"https://api.github.com/users/pirtnea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirtnea/subscriptions","organizations_url":"https://api.github.com/users/pirtnea/orgs","repos_url":"https://api.github.com/users/pirtnea/repos","events_url":"https://api.github.com/users/pirtnea/events{/privacy}","received_events_url":"https://api.github.com/users/pirtnea/received_events","type":"User","site_admin":false},"assignees":[{"login":"pirtnea","id":10818109,"avatar_url":"https://avatars0.githubusercontent.com/u/10818109?v=4","gravatar_id":"","url":"https://api.github.com/users/pirtnea","html_url":"https://github.com/pirtnea","followers_url":"https://api.github.com/users/pirtnea/followers","following_url":"https://api.github.com/users/pirtnea/following{/other_user}","gists_url":"https://api.github.com/users/pirtnea/gists{/gist_id}","starred_url":"https://api.github.com/users/pirtnea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirtnea/subscriptions","organizations_url":"https://api.github.com/users/pirtnea/orgs","repos_url":"https://api.github.com/users/pirtnea/repos","events_url":"https://api.github.com/users/pirtnea/events{/privacy}","received_events_url":"https://api.github.com/users/pirtnea/received_events","type":"User","site_admin":false},{"login":"vilmakoo","id":16772962,"avatar_url":"https://avatars7.githubusercontent.com/u/16772962?v=4","gravatar_id":"","url":"https://api.github.com/users/vilmakoo","html_url":"https://github.com/vilmakoo","followers_url":"https://api.github.com/users/vilmakoo/followers","following_url":"https://api.github.com/users/vilmakoo/following{/other_user}","gists_url":"https://api.github.com/users/vilmakoo/gists{/gist_id}","starred_url":"https://api.github.com/users/vilmakoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vilmakoo/subscriptions","organizations_url":"https://api.github.com/users/vilmakoo/orgs","repos_url":"https://api.github.com/users/vilmakoo/repos","events_url":"https://api.github.com/users/vilmakoo/events{/privacy}","received_events_url":"https://api.github.com/users/vilmakoo/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rage/crowdsorceress/pulls/7/commits","review_comments_url":"https://api.github.com/repos/rage/crowdsorceress/pulls/7/comments","review_comment_url":"https://api.github.com/repos/rage/crowdsorceress/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rage/crowdsorceress/issues/7/comments","statuses_url":"https://api.github.com/repos/rage/crowdsorceress/statuses/d9e1a70ccddd03d1e450562c076d29899ba92e30","head":{"label":"rage:secrettoken","ref":"secrettoken","sha":"d9e1a70ccddd03d1e450562c076d29899ba92e30","user":{"login":"rage","id":7485909,"avatar_url":"https://avatars4.githubusercontent.com/u/7485909?v=4","gravatar_id":"","url":"https://api.github.com/users/rage","html_url":"https://github.com/rage","followers_url":"https://api.github.com/users/rage/followers","following_url":"https://api.github.com/users/rage/following{/other_user}","gists_url":"https://api.github.com/users/rage/gists{/gist_id}","starred_url":"https://api.github.com/users/rage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rage/subscriptions","organizations_url":"https://api.github.com/users/rage/orgs","repos_url":"https://api.github.com/users/rage/repos","events_url":"https://api.github.com/users/rage/events{/privacy}","received_events_url":"https://api.github.com/users/rage/received_events","type":"Organization","site_admin":false},"repo":{"id":92732480,"name":"crowdsorceress","full_name":"rage/crowdsorceress","owner":{"login":"rage","id":7485909,"avatar_url":"https://avatars4.githubusercontent.com/u/7485909?v=4","gravatar_id":"","url":"https://api.github.com/users/rage","html_url":"https://github.com/rage","followers_url":"https://api.github.com/users/rage/followers","following_url":"https://api.github.com/users/rage/following{/other_user}","gists_url":"https://api.github.com/users/rage/gists{/gist_id}","starred_url":"https://api.github.com/users/rage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rage/subscriptions","organizations_url":"https://api.github.com/users/rage/orgs","repos_url":"https://api.github.com/users/rage/repos","events_url":"https://api.github.com/users/rage/events{/privacy}","received_events_url":"https://api.github.com/users/rage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rage/crowdsorceress","description":null,"fork":false,"url":"https://api.github.com/repos/rage/crowdsorceress","forks_url":"https://api.github.com/repos/rage/crowdsorceress/forks","keys_url":"https://api.github.com/repos/rage/crowdsorceress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rage/crowdsorceress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rage/crowdsorceress/teams","hooks_url":"https://api.github.com/repos/rage/crowdsorceress/hooks","issue_events_url":"https://api.github.com/repos/rage/crowdsorceress/issues/events{/number}","events_url":"https://api.github.com/repos/rage/crowdsorceress/events","assignees_url":"https://api.github.com/repos/rage/crowdsorceress/assignees{/user}","branches_url":"https://api.github.com/repos/rage/crowdsorceress/branches{/branch}","tags_url":"https://api.github.com/repos/rage/crowdsorceress/tags","blobs_url":"https://api.github.com/repos/rage/crowdsorceress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rage/crowdsorceress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rage/crowdsorceress/git/refs{/sha}","trees_url":"https://api.github.com/repos/rage/crowdsorceress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rage/crowdsorceress/statuses/{sha}","languages_url":"https://api.github.com/repos/rage/crowdsorceress/languages","stargazers_url":"https://api.github.com/repos/rage/crowdsorceress/stargazers","contributors_url":"https://api.github.com/repos/rage/crowdsorceress/contributors","subscribers_url":"https://api.github.com/repos/rage/crowdsorceress/subscribers","subscription_url":"https://api.github.com/repos/rage/crowdsorceress/subscription","commits_url":"https://api.github.com/repos/rage/crowdsorceress/commits{/sha}","git_commits_url":"https://api.github.com/repos/rage/crowdsorceress/git/commits{/sha}","comments_url":"https://api.github.com/repos/rage/crowdsorceress/comments{/number}","issue_comment_url":"https://api.github.com/repos/rage/crowdsorceress/issues/comments{/number}","contents_url":"https://api.github.com/repos/rage/crowdsorceress/contents/{+path}","compare_url":"https://api.github.com/repos/rage/crowdsorceress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rage/crowdsorceress/merges","archive_url":"https://api.github.com/repos/rage/crowdsorceress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rage/crowdsorceress/downloads","issues_url":"https://api.github.com/repos/rage/crowdsorceress/issues{/number}","pulls_url":"https://api.github.com/repos/rage/crowdsorceress/pulls{/number}","milestones_url":"https://api.github.com/repos/rage/crowdsorceress/milestones{/number}","notifications_url":"https://api.github.com/repos/rage/crowdsorceress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rage/crowdsorceress/labels{/name}","releases_url":"https://api.github.com/repos/rage/crowdsorceress/releases{/id}","deployments_url":"https://api.github.com/repos/rage/crowdsorceress/deployments","created_at":"2017-05-29T11:12:28Z","updated_at":"2017-06-27T12:17:35Z","pushed_at":"2017-07-14T08:17:09Z","git_url":"git://github.com/rage/crowdsorceress.git","ssh_url":"git@github.com:rage/crowdsorceress.git","clone_url":"https://github.com/rage/crowdsorceress.git","svn_url":"https://github.com/rage/crowdsorceress","homepage":null,"size":79193,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rage:master","ref":"master","sha":"80709d050b7f532c73d039aa4bcc39d22f543876","user":{"login":"rage","id":7485909,"avatar_url":"https://avatars4.githubusercontent.com/u/7485909?v=4","gravatar_id":"","url":"https://api.github.com/users/rage","html_url":"https://github.com/rage","followers_url":"https://api.github.com/users/rage/followers","following_url":"https://api.github.com/users/rage/following{/other_user}","gists_url":"https://api.github.com/users/rage/gists{/gist_id}","starred_url":"https://api.github.com/users/rage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rage/subscriptions","organizations_url":"https://api.github.com/users/rage/orgs","repos_url":"https://api.github.com/users/rage/repos","events_url":"https://api.github.com/users/rage/events{/privacy}","received_events_url":"https://api.github.com/users/rage/received_events","type":"Organization","site_admin":false},"repo":{"id":92732480,"name":"crowdsorceress","full_name":"rage/crowdsorceress","owner":{"login":"rage","id":7485909,"avatar_url":"https://avatars4.githubusercontent.com/u/7485909?v=4","gravatar_id":"","url":"https://api.github.com/users/rage","html_url":"https://github.com/rage","followers_url":"https://api.github.com/users/rage/followers","following_url":"https://api.github.com/users/rage/following{/other_user}","gists_url":"https://api.github.com/users/rage/gists{/gist_id}","starred_url":"https://api.github.com/users/rage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rage/subscriptions","organizations_url":"https://api.github.com/users/rage/orgs","repos_url":"https://api.github.com/users/rage/repos","events_url":"https://api.github.com/users/rage/events{/privacy}","received_events_url":"https://api.github.com/users/rage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rage/crowdsorceress","description":null,"fork":false,"url":"https://api.github.com/repos/rage/crowdsorceress","forks_url":"https://api.github.com/repos/rage/crowdsorceress/forks","keys_url":"https://api.github.com/repos/rage/crowdsorceress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rage/crowdsorceress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rage/crowdsorceress/teams","hooks_url":"https://api.github.com/repos/rage/crowdsorceress/hooks","issue_events_url":"https://api.github.com/repos/rage/crowdsorceress/issues/events{/number}","events_url":"https://api.github.com/repos/rage/crowdsorceress/events","assignees_url":"https://api.github.com/repos/rage/crowdsorceress/assignees{/user}","branches_url":"https://api.github.com/repos/rage/crowdsorceress/branches{/branch}","tags_url":"https://api.github.com/repos/rage/crowdsorceress/tags","blobs_url":"https://api.github.com/repos/rage/crowdsorceress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rage/crowdsorceress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rage/crowdsorceress/git/refs{/sha}","trees_url":"https://api.github.com/repos/rage/crowdsorceress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rage/crowdsorceress/statuses/{sha}","languages_url":"https://api.github.com/repos/rage/crowdsorceress/languages","stargazers_url":"https://api.github.com/repos/rage/crowdsorceress/stargazers","contributors_url":"https://api.github.com/repos/rage/crowdsorceress/contributors","subscribers_url":"https://api.github.com/repos/rage/crowdsorceress/subscribers","subscription_url":"https://api.github.com/repos/rage/crowdsorceress/subscription","commits_url":"https://api.github.com/repos/rage/crowdsorceress/commits{/sha}","git_commits_url":"https://api.github.com/repos/rage/crowdsorceress/git/commits{/sha}","comments_url":"https://api.github.com/repos/rage/crowdsorceress/comments{/number}","issue_comment_url":"https://api.github.com/repos/rage/crowdsorceress/issues/comments{/number}","contents_url":"https://api.github.com/repos/rage/crowdsorceress/contents/{+path}","compare_url":"https://api.github.com/repos/rage/crowdsorceress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rage/crowdsorceress/merges","archive_url":"https://api.github.com/repos/rage/crowdsorceress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rage/crowdsorceress/downloads","issues_url":"https://api.github.com/repos/rage/crowdsorceress/issues{/number}","pulls_url":"https://api.github.com/repos/rage/crowdsorceress/pulls{/number}","milestones_url":"https://api.github.com/repos/rage/crowdsorceress/milestones{/number}","notifications_url":"https://api.github.com/repos/rage/crowdsorceress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rage/crowdsorceress/labels{/name}","releases_url":"https://api.github.com/repos/rage/crowdsorceress/releases{/id}","deployments_url":"https://api.github.com/repos/rage/crowdsorceress/deployments","created_at":"2017-05-29T11:12:28Z","updated_at":"2017-06-27T12:17:35Z","pushed_at":"2017-07-14T08:17:09Z","git_url":"git://github.com/rage/crowdsorceress.git","ssh_url":"git@github.com:rage/crowdsorceress.git","clone_url":"https://github.com/rage/crowdsorceress.git","svn_url":"https://github.com/rage/crowdsorceress","homepage":null,"size":79193,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rage/crowdsorceress/pulls/7"},"html":{"href":"https://github.com/rage/crowdsorceress/pull/7"},"issue":{"href":"https://api.github.com/repos/rage/crowdsorceress/issues/7"},"comments":{"href":"https://api.github.com/repos/rage/crowdsorceress/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/rage/crowdsorceress/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/rage/crowdsorceress/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rage/crowdsorceress/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/rage/crowdsorceress/statuses/d9e1a70ccddd03d1e450562c076d29899ba92e30"}}}}
{"actor":{"display_login":"houndci-bot"}}