{"action":"created","comment":{"url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/comments/221091251","pull_request_review_id":159658807,"id":221091251,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTA5MTI1MQ==","diff_hunk":"@@ -804,4 +804,78 @@ def student_test_enqueued?\n     end\n   end\n \n+  # TODO Refactor into flexibler code from here to the end:\n+  # - ability to chain filters instead of exploding all cases\n+  # - pluck_test_runs and group_hash_list could be done in a single loop probably\n+  # - be able to return test_runs currently in progress and add them to the react table\n+  def filter_test_runs(filters)\n+    self.test_runs_all_data.where(filters)\n+  end\n+\n+  def self.pluck_test_runs(assoc)\n+    fields = ['test_runs.created_at', 'users.user_name', 'test_scripts.file_name', 'test_scripts.description',\n+              'test_scripts.display_actual_output', 'test_script_results.extra_info', 'test_script_results.time',\n+              'test_results.name', 'test_results.completion_status', 'test_results.marks_earned',\n+              'test_results.marks_total', 'test_results.actual_output', 'test_results.time']\n+    assoc.pluck_to_hash(fields)\n+  end\n+\n+  def self.group_hash_list(hash_list)\n+    new_hash_list = []\n+    group_by_keys = ['test_runs.created_at', 'test_scripts.file_name']\n+    hash_list.group_by { |g| g.values_at(*group_by_keys) }.values.each do |val|\n+      h = Hash.new\n+      group_by_keys.each do |key|\n+        h[key] = val[0][key]\n+      end\n+      h['test_data'] = val\n+      new_hash_list << h\n+    end\n+    new_hash_list\n+  end\n+\n+  def test_runs_instructors(submission)\n+    filtered = filter_test_runs({ 'users.type': 'Admin', 'test_runs.submission': submission })","path":"app/models/grouping.rb","position":44,"original_position":44,"commit_id":"9d8605ae086b7ad79dafb3a08397de68ac9e7ae2","original_commit_id":"9d8605ae086b7ad79dafb3a08397de68ac9e7ae2","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","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":"Style/BracesAroundHashParameters: Redundant curly braces around a hash parameter.","created_at":"2018-09-27T22:01:20Z","updated_at":"2018-09-27T22:01:20Z","html_url":"https://github.com/MarkUsProject/Markus/pull/3575#discussion_r221091251","pull_request_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/3575","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/comments/221091251"},"html":{"href":"https://github.com/MarkUsProject/Markus/pull/3575#discussion_r221091251"},"pull_request":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/3575"}}},"pull_request":{"url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/3575","id":218133929,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4MTMzOTI5","html_url":"https://github.com/MarkUsProject/Markus/pull/3575","diff_url":"https://github.com/MarkUsProject/Markus/pull/3575.diff","patch_url":"https://github.com/MarkUsProject/Markus/pull/3575.patch","issue_url":"https://api.github.com/repos/MarkUsProject/Markus/issues/3575","number":3575,"state":"open","locked":false,"title":"Rewrite of test results table","user":{"login":"mishaschwartz","id":4380924,"node_id":"MDQ6VXNlcjQzODA5MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4380924?v=4","gravatar_id":"","url":"https://api.github.com/users/mishaschwartz","html_url":"https://github.com/mishaschwartz","followers_url":"https://api.github.com/users/mishaschwartz/followers","following_url":"https://api.github.com/users/mishaschwartz/following{/other_user}","gists_url":"https://api.github.com/users/mishaschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/mishaschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishaschwartz/subscriptions","organizations_url":"https://api.github.com/users/mishaschwartz/orgs","repos_url":"https://api.github.com/users/mishaschwartz/repos","events_url":"https://api.github.com/users/mishaschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/mishaschwartz/received_events","type":"User","site_admin":false},"body":"* moves some of the data fetching logic into the models\r\n* simplify the react-table a little\r\n\r\nThis is still a work in progress because I need to figure out the best way to format the extra info once it is displayed. ","created_at":"2018-09-25T22:07:02Z","updated_at":"2018-09-27T22:01:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3880e2156eadb9acf102828bdf71939e96819b16","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/3575/commits","review_comments_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/3575/comments","review_comment_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MarkUsProject/Markus/issues/3575/comments","statuses_url":"https://api.github.com/repos/MarkUsProject/Markus/statuses/9d8605ae086b7ad79dafb3a08397de68ac9e7ae2","head":{"label":"mishaschwartz:display-extra-info","ref":"display-extra-info","sha":"9d8605ae086b7ad79dafb3a08397de68ac9e7ae2","user":{"login":"mishaschwartz","id":4380924,"node_id":"MDQ6VXNlcjQzODA5MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4380924?v=4","gravatar_id":"","url":"https://api.github.com/users/mishaschwartz","html_url":"https://github.com/mishaschwartz","followers_url":"https://api.github.com/users/mishaschwartz/followers","following_url":"https://api.github.com/users/mishaschwartz/following{/other_user}","gists_url":"https://api.github.com/users/mishaschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/mishaschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishaschwartz/subscriptions","organizations_url":"https://api.github.com/users/mishaschwartz/orgs","repos_url":"https://api.github.com/users/mishaschwartz/repos","events_url":"https://api.github.com/users/mishaschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/mishaschwartz/received_events","type":"User","site_admin":false},"repo":{"id":120653567,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA2NTM1Njc=","name":"Markus","full_name":"mishaschwartz/Markus","private":false,"owner":{"login":"mishaschwartz","id":4380924,"node_id":"MDQ6VXNlcjQzODA5MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4380924?v=4","gravatar_id":"","url":"https://api.github.com/users/mishaschwartz","html_url":"https://github.com/mishaschwartz","followers_url":"https://api.github.com/users/mishaschwartz/followers","following_url":"https://api.github.com/users/mishaschwartz/following{/other_user}","gists_url":"https://api.github.com/users/mishaschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/mishaschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishaschwartz/subscriptions","organizations_url":"https://api.github.com/users/mishaschwartz/orgs","repos_url":"https://api.github.com/users/mishaschwartz/repos","events_url":"https://api.github.com/users/mishaschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/mishaschwartz/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mishaschwartz/Markus","description":"Git repository of MarkUs","fork":true,"url":"https://api.github.com/repos/mishaschwartz/Markus","forks_url":"https://api.github.com/repos/mishaschwartz/Markus/forks","keys_url":"https://api.github.com/repos/mishaschwartz/Markus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mishaschwartz/Markus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mishaschwartz/Markus/teams","hooks_url":"https://api.github.com/repos/mishaschwartz/Markus/hooks","issue_events_url":"https://api.github.com/repos/mishaschwartz/Markus/issues/events{/number}","events_url":"https://api.github.com/repos/mishaschwartz/Markus/events","assignees_url":"https://api.github.com/repos/mishaschwartz/Markus/assignees{/user}","branches_url":"https://api.github.com/repos/mishaschwartz/Markus/branches{/branch}","tags_url":"https://api.github.com/repos/mishaschwartz/Markus/tags","blobs_url":"https://api.github.com/repos/mishaschwartz/Markus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mishaschwartz/Markus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mishaschwartz/Markus/git/refs{/sha}","trees_url":"https://api.github.com/repos/mishaschwartz/Markus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mishaschwartz/Markus/statuses/{sha}","languages_url":"https://api.github.com/repos/mishaschwartz/Markus/languages","stargazers_url":"https://api.github.com/repos/mishaschwartz/Markus/stargazers","contributors_url":"https://api.github.com/repos/mishaschwartz/Markus/contributors","subscribers_url":"https://api.github.com/repos/mishaschwartz/Markus/subscribers","subscription_url":"https://api.github.com/repos/mishaschwartz/Markus/subscription","commits_url":"https://api.github.com/repos/mishaschwartz/Markus/commits{/sha}","git_commits_url":"https://api.github.com/repos/mishaschwartz/Markus/git/commits{/sha}","comments_url":"https://api.github.com/repos/mishaschwartz/Markus/comments{/number}","issue_comment_url":"https://api.github.com/repos/mishaschwartz/Markus/issues/comments{/number}","contents_url":"https://api.github.com/repos/mishaschwartz/Markus/contents/{+path}","compare_url":"https://api.github.com/repos/mishaschwartz/Markus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mishaschwartz/Markus/merges","archive_url":"https://api.github.com/repos/mishaschwartz/Markus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mishaschwartz/Markus/downloads","issues_url":"https://api.github.com/repos/mishaschwartz/Markus/issues{/number}","pulls_url":"https://api.github.com/repos/mishaschwartz/Markus/pulls{/number}","milestones_url":"https://api.github.com/repos/mishaschwartz/Markus/milestones{/number}","notifications_url":"https://api.github.com/repos/mishaschwartz/Markus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mishaschwartz/Markus/labels{/name}","releases_url":"https://api.github.com/repos/mishaschwartz/Markus/releases{/id}","deployments_url":"https://api.github.com/repos/mishaschwartz/Markus/deployments","created_at":"2018-02-07T18:22:07Z","updated_at":"2018-02-07T18:22:17Z","pushed_at":"2018-09-27T22:01:09Z","git_url":"git://github.com/mishaschwartz/Markus.git","ssh_url":"git@github.com:mishaschwartz/Markus.git","clone_url":"https://github.com/mishaschwartz/Markus.git","svn_url":"https://github.com/mishaschwartz/Markus","homepage":"http://www.markusproject.org","size":115548,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MarkUsProject:1.7.0","ref":"1.7.0","sha":"f1c81f8ce33fb21b636b8f7168ae60fbfa6c6802","user":{"login":"MarkUsProject","id":415874,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxNTg3NA==","avatar_url":"https://avatars1.githubusercontent.com/u/415874?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkUsProject","html_url":"https://github.com/MarkUsProject","followers_url":"https://api.github.com/users/MarkUsProject/followers","following_url":"https://api.github.com/users/MarkUsProject/following{/other_user}","gists_url":"https://api.github.com/users/MarkUsProject/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkUsProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkUsProject/subscriptions","organizations_url":"https://api.github.com/users/MarkUsProject/orgs","repos_url":"https://api.github.com/users/MarkUsProject/repos","events_url":"https://api.github.com/users/MarkUsProject/events{/privacy}","received_events_url":"https://api.github.com/users/MarkUsProject/received_events","type":"Organization","site_admin":false},"repo":{"id":940538,"node_id":"MDEwOlJlcG9zaXRvcnk5NDA1Mzg=","name":"Markus","full_name":"MarkUsProject/Markus","private":false,"owner":{"login":"MarkUsProject","id":415874,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxNTg3NA==","avatar_url":"https://avatars1.githubusercontent.com/u/415874?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkUsProject","html_url":"https://github.com/MarkUsProject","followers_url":"https://api.github.com/users/MarkUsProject/followers","following_url":"https://api.github.com/users/MarkUsProject/following{/other_user}","gists_url":"https://api.github.com/users/MarkUsProject/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkUsProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkUsProject/subscriptions","organizations_url":"https://api.github.com/users/MarkUsProject/orgs","repos_url":"https://api.github.com/users/MarkUsProject/repos","events_url":"https://api.github.com/users/MarkUsProject/events{/privacy}","received_events_url":"https://api.github.com/users/MarkUsProject/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/MarkUsProject/Markus","description":"Git repository of MarkUs","fork":false,"url":"https://api.github.com/repos/MarkUsProject/Markus","forks_url":"https://api.github.com/repos/MarkUsProject/Markus/forks","keys_url":"https://api.github.com/repos/MarkUsProject/Markus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MarkUsProject/Markus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MarkUsProject/Markus/teams","hooks_url":"https://api.github.com/repos/MarkUsProject/Markus/hooks","issue_events_url":"https://api.github.com/repos/MarkUsProject/Markus/issues/events{/number}","events_url":"https://api.github.com/repos/MarkUsProject/Markus/events","assignees_url":"https://api.github.com/repos/MarkUsProject/Markus/assignees{/user}","branches_url":"https://api.github.com/repos/MarkUsProject/Markus/branches{/branch}","tags_url":"https://api.github.com/repos/MarkUsProject/Markus/tags","blobs_url":"https://api.github.com/repos/MarkUsProject/Markus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MarkUsProject/Markus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MarkUsProject/Markus/git/refs{/sha}","trees_url":"https://api.github.com/repos/MarkUsProject/Markus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MarkUsProject/Markus/statuses/{sha}","languages_url":"https://api.github.com/repos/MarkUsProject/Markus/languages","stargazers_url":"https://api.github.com/repos/MarkUsProject/Markus/stargazers","contributors_url":"https://api.github.com/repos/MarkUsProject/Markus/contributors","subscribers_url":"https://api.github.com/repos/MarkUsProject/Markus/subscribers","subscription_url":"https://api.github.com/repos/MarkUsProject/Markus/subscription","commits_url":"https://api.github.com/repos/MarkUsProject/Markus/commits{/sha}","git_commits_url":"https://api.github.com/repos/MarkUsProject/Markus/git/commits{/sha}","comments_url":"https://api.github.com/repos/MarkUsProject/Markus/comments{/number}","issue_comment_url":"https://api.github.com/repos/MarkUsProject/Markus/issues/comments{/number}","contents_url":"https://api.github.com/repos/MarkUsProject/Markus/contents/{+path}","compare_url":"https://api.github.com/repos/MarkUsProject/Markus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MarkUsProject/Markus/merges","archive_url":"https://api.github.com/repos/MarkUsProject/Markus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MarkUsProject/Markus/downloads","issues_url":"https://api.github.com/repos/MarkUsProject/Markus/issues{/number}","pulls_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls{/number}","milestones_url":"https://api.github.com/repos/MarkUsProject/Markus/milestones{/number}","notifications_url":"https://api.github.com/repos/MarkUsProject/Markus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MarkUsProject/Markus/labels{/name}","releases_url":"https://api.github.com/repos/MarkUsProject/Markus/releases{/id}","deployments_url":"https://api.github.com/repos/MarkUsProject/Markus/deployments","created_at":"2010-09-26T16:18:08Z","updated_at":"2018-09-27T15:57:47Z","pushed_at":"2018-09-27T22:01:11Z","git_url":"git://github.com/MarkUsProject/Markus.git","ssh_url":"git@github.com:MarkUsProject/Markus.git","clone_url":"https://github.com/MarkUsProject/Markus.git","svn_url":"https://github.com/MarkUsProject/Markus","homepage":"http://www.markusproject.org","size":115621,"stargazers_count":178,"watchers_count":178,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":194,"mirror_url":null,"archived":false,"open_issues_count":79,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":194,"open_issues":79,"watchers":178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/3575"},"html":{"href":"https://github.com/MarkUsProject/Markus/pull/3575"},"issue":{"href":"https://api.github.com/repos/MarkUsProject/Markus/issues/3575"},"comments":{"href":"https://api.github.com/repos/MarkUsProject/Markus/issues/3575/comments"},"review_comments":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/3575/comments"},"review_comment":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/3575/commits"},"statuses":{"href":"https://api.github.com/repos/MarkUsProject/Markus/statuses/9d8605ae086b7ad79dafb3a08397de68ac9e7ae2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}