{"action":"created","comment":{"url":"https://api.github.com/repos/DoSomething/bertly/pulls/comments/186608425","pull_request_review_id":118218647,"id":186608425,"diff_hunk":"@@ -0,0 +1,59 @@\n+# -*- coding: utf-8 -*-\n+\"\"\"\n+    clicks_dynamodb.py\n+    ~~~~~~~~~~~~~~\n+\n+    Use this config & logic to record clicks to DynamoDB instead of\n+    PostgresQL.\n+\n+    :license: MIT, see LICENSE for details\n+\"\"\"\n+\n+# Click tracking table\n+click_table = os.environ.get('CLICK_TABLE')\n+\n+# DynamoDB click tracking config\n+if is_offline:\n+    dynamo_client = boto3.client(","path":"clicks_dynamodb.py","position":17,"original_position":17,"commit_id":"0f3614f8d0a1cf673dcb5235ab6c2f2df284c339","original_commit_id":"67fa28b70c1c249c7b20bc796d99e37db8b0eaa2","user":{"login":"stickler-ci","id":16011037,"avatar_url":"https://avatars3.githubusercontent.com/u/16011037?v=4","gravatar_id":"","url":"https://api.github.com/users/stickler-ci","html_url":"https://github.com/stickler-ci","followers_url":"https://api.github.com/users/stickler-ci/followers","following_url":"https://api.github.com/users/stickler-ci/following{/other_user}","gists_url":"https://api.github.com/users/stickler-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/stickler-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickler-ci/subscriptions","organizations_url":"https://api.github.com/users/stickler-ci/orgs","repos_url":"https://api.github.com/users/stickler-ci/repos","events_url":"https://api.github.com/users/stickler-ci/events{/privacy}","received_events_url":"https://api.github.com/users/stickler-ci/received_events","type":"User","site_admin":false},"body":"F821 undefined name 'boto3'","created_at":"2018-05-08T03:27:08Z","updated_at":"2018-05-08T03:27:09Z","html_url":"https://github.com/DoSomething/bertly/pull/17#discussion_r186608425","pull_request_url":"https://api.github.com/repos/DoSomething/bertly/pulls/17","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DoSomething/bertly/pulls/comments/186608425"},"html":{"href":"https://github.com/DoSomething/bertly/pull/17#discussion_r186608425"},"pull_request":{"href":"https://api.github.com/repos/DoSomething/bertly/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/DoSomething/bertly/pulls/17","id":186517525,"html_url":"https://github.com/DoSomething/bertly/pull/17","diff_url":"https://github.com/DoSomething/bertly/pull/17.diff","patch_url":"https://github.com/DoSomething/bertly/pull/17.patch","issue_url":"https://api.github.com/repos/DoSomething/bertly/issues/17","number":17,"state":"open","locked":false,"title":"Clicks postgres","user":{"login":"mshmsh5000","id":149811,"avatar_url":"https://avatars0.githubusercontent.com/u/149811?v=4","gravatar_id":"","url":"https://api.github.com/users/mshmsh5000","html_url":"https://github.com/mshmsh5000","followers_url":"https://api.github.com/users/mshmsh5000/followers","following_url":"https://api.github.com/users/mshmsh5000/following{/other_user}","gists_url":"https://api.github.com/users/mshmsh5000/gists{/gist_id}","starred_url":"https://api.github.com/users/mshmsh5000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshmsh5000/subscriptions","organizations_url":"https://api.github.com/users/mshmsh5000/orgs","repos_url":"https://api.github.com/users/mshmsh5000/repos","events_url":"https://api.github.com/users/mshmsh5000/events{/privacy}","received_events_url":"https://api.github.com/users/mshmsh5000/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\n\r\nThis PR provides the Serverless integration pieces that map a custom domain to the app.\r\n\r\n#### How should this be reviewed?\r\n\r\nRunning locally, you can invoke the server with Postgres connection credentials:\r\n\r\n```\r\nPOSTGRESQL_USER=\"myuser\" POSTGRESQL_DB=\"bertly_clicks\" POSTGRESQL_HOST=\"localhost\" POSTGRESQL_PORT=\"5432\" CLICK_TABLE=\"clicks\" COMPOSE_REDIS_URL=\"redis://user:pass@redisserver.com:12345\" BERTLY_API_KEY_NAME=\"X-BERTLY-API-KEY\" BERTLY_API_KEY=\"testing\" sls  wsgi serve\r\n```\r\n\r\nYou'll need to run the migration command to create the table: `python manage.py db upgrade`\r\n\r\nThis creates the `clicks` table.\r\n\r\nWhen you make a request to a shortened URL, you should see entries in `clicks`:\r\n\r\n```\r\nbertly_clicks=# SELECT * FROM clicks;\r\n     click_id     |         click_time         | shortened |            target_url\r\n------------------+----------------------------+-----------+----------------------------------\r\n 3Fu1525487501.41 | 2018-05-05 02:31:41.405265 | 3Fu       | https://www.nytimes.com/\r\n 3Fu1525487608.36 | 2018-05-05 02:33:28.35897  | 3Fu       | https://www.nytimes.com/\r\n 3Fu1525487608.38 | 2018-05-05 02:33:28.378791 | 3Fu       | https://www.nytimes.com/\r\n```\r\n\r\n#### Any background context you want to provide?\r\n\r\nThis uses SQLAlchemy as the ORM, and Alembic for migrations. There's only one migration.\r\n\r\n#### Relevant tickets\r\n\r\n#16 \r\n\r\n#### Checklist\r\n- [x] Documentation added for new features/changed endpoints.\r\n- [x] Tested on staging.\r\n","created_at":"2018-05-08T03:26:53Z","updated_at":"2018-05-08T03:27:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"127e1e37a5c8cff4112e5da0fa4d8ae14d8830a0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/bertly/pulls/17/commits","review_comments_url":"https://api.github.com/repos/DoSomething/bertly/pulls/17/comments","review_comment_url":"https://api.github.com/repos/DoSomething/bertly/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/bertly/issues/17/comments","statuses_url":"https://api.github.com/repos/DoSomething/bertly/statuses/0f3614f8d0a1cf673dcb5235ab6c2f2df284c339","head":{"label":"DoSomething:clicks_postgres","ref":"clicks_postgres","sha":"0f3614f8d0a1cf673dcb5235ab6c2f2df284c339","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":125567566,"name":"bertly","full_name":"DoSomething/bertly","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/bertly","description":"A URL shortener built in Flask","fork":false,"url":"https://api.github.com/repos/DoSomething/bertly","forks_url":"https://api.github.com/repos/DoSomething/bertly/forks","keys_url":"https://api.github.com/repos/DoSomething/bertly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/bertly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/bertly/teams","hooks_url":"https://api.github.com/repos/DoSomething/bertly/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/bertly/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/bertly/events","assignees_url":"https://api.github.com/repos/DoSomething/bertly/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/bertly/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/bertly/tags","blobs_url":"https://api.github.com/repos/DoSomething/bertly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/bertly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/bertly/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/bertly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/bertly/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/bertly/languages","stargazers_url":"https://api.github.com/repos/DoSomething/bertly/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/bertly/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/bertly/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/bertly/subscription","commits_url":"https://api.github.com/repos/DoSomething/bertly/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/bertly/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/bertly/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/bertly/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/bertly/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/bertly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/bertly/merges","archive_url":"https://api.github.com/repos/DoSomething/bertly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/bertly/downloads","issues_url":"https://api.github.com/repos/DoSomething/bertly/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/bertly/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/bertly/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/bertly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/bertly/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/bertly/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/bertly/deployments","created_at":"2018-03-16T20:39:58Z","updated_at":"2018-05-04T20:00:30Z","pushed_at":"2018-05-08T03:27:05Z","git_url":"git://github.com/DoSomething/bertly.git","ssh_url":"git@github.com:DoSomething/bertly.git","clone_url":"https://github.com/DoSomething/bertly.git","svn_url":"https://github.com/DoSomething/bertly","homepage":null,"size":170,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"DoSomething:master","ref":"master","sha":"4268836e3a487a50a679f26b714a125b73b9500c","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":125567566,"name":"bertly","full_name":"DoSomething/bertly","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/bertly","description":"A URL shortener built in Flask","fork":false,"url":"https://api.github.com/repos/DoSomething/bertly","forks_url":"https://api.github.com/repos/DoSomething/bertly/forks","keys_url":"https://api.github.com/repos/DoSomething/bertly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/bertly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/bertly/teams","hooks_url":"https://api.github.com/repos/DoSomething/bertly/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/bertly/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/bertly/events","assignees_url":"https://api.github.com/repos/DoSomething/bertly/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/bertly/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/bertly/tags","blobs_url":"https://api.github.com/repos/DoSomething/bertly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/bertly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/bertly/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/bertly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/bertly/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/bertly/languages","stargazers_url":"https://api.github.com/repos/DoSomething/bertly/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/bertly/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/bertly/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/bertly/subscription","commits_url":"https://api.github.com/repos/DoSomething/bertly/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/bertly/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/bertly/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/bertly/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/bertly/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/bertly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/bertly/merges","archive_url":"https://api.github.com/repos/DoSomething/bertly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/bertly/downloads","issues_url":"https://api.github.com/repos/DoSomething/bertly/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/bertly/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/bertly/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/bertly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/bertly/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/bertly/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/bertly/deployments","created_at":"2018-03-16T20:39:58Z","updated_at":"2018-05-04T20:00:30Z","pushed_at":"2018-05-08T03:27:05Z","git_url":"git://github.com/DoSomething/bertly.git","ssh_url":"git@github.com:DoSomething/bertly.git","clone_url":"https://github.com/DoSomething/bertly.git","svn_url":"https://github.com/DoSomething/bertly","homepage":null,"size":170,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/bertly/pulls/17"},"html":{"href":"https://github.com/DoSomething/bertly/pull/17"},"issue":{"href":"https://api.github.com/repos/DoSomething/bertly/issues/17"},"comments":{"href":"https://api.github.com/repos/DoSomething/bertly/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/bertly/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/bertly/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/bertly/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/bertly/statuses/0f3614f8d0a1cf673dcb5235ab6c2f2df284c339"}},"author_association":"OWNER"}}
{"actor":{"display_login":"stickler-ci"}}