GitHub PullRequestReviewCommentEvent at 2014-10-16 09:44:30
Repository: taskrepo
Actor: kbajey
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/kbajey/taskrepo/pulls/comments/18946297","id":18946297,"diff_hunk":"@@ -0,0 +1,163 @@\n+import re\n+import json\n+import gzip\n+import urllib2\n+import random\n+\n+search_log = gzip.open(\"./search_sample_log.gz\",\"r\")\n+\n+es_config = {'es_host':'localhost', 'es_port':'9200', 'es_index':'logs', 'es_type':'search'}\n+\n+# form elastic search query url using elasticsearch config\n+def get_es_url(es_config,query_type):\n+    es_url = \"http://%s:%s/%s/%s/\" % (es_config['es_host'], es_config['es_port'], es_config['es_index'], es_config['es_type'])\n+    if query_type:\n+        es_url += query_type\n+        return es_url\n+    return None\n+\n+# get the count of matching documents from elasticsearch\n+def get_doc_count_from_es(query_string):\n+    global es_config\n+    es_url = get_es_url(es_config,'_count')\n+    if es_url and query_string:\n+        es_conn = urllib2.urlopen(es_url, query_string)\n+        es_doc = es_conn.read()\n+        es_doc_dict = json.loads(es_doc)\n+        if es_doc_dict:\n+            return es_doc_dict['count']\n+    return None","path":"logs_parser/parse_index_search_logs.py","position":29,"original_position":29,"commit_id":"202332eb611926e88697106cd97546200d8fa17a","original_commit_id":"202332eb611926e88697106cd97546200d8fa17a","user":{"login":"kbajey","id":2964722,"avatar_url":"https://avatars.githubusercontent.com/u/2964722?v=2","gravatar_id":"","url":"https://api.github.com/users/kbajey","html_url":"https://github.com/kbajey","followers_url":"https://api.github.com/users/kbajey/followers","following_url":"https://api.github.com/users/kbajey/following{/other_user}","gists_url":"https://api.github.com/users/kbajey/gists{/gist_id}","starred_url":"https://api.github.com/users/kbajey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbajey/subscriptions","organizations_url":"https://api.github.com/users/kbajey/orgs","repos_url":"https://api.github.com/users/kbajey/repos","events_url":"https://api.github.com/users/kbajey/events{/privacy}","received_events_url":"https://api.github.com/users/kbajey/received_events","type":"User","site_admin":false},"body":"Let's default the count to zero, not None.","created_at":"2014-10-16T09:44:30Z","updated_at":"2014-10-16T09:44:30Z","html_url":"https://github.com/kbajey/taskrepo/pull/1#discussion_r18946297","pull_request_url":"https://api.github.com/repos/kbajey/taskrepo/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/kbajey/taskrepo/pulls/comments/18946297"},"html":{"href":"https://github.com/kbajey/taskrepo/pull/1#discussion_r18946297"},"pull_request":{"href":"https://api.github.com/repos/kbajey/taskrepo/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/kbajey/taskrepo/pulls/1","id":22740236,"html_url":"https://github.com/kbajey/taskrepo/pull/1","diff_url":"https://github.com/kbajey/taskrepo/pull/1.diff","patch_url":"https://github.com/kbajey/taskrepo/pull/1.patch","issue_url":"https://api.github.com/repos/kbajey/taskrepo/issues/1","number":1,"state":"open","locked":false,"title":"Commiting part 1 of the problem statement which involves parsing logs, b...","user":{"login":"darshpatel27","id":2465610,"avatar_url":"https://avatars.githubusercontent.com/u/2465610?v=2","gravatar_id":"","url":"https://api.github.com/users/darshpatel27","html_url":"https://github.com/darshpatel27","followers_url":"https://api.github.com/users/darshpatel27/followers","following_url":"https://api.github.com/users/darshpatel27/following{/other_user}","gists_url":"https://api.github.com/users/darshpatel27/gists{/gist_id}","starred_url":"https://api.github.com/users/darshpatel27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darshpatel27/subscriptions","organizations_url":"https://api.github.com/users/darshpatel27/orgs","repos_url":"https://api.github.com/users/darshpatel27/repos","events_url":"https://api.github.com/users/darshpatel27/events{/privacy}","received_events_url":"https://api.github.com/users/darshpatel27/received_events","type":"User","site_admin":false},"body":"...uilding documents and indexing them into ES","created_at":"2014-10-14T20:24:28Z","updated_at":"2014-10-16T09:44:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9ca4492822bb0f1ae4c6750c0c8c1ec8137b4b7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kbajey/taskrepo/pulls/1/commits","review_comments_url":"https://api.github.com/repos/kbajey/taskrepo/pulls/1/comments","review_comment_url":"https://api.github.com/repos/kbajey/taskrepo/pulls/comments/{number}","comments_url":"https://api.github.com/repos/kbajey/taskrepo/issues/1/comments","statuses_url":"https://api.github.com/repos/kbajey/taskrepo/statuses/202332eb611926e88697106cd97546200d8fa17a","head":{"label":"kbajey:darshan","ref":"darshan","sha":"202332eb611926e88697106cd97546200d8fa17a","user":{"login":"kbajey","id":2964722,"avatar_url":"https://avatars.githubusercontent.com/u/2964722?v=2","gravatar_id":"","url":"https://api.github.com/users/kbajey","html_url":"https://github.com/kbajey","followers_url":"https://api.github.com/users/kbajey/followers","following_url":"https://api.github.com/users/kbajey/following{/other_user}","gists_url":"https://api.github.com/users/kbajey/gists{/gist_id}","starred_url":"https://api.github.com/users/kbajey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbajey/subscriptions","organizations_url":"https://api.github.com/users/kbajey/orgs","repos_url":"https://api.github.com/users/kbajey/repos","events_url":"https://api.github.com/users/kbajey/events{/privacy}","received_events_url":"https://api.github.com/users/kbajey/received_events","type":"User","site_admin":false},"repo":{"id":24832237,"name":"taskrepo","full_name":"kbajey/taskrepo","owner":{"login":"kbajey","id":2964722,"avatar_url":"https://avatars.githubusercontent.com/u/2964722?v=2","gravatar_id":"","url":"https://api.github.com/users/kbajey","html_url":"https://github.com/kbajey","followers_url":"https://api.github.com/users/kbajey/followers","following_url":"https://api.github.com/users/kbajey/following{/other_user}","gists_url":"https://api.github.com/users/kbajey/gists{/gist_id}","starred_url":"https://api.github.com/users/kbajey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbajey/subscriptions","organizations_url":"https://api.github.com/users/kbajey/orgs","repos_url":"https://api.github.com/users/kbajey/repos","events_url":"https://api.github.com/users/kbajey/events{/privacy}","received_events_url":"https://api.github.com/users/kbajey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kbajey/taskrepo","description":"Test repository for the test task.","fork":false,"url":"https://api.github.com/repos/kbajey/taskrepo","forks_url":"https://api.github.com/repos/kbajey/taskrepo/forks","keys_url":"https://api.github.com/repos/kbajey/taskrepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbajey/taskrepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbajey/taskrepo/teams","hooks_url":"https://api.github.com/repos/kbajey/taskrepo/hooks","issue_events_url":"https://api.github.com/repos/kbajey/taskrepo/issues/events{/number}","events_url":"https://api.github.com/repos/kbajey/taskrepo/events","assignees_url":"https://api.github.com/repos/kbajey/taskrepo/assignees{/user}","branches_url":"https://api.github.com/repos/kbajey/taskrepo/branches{/branch}","tags_url":"https://api.github.com/repos/kbajey/taskrepo/tags","blobs_url":"https://api.github.com/repos/kbajey/taskrepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbajey/taskrepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbajey/taskrepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbajey/taskrepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbajey/taskrepo/statuses/{sha}","languages_url":"https://api.github.com/repos/kbajey/taskrepo/languages","stargazers_url":"https://api.github.com/repos/kbajey/taskrepo/stargazers","contributors_url":"https://api.github.com/repos/kbajey/taskrepo/contributors","subscribers_url":"https://api.github.com/repos/kbajey/taskrepo/subscribers","subscription_url":"https://api.github.com/repos/kbajey/taskrepo/subscription","commits_url":"https://api.github.com/repos/kbajey/taskrepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbajey/taskrepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbajey/taskrepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbajey/taskrepo/issues/comments/{number}","contents_url":"https://api.github.com/repos/kbajey/taskrepo/contents/{+path}","compare_url":"https://api.github.com/repos/kbajey/taskrepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbajey/taskrepo/merges","archive_url":"https://api.github.com/repos/kbajey/taskrepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbajey/taskrepo/downloads","issues_url":"https://api.github.com/repos/kbajey/taskrepo/issues{/number}","pulls_url":"https://api.github.com/repos/kbajey/taskrepo/pulls{/number}","milestones_url":"https://api.github.com/repos/kbajey/taskrepo/milestones{/number}","notifications_url":"https://api.github.com/repos/kbajey/taskrepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbajey/taskrepo/labels{/name}","releases_url":"https://api.github.com/repos/kbajey/taskrepo/releases{/id}","created_at":"2014-10-06T02:43:53Z","updated_at":"2014-10-06T04:51:16Z","pushed_at":"2014-10-16T09:33:41Z","git_url":"git://github.com/kbajey/taskrepo.git","ssh_url":"git@github.com:kbajey/taskrepo.git","clone_url":"https://github.com/kbajey/taskrepo.git","svn_url":"https://github.com/kbajey/taskrepo","homepage":null,"size":136,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":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":"kbajey:master","ref":"master","sha":"9e5585e87873d2717a7100ff77eaf4613b6a9af3","user":{"login":"kbajey","id":2964722,"avatar_url":"https://avatars.githubusercontent.com/u/2964722?v=2","gravatar_id":"","url":"https://api.github.com/users/kbajey","html_url":"https://github.com/kbajey","followers_url":"https://api.github.com/users/kbajey/followers","following_url":"https://api.github.com/users/kbajey/following{/other_user}","gists_url":"https://api.github.com/users/kbajey/gists{/gist_id}","starred_url":"https://api.github.com/users/kbajey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbajey/subscriptions","organizations_url":"https://api.github.com/users/kbajey/orgs","repos_url":"https://api.github.com/users/kbajey/repos","events_url":"https://api.github.com/users/kbajey/events{/privacy}","received_events_url":"https://api.github.com/users/kbajey/received_events","type":"User","site_admin":false},"repo":{"id":24832237,"name":"taskrepo","full_name":"kbajey/taskrepo","owner":{"login":"kbajey","id":2964722,"avatar_url":"https://avatars.githubusercontent.com/u/2964722?v=2","gravatar_id":"","url":"https://api.github.com/users/kbajey","html_url":"https://github.com/kbajey","followers_url":"https://api.github.com/users/kbajey/followers","following_url":"https://api.github.com/users/kbajey/following{/other_user}","gists_url":"https://api.github.com/users/kbajey/gists{/gist_id}","starred_url":"https://api.github.com/users/kbajey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbajey/subscriptions","organizations_url":"https://api.github.com/users/kbajey/orgs","repos_url":"https://api.github.com/users/kbajey/repos","events_url":"https://api.github.com/users/kbajey/events{/privacy}","received_events_url":"https://api.github.com/users/kbajey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kbajey/taskrepo","description":"Test repository for the test task.","fork":false,"url":"https://api.github.com/repos/kbajey/taskrepo","forks_url":"https://api.github.com/repos/kbajey/taskrepo/forks","keys_url":"https://api.github.com/repos/kbajey/taskrepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbajey/taskrepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbajey/taskrepo/teams","hooks_url":"https://api.github.com/repos/kbajey/taskrepo/hooks","issue_events_url":"https://api.github.com/repos/kbajey/taskrepo/issues/events{/number}","events_url":"https://api.github.com/repos/kbajey/taskrepo/events","assignees_url":"https://api.github.com/repos/kbajey/taskrepo/assignees{/user}","branches_url":"https://api.github.com/repos/kbajey/taskrepo/branches{/branch}","tags_url":"https://api.github.com/repos/kbajey/taskrepo/tags","blobs_url":"https://api.github.com/repos/kbajey/taskrepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbajey/taskrepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbajey/taskrepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbajey/taskrepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbajey/taskrepo/statuses/{sha}","languages_url":"https://api.github.com/repos/kbajey/taskrepo/languages","stargazers_url":"https://api.github.com/repos/kbajey/taskrepo/stargazers","contributors_url":"https://api.github.com/repos/kbajey/taskrepo/contributors","subscribers_url":"https://api.github.com/repos/kbajey/taskrepo/subscribers","subscription_url":"https://api.github.com/repos/kbajey/taskrepo/subscription","commits_url":"https://api.github.com/repos/kbajey/taskrepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbajey/taskrepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbajey/taskrepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbajey/taskrepo/issues/comments/{number}","contents_url":"https://api.github.com/repos/kbajey/taskrepo/contents/{+path}","compare_url":"https://api.github.com/repos/kbajey/taskrepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbajey/taskrepo/merges","archive_url":"https://api.github.com/repos/kbajey/taskrepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbajey/taskrepo/downloads","issues_url":"https://api.github.com/repos/kbajey/taskrepo/issues{/number}","pulls_url":"https://api.github.com/repos/kbajey/taskrepo/pulls{/number}","milestones_url":"https://api.github.com/repos/kbajey/taskrepo/milestones{/number}","notifications_url":"https://api.github.com/repos/kbajey/taskrepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbajey/taskrepo/labels{/name}","releases_url":"https://api.github.com/repos/kbajey/taskrepo/releases{/id}","created_at":"2014-10-06T02:43:53Z","updated_at":"2014-10-06T04:51:16Z","pushed_at":"2014-10-16T09:33:41Z","git_url":"git://github.com/kbajey/taskrepo.git","ssh_url":"git@github.com:kbajey/taskrepo.git","clone_url":"https://github.com/kbajey/taskrepo.git","svn_url":"https://github.com/kbajey/taskrepo","homepage":null,"size":136,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":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/kbajey/taskrepo/pulls/1"},"html":{"href":"https://github.com/kbajey/taskrepo/pull/1"},"issue":{"href":"https://api.github.com/repos/kbajey/taskrepo/issues/1"},"comments":{"href":"https://api.github.com/repos/kbajey/taskrepo/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/kbajey/taskrepo/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/kbajey/taskrepo/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/kbajey/taskrepo/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/kbajey/taskrepo/statuses/202332eb611926e88697106cd97546200d8fa17a"}}}}