{"action":"created","comment":{"url":"https://api.github.com/repos/release-engineering/purview-api/pulls/comments/176831247","pull_request_review_id":106608886,"id":176831247,"diff_hunk":"@@ -0,0 +1,35 @@\n+# SPDX-License-Identifier: GPL-3.0+\n+\n+import re\n+import logging\n+from datetime import datetime\n+\n+log = logging.getLogger(__name__)\n+\n+\n+def timestamp_to_datetime(timestamp):\n+    \"\"\"\n+    Parses a timestamp and return a datetime object\n+    :param timestamp: a string of a timestamp\n+    :return: a datetime object\n+    \"\"\"\n+    log.debug('Trying to parse the timestamp \"{0}\"'.format(timestamp))\n+    error_msg = 'The timestamp \"{0}\" is an invalid format'.format(timestamp)\n+    combinations = (\n+        (r'^(?P<datetime>\\d{4}-\\d{1,2}-\\d{1,2} \\d{1,2}:\\d{1,2}:\\d{1,2})(?:\\.\\d+)?$',\n+         '%Y-%m-%d %H:%M:%S'),\n+        (r'^(?P<datetime>\\d{4}-\\d{1,2}-\\d{1,2})$', '%Y-%m-%d'),\n+        (r'^(?P<datetime>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})(?:\\.\\d+)?(?:Z|[-+]00(?::00)?)?$',","path":"purview/utils/general.py","position":22,"original_position":22,"commit_id":"97c92afa03160cab663b7c89aac7fe796e224d42","original_commit_id":"97c92afa03160cab663b7c89aac7fe796e224d42","user":{"login":"yashvardhannanavati","id":22090997,"avatar_url":"https://avatars2.githubusercontent.com/u/22090997?v=4","gravatar_id":"","url":"https://api.github.com/users/yashvardhannanavati","html_url":"https://github.com/yashvardhannanavati","followers_url":"https://api.github.com/users/yashvardhannanavati/followers","following_url":"https://api.github.com/users/yashvardhannanavati/following{/other_user}","gists_url":"https://api.github.com/users/yashvardhannanavati/gists{/gist_id}","starred_url":"https://api.github.com/users/yashvardhannanavati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yashvardhannanavati/subscriptions","organizations_url":"https://api.github.com/users/yashvardhannanavati/orgs","repos_url":"https://api.github.com/users/yashvardhannanavati/repos","events_url":"https://api.github.com/users/yashvardhannanavati/events{/privacy}","received_events_url":"https://api.github.com/users/yashvardhannanavati/received_events","type":"User","site_admin":false},"body":"Can we do the same here as well? Or am I missing something?","created_at":"2018-03-23T18:42:12Z","updated_at":"2018-03-23T18:42:12Z","html_url":"https://github.com/release-engineering/purview-api/pull/9#discussion_r176831247","pull_request_url":"https://api.github.com/repos/release-engineering/purview-api/pulls/9","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/release-engineering/purview-api/pulls/comments/176831247"},"html":{"href":"https://github.com/release-engineering/purview-api/pull/9#discussion_r176831247"},"pull_request":{"href":"https://api.github.com/repos/release-engineering/purview-api/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/release-engineering/purview-api/pulls/9","id":177142697,"html_url":"https://github.com/release-engineering/purview-api/pull/9","diff_url":"https://github.com/release-engineering/purview-api/pull/9.diff","patch_url":"https://github.com/release-engineering/purview-api/pull/9.patch","issue_url":"https://api.github.com/repos/release-engineering/purview-api/issues/9","number":9,"state":"open","locked":false,"title":"Add a timestamp parsing function","user":{"login":"mprahl","id":11711106,"avatar_url":"https://avatars3.githubusercontent.com/u/11711106?v=4","gravatar_id":"","url":"https://api.github.com/users/mprahl","html_url":"https://github.com/mprahl","followers_url":"https://api.github.com/users/mprahl/followers","following_url":"https://api.github.com/users/mprahl/following{/other_user}","gists_url":"https://api.github.com/users/mprahl/gists{/gist_id}","starred_url":"https://api.github.com/users/mprahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprahl/subscriptions","organizations_url":"https://api.github.com/users/mprahl/orgs","repos_url":"https://api.github.com/users/mprahl/repos","events_url":"https://api.github.com/users/mprahl/events{/privacy}","received_events_url":"https://api.github.com/users/mprahl/received_events","type":"User","site_admin":false},"body":"This will be useful for when we parse the `since` input for our scrapers.","created_at":"2018-03-23T17:52:13Z","updated_at":"2018-03-23T18:42:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5822607e266ca50ab0e394e33e8aad6f1ece295a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/release-engineering/purview-api/pulls/9/commits","review_comments_url":"https://api.github.com/repos/release-engineering/purview-api/pulls/9/comments","review_comment_url":"https://api.github.com/repos/release-engineering/purview-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/release-engineering/purview-api/issues/9/comments","statuses_url":"https://api.github.com/repos/release-engineering/purview-api/statuses/97c92afa03160cab663b7c89aac7fe796e224d42","head":{"label":"release-engineering:add-generic-timestamp-scraper","ref":"add-generic-timestamp-scraper","sha":"97c92afa03160cab663b7c89aac7fe796e224d42","user":{"login":"release-engineering","id":9591189,"avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"repo":{"id":125875978,"name":"purview-api","full_name":"release-engineering/purview-api","owner":{"login":"release-engineering","id":9591189,"avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/release-engineering/purview-api","description":"API for Purview","fork":false,"url":"https://api.github.com/repos/release-engineering/purview-api","forks_url":"https://api.github.com/repos/release-engineering/purview-api/forks","keys_url":"https://api.github.com/repos/release-engineering/purview-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/release-engineering/purview-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/release-engineering/purview-api/teams","hooks_url":"https://api.github.com/repos/release-engineering/purview-api/hooks","issue_events_url":"https://api.github.com/repos/release-engineering/purview-api/issues/events{/number}","events_url":"https://api.github.com/repos/release-engineering/purview-api/events","assignees_url":"https://api.github.com/repos/release-engineering/purview-api/assignees{/user}","branches_url":"https://api.github.com/repos/release-engineering/purview-api/branches{/branch}","tags_url":"https://api.github.com/repos/release-engineering/purview-api/tags","blobs_url":"https://api.github.com/repos/release-engineering/purview-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/release-engineering/purview-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/release-engineering/purview-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/release-engineering/purview-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/release-engineering/purview-api/statuses/{sha}","languages_url":"https://api.github.com/repos/release-engineering/purview-api/languages","stargazers_url":"https://api.github.com/repos/release-engineering/purview-api/stargazers","contributors_url":"https://api.github.com/repos/release-engineering/purview-api/contributors","subscribers_url":"https://api.github.com/repos/release-engineering/purview-api/subscribers","subscription_url":"https://api.github.com/repos/release-engineering/purview-api/subscription","commits_url":"https://api.github.com/repos/release-engineering/purview-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/release-engineering/purview-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/release-engineering/purview-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/release-engineering/purview-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/release-engineering/purview-api/contents/{+path}","compare_url":"https://api.github.com/repos/release-engineering/purview-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/release-engineering/purview-api/merges","archive_url":"https://api.github.com/repos/release-engineering/purview-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/release-engineering/purview-api/downloads","issues_url":"https://api.github.com/repos/release-engineering/purview-api/issues{/number}","pulls_url":"https://api.github.com/repos/release-engineering/purview-api/pulls{/number}","milestones_url":"https://api.github.com/repos/release-engineering/purview-api/milestones{/number}","notifications_url":"https://api.github.com/repos/release-engineering/purview-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/release-engineering/purview-api/labels{/name}","releases_url":"https://api.github.com/repos/release-engineering/purview-api/releases{/id}","deployments_url":"https://api.github.com/repos/release-engineering/purview-api/deployments","created_at":"2018-03-19T15:02:40Z","updated_at":"2018-03-23T18:14:24Z","pushed_at":"2018-03-23T18:37:29Z","git_url":"git://github.com/release-engineering/purview-api.git","ssh_url":"git@github.com:release-engineering/purview-api.git","clone_url":"https://github.com/release-engineering/purview-api.git","svn_url":"https://github.com/release-engineering/purview-api","homepage":"","size":31,"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":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"release-engineering:master","ref":"master","sha":"b1e75a51e66feace8f6c19459a307b8ed6d0765c","user":{"login":"release-engineering","id":9591189,"avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"repo":{"id":125875978,"name":"purview-api","full_name":"release-engineering/purview-api","owner":{"login":"release-engineering","id":9591189,"avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/release-engineering/purview-api","description":"API for Purview","fork":false,"url":"https://api.github.com/repos/release-engineering/purview-api","forks_url":"https://api.github.com/repos/release-engineering/purview-api/forks","keys_url":"https://api.github.com/repos/release-engineering/purview-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/release-engineering/purview-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/release-engineering/purview-api/teams","hooks_url":"https://api.github.com/repos/release-engineering/purview-api/hooks","issue_events_url":"https://api.github.com/repos/release-engineering/purview-api/issues/events{/number}","events_url":"https://api.github.com/repos/release-engineering/purview-api/events","assignees_url":"https://api.github.com/repos/release-engineering/purview-api/assignees{/user}","branches_url":"https://api.github.com/repos/release-engineering/purview-api/branches{/branch}","tags_url":"https://api.github.com/repos/release-engineering/purview-api/tags","blobs_url":"https://api.github.com/repos/release-engineering/purview-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/release-engineering/purview-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/release-engineering/purview-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/release-engineering/purview-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/release-engineering/purview-api/statuses/{sha}","languages_url":"https://api.github.com/repos/release-engineering/purview-api/languages","stargazers_url":"https://api.github.com/repos/release-engineering/purview-api/stargazers","contributors_url":"https://api.github.com/repos/release-engineering/purview-api/contributors","subscribers_url":"https://api.github.com/repos/release-engineering/purview-api/subscribers","subscription_url":"https://api.github.com/repos/release-engineering/purview-api/subscription","commits_url":"https://api.github.com/repos/release-engineering/purview-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/release-engineering/purview-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/release-engineering/purview-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/release-engineering/purview-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/release-engineering/purview-api/contents/{+path}","compare_url":"https://api.github.com/repos/release-engineering/purview-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/release-engineering/purview-api/merges","archive_url":"https://api.github.com/repos/release-engineering/purview-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/release-engineering/purview-api/downloads","issues_url":"https://api.github.com/repos/release-engineering/purview-api/issues{/number}","pulls_url":"https://api.github.com/repos/release-engineering/purview-api/pulls{/number}","milestones_url":"https://api.github.com/repos/release-engineering/purview-api/milestones{/number}","notifications_url":"https://api.github.com/repos/release-engineering/purview-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/release-engineering/purview-api/labels{/name}","releases_url":"https://api.github.com/repos/release-engineering/purview-api/releases{/id}","deployments_url":"https://api.github.com/repos/release-engineering/purview-api/deployments","created_at":"2018-03-19T15:02:40Z","updated_at":"2018-03-23T18:14:24Z","pushed_at":"2018-03-23T18:37:29Z","git_url":"git://github.com/release-engineering/purview-api.git","ssh_url":"git@github.com:release-engineering/purview-api.git","clone_url":"https://github.com/release-engineering/purview-api.git","svn_url":"https://github.com/release-engineering/purview-api","homepage":"","size":31,"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":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/release-engineering/purview-api/pulls/9"},"html":{"href":"https://github.com/release-engineering/purview-api/pull/9"},"issue":{"href":"https://api.github.com/repos/release-engineering/purview-api/issues/9"},"comments":{"href":"https://api.github.com/repos/release-engineering/purview-api/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/release-engineering/purview-api/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/release-engineering/purview-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/release-engineering/purview-api/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/release-engineering/purview-api/statuses/97c92afa03160cab663b7c89aac7fe796e224d42"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"yashvardhannanavati"}}