{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/test-infra/pulls/comments/72724146","id":72724146,"diff_hunk":"@@ -0,0 +1,189 @@\n+# Copyright 2016 The Kubernetes Authors All rights reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+import cgi\n+import datetime\n+import hashlib\n+import hmac\n+import logging\n+import json\n+import zlib\n+\n+import webapp2\n+\n+from google.appengine.api import taskqueue\n+from google.appengine.ext import deferred, ndb\n+from google.appengine.datastore.datastore_query import Cursor\n+\n+import models\n+\n+\n+try:\n+    WEBHOOK_SECRET = open('webhook_secret').read().strip()\n+except IOError:\n+    logging.warning('unable to load webhook secret')\n+    WEBHOOK_SECRET = 'default'\n+\n+def secure_equal(a, b):\n+    '''\n+    Compare a and b without leaking timing information.\n+\n+    May reveal length of b.\n+    '''\n+    if len(a) != len(b):\n+        return False\n+    return sum(ord(a[i]) ^ ord(b[i]) for i in xrange(len(a))) == 0\n+\n+\n+def make_signature(body):\n+    hmac_instance = hmac.HMAC(WEBHOOK_SECRET, body, hashlib.sha1)\n+    return 'sha1=' + hmac_instance.hexdigest()\n+\n+\n+class GithubHandler(webapp2.RequestHandler):\n+    def post(self):\n+        event = self.request.headers.get('x-github-event')\n+        signature = self.request.headers.get('x-hub-signature', '')\n+        body = self.request.body\n+        body_json = json.loads(body)","path":"gubernator/github/handlers.py","position":60,"original_position":59,"commit_id":"5e0bafd63bcd77b5b04510ec4b94f3e5dbbb5e12","original_commit_id":"2efd9ed697b8c216530741d9c70ee609815199bc","user":{"login":"rmmh","id":211868,"avatar_url":"https://avatars.githubusercontent.com/u/211868?v=3","gravatar_id":"","url":"https://api.github.com/users/rmmh","html_url":"https://github.com/rmmh","followers_url":"https://api.github.com/users/rmmh/followers","following_url":"https://api.github.com/users/rmmh/following{/other_user}","gists_url":"https://api.github.com/users/rmmh/gists{/gist_id}","starred_url":"https://api.github.com/users/rmmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmmh/subscriptions","organizations_url":"https://api.github.com/users/rmmh/orgs","repos_url":"https://api.github.com/users/rmmh/repos","events_url":"https://api.github.com/users/rmmh/events{/privacy}","received_events_url":"https://api.github.com/users/rmmh/received_events","type":"User","site_admin":false},"body":"Good point, I'll fix it.","created_at":"2016-07-28T23:59:03Z","updated_at":"2016-07-28T23:59:03Z","html_url":"https://github.com/kubernetes/test-infra/pull/310#discussion_r72724146","pull_request_url":"https://api.github.com/repos/kubernetes/test-infra/pulls/310","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/comments/72724146"},"html":{"href":"https://github.com/kubernetes/test-infra/pull/310#discussion_r72724146"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/310"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/test-infra/pulls/310","id":78754103,"html_url":"https://github.com/kubernetes/test-infra/pull/310","diff_url":"https://github.com/kubernetes/test-infra/pull/310.diff","patch_url":"https://github.com/kubernetes/test-infra/pull/310.patch","issue_url":"https://api.github.com/repos/kubernetes/test-infra/issues/310","number":310,"state":"open","locked":false,"title":"Github PR Dashboard","user":{"login":"rmmh","id":211868,"avatar_url":"https://avatars.githubusercontent.com/u/211868?v=3","gravatar_id":"","url":"https://api.github.com/users/rmmh","html_url":"https://github.com/rmmh","followers_url":"https://api.github.com/users/rmmh/followers","following_url":"https://api.github.com/users/rmmh/following{/other_user}","gists_url":"https://api.github.com/users/rmmh/gists{/gist_id}","starred_url":"https://api.github.com/users/rmmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmmh/subscriptions","organizations_url":"https://api.github.com/users/rmmh/orgs","repos_url":"https://api.github.com/users/rmmh/repos","events_url":"https://api.github.com/users/rmmh/events{/privacy}","received_events_url":"https://api.github.com/users/rmmh/received_events","type":"User","site_admin":false},"body":"There's more to do, but I think this is a good checkpoint for a code review.","created_at":"2016-07-25T21:19:05Z","updated_at":"2016-07-28T23:59:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80897bbbee808400cd89310085b87fdaf3c09cc2","assignee":{"login":"spxtr","id":7368979,"avatar_url":"https://avatars.githubusercontent.com/u/7368979?v=3","gravatar_id":"","url":"https://api.github.com/users/spxtr","html_url":"https://github.com/spxtr","followers_url":"https://api.github.com/users/spxtr/followers","following_url":"https://api.github.com/users/spxtr/following{/other_user}","gists_url":"https://api.github.com/users/spxtr/gists{/gist_id}","starred_url":"https://api.github.com/users/spxtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spxtr/subscriptions","organizations_url":"https://api.github.com/users/spxtr/orgs","repos_url":"https://api.github.com/users/spxtr/repos","events_url":"https://api.github.com/users/spxtr/events{/privacy}","received_events_url":"https://api.github.com/users/spxtr/received_events","type":"User","site_admin":false},"assignees":[{"login":"spxtr","id":7368979,"avatar_url":"https://avatars.githubusercontent.com/u/7368979?v=3","gravatar_id":"","url":"https://api.github.com/users/spxtr","html_url":"https://github.com/spxtr","followers_url":"https://api.github.com/users/spxtr/followers","following_url":"https://api.github.com/users/spxtr/following{/other_user}","gists_url":"https://api.github.com/users/spxtr/gists{/gist_id}","starred_url":"https://api.github.com/users/spxtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spxtr/subscriptions","organizations_url":"https://api.github.com/users/spxtr/orgs","repos_url":"https://api.github.com/users/spxtr/repos","events_url":"https://api.github.com/users/spxtr/events{/privacy}","received_events_url":"https://api.github.com/users/spxtr/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/test-infra/pulls/310/commits","review_comments_url":"https://api.github.com/repos/kubernetes/test-infra/pulls/310/comments","review_comment_url":"https://api.github.com/repos/kubernetes/test-infra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/test-infra/issues/310/comments","statuses_url":"https://api.github.com/repos/kubernetes/test-infra/statuses/5e0bafd63bcd77b5b04510ec4b94f3e5dbbb5e12","head":{"label":"rmmh:g8r-gh","ref":"g8r-gh","sha":"5e0bafd63bcd77b5b04510ec4b94f3e5dbbb5e12","user":{"login":"rmmh","id":211868,"avatar_url":"https://avatars.githubusercontent.com/u/211868?v=3","gravatar_id":"","url":"https://api.github.com/users/rmmh","html_url":"https://github.com/rmmh","followers_url":"https://api.github.com/users/rmmh/followers","following_url":"https://api.github.com/users/rmmh/following{/other_user}","gists_url":"https://api.github.com/users/rmmh/gists{/gist_id}","starred_url":"https://api.github.com/users/rmmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmmh/subscriptions","organizations_url":"https://api.github.com/users/rmmh/orgs","repos_url":"https://api.github.com/users/rmmh/repos","events_url":"https://api.github.com/users/rmmh/events{/privacy}","received_events_url":"https://api.github.com/users/rmmh/received_events","type":"User","site_admin":false},"repo":{"id":57414245,"name":"kubernetes-test-infra","full_name":"rmmh/kubernetes-test-infra","owner":{"login":"rmmh","id":211868,"avatar_url":"https://avatars.githubusercontent.com/u/211868?v=3","gravatar_id":"","url":"https://api.github.com/users/rmmh","html_url":"https://github.com/rmmh","followers_url":"https://api.github.com/users/rmmh/followers","following_url":"https://api.github.com/users/rmmh/following{/other_user}","gists_url":"https://api.github.com/users/rmmh/gists{/gist_id}","starred_url":"https://api.github.com/users/rmmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmmh/subscriptions","organizations_url":"https://api.github.com/users/rmmh/orgs","repos_url":"https://api.github.com/users/rmmh/repos","events_url":"https://api.github.com/users/rmmh/events{/privacy}","received_events_url":"https://api.github.com/users/rmmh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rmmh/kubernetes-test-infra","description":"Test infrastructure for the Kubernetes project.","fork":true,"url":"https://api.github.com/repos/rmmh/kubernetes-test-infra","forks_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/forks","keys_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/teams","hooks_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/hooks","issue_events_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/issues/events{/number}","events_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/events","assignees_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/assignees{/user}","branches_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/branches{/branch}","tags_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/tags","blobs_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/statuses/{sha}","languages_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/languages","stargazers_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/stargazers","contributors_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/contributors","subscribers_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/subscribers","subscription_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/subscription","commits_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/contents/{+path}","compare_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/merges","archive_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/downloads","issues_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/issues{/number}","pulls_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/pulls{/number}","milestones_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/milestones{/number}","notifications_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/labels{/name}","releases_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/releases{/id}","deployments_url":"https://api.github.com/repos/rmmh/kubernetes-test-infra/deployments","created_at":"2016-04-29T21:34:00Z","updated_at":"2016-04-29T21:34:10Z","pushed_at":"2016-07-28T01:40:56Z","git_url":"git://github.com/rmmh/kubernetes-test-infra.git","ssh_url":"git@github.com:rmmh/kubernetes-test-infra.git","clone_url":"https://github.com/rmmh/kubernetes-test-infra.git","svn_url":"https://github.com/rmmh/kubernetes-test-infra","homepage":null,"size":973,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"kubernetes:master","ref":"master","sha":"b0c616f488d5335a4cb07c1b3f1bc548ebd7cabc","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":57333709,"name":"test-infra","full_name":"kubernetes/test-infra","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/test-infra","description":"Test infrastructure for the Kubernetes project.","fork":false,"url":"https://api.github.com/repos/kubernetes/test-infra","forks_url":"https://api.github.com/repos/kubernetes/test-infra/forks","keys_url":"https://api.github.com/repos/kubernetes/test-infra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/test-infra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/test-infra/teams","hooks_url":"https://api.github.com/repos/kubernetes/test-infra/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/test-infra/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/test-infra/events","assignees_url":"https://api.github.com/repos/kubernetes/test-infra/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/test-infra/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/test-infra/tags","blobs_url":"https://api.github.com/repos/kubernetes/test-infra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/test-infra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/test-infra/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/test-infra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/test-infra/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/test-infra/languages","stargazers_url":"https://api.github.com/repos/kubernetes/test-infra/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/test-infra/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/test-infra/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/test-infra/subscription","commits_url":"https://api.github.com/repos/kubernetes/test-infra/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/test-infra/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/test-infra/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/test-infra/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/test-infra/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/test-infra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/test-infra/merges","archive_url":"https://api.github.com/repos/kubernetes/test-infra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/test-infra/downloads","issues_url":"https://api.github.com/repos/kubernetes/test-infra/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/test-infra/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/test-infra/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/test-infra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/test-infra/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/test-infra/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/test-infra/deployments","created_at":"2016-04-28T21:05:35Z","updated_at":"2016-07-28T09:05:40Z","pushed_at":"2016-07-28T23:41:16Z","git_url":"git://github.com/kubernetes/test-infra.git","ssh_url":"git@github.com:kubernetes/test-infra.git","clone_url":"https://github.com/kubernetes/test-infra.git","svn_url":"https://github.com/kubernetes/test-infra","homepage":null,"size":1439,"stargazers_count":10,"watchers_count":10,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":36,"forks":44,"open_issues":36,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/310"},"html":{"href":"https://github.com/kubernetes/test-infra/pull/310"},"issue":{"href":"https://api.github.com/repos/kubernetes/test-infra/issues/310"},"comments":{"href":"https://api.github.com/repos/kubernetes/test-infra/issues/310/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/310/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/310/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/test-infra/statuses/5e0bafd63bcd77b5b04510ec4b94f3e5dbbb5e12"}}}}
{"actor":{"display_login":"rmmh"}}