{"action":"created","comment":{"url":"https://api.github.com/repos/Linaro/art-reports/pulls/comments/63146585","id":63146585,"diff_hunk":"@@ -0,0 +1,39 @@\n+import json\n+import os\n+import shutil\n+import subprocess\n+import tempfile\n+\n+from django.conf import settings\n+\n+compare_script = os.path.join(os.path.dirname(__file__), '../ext/art-testing/compare.py')\n+\n+def render_comparison(results_before, results_after):\n+    tmpdir = export_data(results_before, results_after)\n+    # FIXME: sandbox this!\n+    output = subprocess.check_output([\n+        compare_script,\n+        os.path.join(tmpdir, \"before.json\"),\n+        os.path.join(tmpdir, \"after.json\"),\n+    ])\n+    shutil.rmtree(tmpdir)\n+    return output\n+\n+\n+def export_data(results_before, results_after):\n+    tmpdir = tempfile.mkdtemp()\n+\n+    export_result(results_before, os.path.join(tmpdir, 'before.json'))\n+    export_result(results_after, os.path.join(tmpdir, 'after.json'))\n+\n+    return tmpdir\n+\n+\n+def export_result(results, filename):","path":"benchmarks/comparison.py","position":32,"original_position":32,"commit_id":"283484d9d0d7080146975c16021ef6bc9c1a1fe0","original_commit_id":"fb034afd074d7e65ac490c9a4d72c8518b29bdcc","user":{"login":"mwasilew","id":618901,"avatar_url":"https://avatars.githubusercontent.com/u/618901?v=3","gravatar_id":"","url":"https://api.github.com/users/mwasilew","html_url":"https://github.com/mwasilew","followers_url":"https://api.github.com/users/mwasilew/followers","following_url":"https://api.github.com/users/mwasilew/following{/other_user}","gists_url":"https://api.github.com/users/mwasilew/gists{/gist_id}","starred_url":"https://api.github.com/users/mwasilew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwasilew/subscriptions","organizations_url":"https://api.github.com/users/mwasilew/orgs","repos_url":"https://api.github.com/users/mwasilew/repos","events_url":"https://api.github.com/users/mwasilew/events{/privacy}","received_events_url":"https://api.github.com/users/mwasilew/received_events","type":"User","site_admin":false},"body":"OK, let's leave i like it is for now. If guys don't like it we'll change that. I guess it's connected to our discussion on how to filter results with respect to metadata. If that can be done, the results would be identical as obtained from original JSON results.","created_at":"2016-05-13T08:08:54Z","updated_at":"2016-05-13T08:08:54Z","html_url":"https://github.com/Linaro/art-reports/pull/44#discussion_r63146585","pull_request_url":"https://api.github.com/repos/Linaro/art-reports/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/Linaro/art-reports/pulls/comments/63146585"},"html":{"href":"https://github.com/Linaro/art-reports/pull/44#discussion_r63146585"},"pull_request":{"href":"https://api.github.com/repos/Linaro/art-reports/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/Linaro/art-reports/pulls/44","id":69755225,"html_url":"https://github.com/Linaro/art-reports/pull/44","diff_url":"https://github.com/Linaro/art-reports/pull/44.diff","patch_url":"https://github.com/Linaro/art-reports/pull/44.patch","issue_url":"https://api.github.com/repos/Linaro/art-reports/issues/44","number":44,"state":"open","locked":false,"title":"Better benchmarks comparison","user":{"login":"terceiro","id":30027,"avatar_url":"https://avatars.githubusercontent.com/u/30027?v=3","gravatar_id":"","url":"https://api.github.com/users/terceiro","html_url":"https://github.com/terceiro","followers_url":"https://api.github.com/users/terceiro/followers","following_url":"https://api.github.com/users/terceiro/following{/other_user}","gists_url":"https://api.github.com/users/terceiro/gists{/gist_id}","starred_url":"https://api.github.com/users/terceiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terceiro/subscriptions","organizations_url":"https://api.github.com/users/terceiro/orgs","repos_url":"https://api.github.com/users/terceiro/repos","events_url":"https://api.github.com/users/terceiro/events{/privacy}","received_events_url":"https://api.github.com/users/terceiro/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-11T22:50:52Z","updated_at":"2016-05-13T08:08:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c817174cd7ff03f3c4bdc9b44832a79bda101d61","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Linaro/art-reports/pulls/44/commits","review_comments_url":"https://api.github.com/repos/Linaro/art-reports/pulls/44/comments","review_comment_url":"https://api.github.com/repos/Linaro/art-reports/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Linaro/art-reports/issues/44/comments","statuses_url":"https://api.github.com/repos/Linaro/art-reports/statuses/283484d9d0d7080146975c16021ef6bc9c1a1fe0","head":{"label":"terceiro:better-comparison","ref":"better-comparison","sha":"283484d9d0d7080146975c16021ef6bc9c1a1fe0","user":{"login":"terceiro","id":30027,"avatar_url":"https://avatars.githubusercontent.com/u/30027?v=3","gravatar_id":"","url":"https://api.github.com/users/terceiro","html_url":"https://github.com/terceiro","followers_url":"https://api.github.com/users/terceiro/followers","following_url":"https://api.github.com/users/terceiro/following{/other_user}","gists_url":"https://api.github.com/users/terceiro/gists{/gist_id}","starred_url":"https://api.github.com/users/terceiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terceiro/subscriptions","organizations_url":"https://api.github.com/users/terceiro/orgs","repos_url":"https://api.github.com/users/terceiro/repos","events_url":"https://api.github.com/users/terceiro/events{/privacy}","received_events_url":"https://api.github.com/users/terceiro/received_events","type":"User","site_admin":false},"repo":{"id":54416724,"name":"art-reports","full_name":"terceiro/art-reports","owner":{"login":"terceiro","id":30027,"avatar_url":"https://avatars.githubusercontent.com/u/30027?v=3","gravatar_id":"","url":"https://api.github.com/users/terceiro","html_url":"https://github.com/terceiro","followers_url":"https://api.github.com/users/terceiro/followers","following_url":"https://api.github.com/users/terceiro/following{/other_user}","gists_url":"https://api.github.com/users/terceiro/gists{/gist_id}","starred_url":"https://api.github.com/users/terceiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terceiro/subscriptions","organizations_url":"https://api.github.com/users/terceiro/orgs","repos_url":"https://api.github.com/users/terceiro/repos","events_url":"https://api.github.com/users/terceiro/events{/privacy}","received_events_url":"https://api.github.com/users/terceiro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/terceiro/art-reports","description":"","fork":true,"url":"https://api.github.com/repos/terceiro/art-reports","forks_url":"https://api.github.com/repos/terceiro/art-reports/forks","keys_url":"https://api.github.com/repos/terceiro/art-reports/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terceiro/art-reports/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terceiro/art-reports/teams","hooks_url":"https://api.github.com/repos/terceiro/art-reports/hooks","issue_events_url":"https://api.github.com/repos/terceiro/art-reports/issues/events{/number}","events_url":"https://api.github.com/repos/terceiro/art-reports/events","assignees_url":"https://api.github.com/repos/terceiro/art-reports/assignees{/user}","branches_url":"https://api.github.com/repos/terceiro/art-reports/branches{/branch}","tags_url":"https://api.github.com/repos/terceiro/art-reports/tags","blobs_url":"https://api.github.com/repos/terceiro/art-reports/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terceiro/art-reports/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terceiro/art-reports/git/refs{/sha}","trees_url":"https://api.github.com/repos/terceiro/art-reports/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terceiro/art-reports/statuses/{sha}","languages_url":"https://api.github.com/repos/terceiro/art-reports/languages","stargazers_url":"https://api.github.com/repos/terceiro/art-reports/stargazers","contributors_url":"https://api.github.com/repos/terceiro/art-reports/contributors","subscribers_url":"https://api.github.com/repos/terceiro/art-reports/subscribers","subscription_url":"https://api.github.com/repos/terceiro/art-reports/subscription","commits_url":"https://api.github.com/repos/terceiro/art-reports/commits{/sha}","git_commits_url":"https://api.github.com/repos/terceiro/art-reports/git/commits{/sha}","comments_url":"https://api.github.com/repos/terceiro/art-reports/comments{/number}","issue_comment_url":"https://api.github.com/repos/terceiro/art-reports/issues/comments{/number}","contents_url":"https://api.github.com/repos/terceiro/art-reports/contents/{+path}","compare_url":"https://api.github.com/repos/terceiro/art-reports/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terceiro/art-reports/merges","archive_url":"https://api.github.com/repos/terceiro/art-reports/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terceiro/art-reports/downloads","issues_url":"https://api.github.com/repos/terceiro/art-reports/issues{/number}","pulls_url":"https://api.github.com/repos/terceiro/art-reports/pulls{/number}","milestones_url":"https://api.github.com/repos/terceiro/art-reports/milestones{/number}","notifications_url":"https://api.github.com/repos/terceiro/art-reports/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terceiro/art-reports/labels{/name}","releases_url":"https://api.github.com/repos/terceiro/art-reports/releases{/id}","deployments_url":"https://api.github.com/repos/terceiro/art-reports/deployments","created_at":"2016-03-21T19:28:04Z","updated_at":"2016-03-21T19:28:05Z","pushed_at":"2016-05-12T19:48:07Z","git_url":"git://github.com/terceiro/art-reports.git","ssh_url":"git@github.com:terceiro/art-reports.git","clone_url":"https://github.com/terceiro/art-reports.git","svn_url":"https://github.com/terceiro/art-reports","homepage":null,"size":6362,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"Linaro:master","ref":"master","sha":"c1f16e53bafedc22613bf99001e45e5a5de0f114","user":{"login":"Linaro","id":1180626,"avatar_url":"https://avatars.githubusercontent.com/u/1180626?v=3","gravatar_id":"","url":"https://api.github.com/users/Linaro","html_url":"https://github.com/Linaro","followers_url":"https://api.github.com/users/Linaro/followers","following_url":"https://api.github.com/users/Linaro/following{/other_user}","gists_url":"https://api.github.com/users/Linaro/gists{/gist_id}","starred_url":"https://api.github.com/users/Linaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Linaro/subscriptions","organizations_url":"https://api.github.com/users/Linaro/orgs","repos_url":"https://api.github.com/users/Linaro/repos","events_url":"https://api.github.com/users/Linaro/events{/privacy}","received_events_url":"https://api.github.com/users/Linaro/received_events","type":"Organization","site_admin":false},"repo":{"id":54223014,"name":"art-reports","full_name":"Linaro/art-reports","owner":{"login":"Linaro","id":1180626,"avatar_url":"https://avatars.githubusercontent.com/u/1180626?v=3","gravatar_id":"","url":"https://api.github.com/users/Linaro","html_url":"https://github.com/Linaro","followers_url":"https://api.github.com/users/Linaro/followers","following_url":"https://api.github.com/users/Linaro/following{/other_user}","gists_url":"https://api.github.com/users/Linaro/gists{/gist_id}","starred_url":"https://api.github.com/users/Linaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Linaro/subscriptions","organizations_url":"https://api.github.com/users/Linaro/orgs","repos_url":"https://api.github.com/users/Linaro/repos","events_url":"https://api.github.com/users/Linaro/events{/privacy}","received_events_url":"https://api.github.com/users/Linaro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Linaro/art-reports","description":"","fork":true,"url":"https://api.github.com/repos/Linaro/art-reports","forks_url":"https://api.github.com/repos/Linaro/art-reports/forks","keys_url":"https://api.github.com/repos/Linaro/art-reports/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Linaro/art-reports/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Linaro/art-reports/teams","hooks_url":"https://api.github.com/repos/Linaro/art-reports/hooks","issue_events_url":"https://api.github.com/repos/Linaro/art-reports/issues/events{/number}","events_url":"https://api.github.com/repos/Linaro/art-reports/events","assignees_url":"https://api.github.com/repos/Linaro/art-reports/assignees{/user}","branches_url":"https://api.github.com/repos/Linaro/art-reports/branches{/branch}","tags_url":"https://api.github.com/repos/Linaro/art-reports/tags","blobs_url":"https://api.github.com/repos/Linaro/art-reports/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Linaro/art-reports/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Linaro/art-reports/git/refs{/sha}","trees_url":"https://api.github.com/repos/Linaro/art-reports/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Linaro/art-reports/statuses/{sha}","languages_url":"https://api.github.com/repos/Linaro/art-reports/languages","stargazers_url":"https://api.github.com/repos/Linaro/art-reports/stargazers","contributors_url":"https://api.github.com/repos/Linaro/art-reports/contributors","subscribers_url":"https://api.github.com/repos/Linaro/art-reports/subscribers","subscription_url":"https://api.github.com/repos/Linaro/art-reports/subscription","commits_url":"https://api.github.com/repos/Linaro/art-reports/commits{/sha}","git_commits_url":"https://api.github.com/repos/Linaro/art-reports/git/commits{/sha}","comments_url":"https://api.github.com/repos/Linaro/art-reports/comments{/number}","issue_comment_url":"https://api.github.com/repos/Linaro/art-reports/issues/comments{/number}","contents_url":"https://api.github.com/repos/Linaro/art-reports/contents/{+path}","compare_url":"https://api.github.com/repos/Linaro/art-reports/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Linaro/art-reports/merges","archive_url":"https://api.github.com/repos/Linaro/art-reports/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Linaro/art-reports/downloads","issues_url":"https://api.github.com/repos/Linaro/art-reports/issues{/number}","pulls_url":"https://api.github.com/repos/Linaro/art-reports/pulls{/number}","milestones_url":"https://api.github.com/repos/Linaro/art-reports/milestones{/number}","notifications_url":"https://api.github.com/repos/Linaro/art-reports/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Linaro/art-reports/labels{/name}","releases_url":"https://api.github.com/repos/Linaro/art-reports/releases{/id}","deployments_url":"https://api.github.com/repos/Linaro/art-reports/deployments","created_at":"2016-03-18T18:25:40Z","updated_at":"2016-03-22T08:03:45Z","pushed_at":"2016-05-12T19:48:40Z","git_url":"git://github.com/Linaro/art-reports.git","ssh_url":"git@github.com:Linaro/art-reports.git","clone_url":"https://github.com/Linaro/art-reports.git","svn_url":"https://github.com/Linaro/art-reports","homepage":null,"size":6353,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Linaro/art-reports/pulls/44"},"html":{"href":"https://github.com/Linaro/art-reports/pull/44"},"issue":{"href":"https://api.github.com/repos/Linaro/art-reports/issues/44"},"comments":{"href":"https://api.github.com/repos/Linaro/art-reports/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/Linaro/art-reports/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/Linaro/art-reports/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Linaro/art-reports/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/Linaro/art-reports/statuses/283484d9d0d7080146975c16021ef6bc9c1a1fe0"}}}}