{"action":"created","comment":{"url":"https://api.github.com/repos/getsentry/sentry/pulls/comments/217048362","pull_request_review_id":154667054,"id":217048362,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzA0ODM2Mg==","diff_hunk":"@@ -69,7 +69,22 @@ def test(self):\n                 'projects': [self.project.id],\n                 'fields': ['message', 'platform'],\n                 'start': (datetime.now() - timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),\n-                'end': (datetime.now() + timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),\n+                'end': (datetime.now()).strftime('%Y-%m-%dT%H:%M:%S'),\n+                'orderby': '-timestamp',\n+            })\n+\n+        assert response.status_code == 200, response.content\n+        assert len(response.data['data']) == 1\n+        assert response.data['data'][0]['message'] == 'message!'\n+        assert response.data['data'][0]['platform'] == 'python'\n+\n+    def test_relative_dates(self):\n+        with self.feature('organizations:discover'):\n+            url = reverse('sentry-api-0-organization-discover', args=[self.org.slug])\n+            response = self.client.post(url, {\n+                'projects': [self.project.id],\n+                'fields': ['message', 'platform'],\n+                'range': '1d',","path":"tests/snuba/test_organization_discover.py","position":41,"original_position":41,"commit_id":"ee31d1f0887709f829874fda71bd58b2bfac3342","original_commit_id":"ee31d1f0887709f829874fda71bd58b2bfac3342","user":{"login":"markstory","id":24086,"node_id":"MDQ6VXNlcjI0MDg2","avatar_url":"https://avatars3.githubusercontent.com/u/24086?v=4","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"body":"Should we have tests for invalid API usage as well? Invalid fields, out of bounds ranges, and requesting start/end & range at the same time?","created_at":"2018-09-12T14:12:19Z","updated_at":"2018-09-12T14:12:23Z","html_url":"https://github.com/getsentry/sentry/pull/9724#discussion_r217048362","pull_request_url":"https://api.github.com/repos/getsentry/sentry/pulls/9724","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/comments/217048362"},"html":{"href":"https://github.com/getsentry/sentry/pull/9724#discussion_r217048362"},"pull_request":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/9724"}}},"pull_request":{"url":"https://api.github.com/repos/getsentry/sentry/pulls/9724","id":214786125,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0Nzg2MTI1","html_url":"https://github.com/getsentry/sentry/pull/9724","diff_url":"https://github.com/getsentry/sentry/pull/9724.diff","patch_url":"https://github.com/getsentry/sentry/pull/9724.patch","issue_url":"https://api.github.com/repos/getsentry/sentry/issues/9724","number":9724,"state":"open","locked":false,"title":"feat(discover): Support relative time ranges in Discover API","user":{"login":"lynnagara","id":1779792,"node_id":"MDQ6VXNlcjE3Nzk3OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1779792?v=4","gravatar_id":"","url":"https://api.github.com/users/lynnagara","html_url":"https://github.com/lynnagara","followers_url":"https://api.github.com/users/lynnagara/followers","following_url":"https://api.github.com/users/lynnagara/following{/other_user}","gists_url":"https://api.github.com/users/lynnagara/gists{/gist_id}","starred_url":"https://api.github.com/users/lynnagara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lynnagara/subscriptions","organizations_url":"https://api.github.com/users/lynnagara/orgs","repos_url":"https://api.github.com/users/lynnagara/repos","events_url":"https://api.github.com/users/lynnagara/events{/privacy}","received_events_url":"https://api.github.com/users/lynnagara/received_events","type":"User","site_admin":false},"body":"We want to support relative date ranges (e.g. `1s`, `2m`, `3h`, `4d`) as well as absolute datetimes in the discover API","created_at":"2018-09-11T22:33:29Z","updated_at":"2018-09-12T14:12:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd8d17e45f3603086245e26e9d16bf6b082315ff","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/getsentry/sentry/pulls/9724/commits","review_comments_url":"https://api.github.com/repos/getsentry/sentry/pulls/9724/comments","review_comment_url":"https://api.github.com/repos/getsentry/sentry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/getsentry/sentry/issues/9724/comments","statuses_url":"https://api.github.com/repos/getsentry/sentry/statuses/ee31d1f0887709f829874fda71bd58b2bfac3342","head":{"label":"getsentry:feat/discover-api-relative-dates","ref":"feat/discover-api-relative-dates","sha":"ee31d1f0887709f829874fda71bd58b2bfac3342","user":{"login":"getsentry","id":1396951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1396951?v=4","gravatar_id":"","url":"https://api.github.com/users/getsentry","html_url":"https://github.com/getsentry","followers_url":"https://api.github.com/users/getsentry/followers","following_url":"https://api.github.com/users/getsentry/following{/other_user}","gists_url":"https://api.github.com/users/getsentry/gists{/gist_id}","starred_url":"https://api.github.com/users/getsentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getsentry/subscriptions","organizations_url":"https://api.github.com/users/getsentry/orgs","repos_url":"https://api.github.com/users/getsentry/repos","events_url":"https://api.github.com/users/getsentry/events{/privacy}","received_events_url":"https://api.github.com/users/getsentry/received_events","type":"Organization","site_admin":false},"repo":{"id":873328,"node_id":"MDEwOlJlcG9zaXRvcnk4NzMzMjg=","name":"sentry","full_name":"getsentry/sentry","owner":{"login":"getsentry","id":1396951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1396951?v=4","gravatar_id":"","url":"https://api.github.com/users/getsentry","html_url":"https://github.com/getsentry","followers_url":"https://api.github.com/users/getsentry/followers","following_url":"https://api.github.com/users/getsentry/following{/other_user}","gists_url":"https://api.github.com/users/getsentry/gists{/gist_id}","starred_url":"https://api.github.com/users/getsentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getsentry/subscriptions","organizations_url":"https://api.github.com/users/getsentry/orgs","repos_url":"https://api.github.com/users/getsentry/repos","events_url":"https://api.github.com/users/getsentry/events{/privacy}","received_events_url":"https://api.github.com/users/getsentry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getsentry/sentry","description":"Sentry is cross-platform application monitoring, with a focus on error reporting.","fork":false,"url":"https://api.github.com/repos/getsentry/sentry","forks_url":"https://api.github.com/repos/getsentry/sentry/forks","keys_url":"https://api.github.com/repos/getsentry/sentry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getsentry/sentry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getsentry/sentry/teams","hooks_url":"https://api.github.com/repos/getsentry/sentry/hooks","issue_events_url":"https://api.github.com/repos/getsentry/sentry/issues/events{/number}","events_url":"https://api.github.com/repos/getsentry/sentry/events","assignees_url":"https://api.github.com/repos/getsentry/sentry/assignees{/user}","branches_url":"https://api.github.com/repos/getsentry/sentry/branches{/branch}","tags_url":"https://api.github.com/repos/getsentry/sentry/tags","blobs_url":"https://api.github.com/repos/getsentry/sentry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getsentry/sentry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getsentry/sentry/git/refs{/sha}","trees_url":"https://api.github.com/repos/getsentry/sentry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getsentry/sentry/statuses/{sha}","languages_url":"https://api.github.com/repos/getsentry/sentry/languages","stargazers_url":"https://api.github.com/repos/getsentry/sentry/stargazers","contributors_url":"https://api.github.com/repos/getsentry/sentry/contributors","subscribers_url":"https://api.github.com/repos/getsentry/sentry/subscribers","subscription_url":"https://api.github.com/repos/getsentry/sentry/subscription","commits_url":"https://api.github.com/repos/getsentry/sentry/commits{/sha}","git_commits_url":"https://api.github.com/repos/getsentry/sentry/git/commits{/sha}","comments_url":"https://api.github.com/repos/getsentry/sentry/comments{/number}","issue_comment_url":"https://api.github.com/repos/getsentry/sentry/issues/comments{/number}","contents_url":"https://api.github.com/repos/getsentry/sentry/contents/{+path}","compare_url":"https://api.github.com/repos/getsentry/sentry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getsentry/sentry/merges","archive_url":"https://api.github.com/repos/getsentry/sentry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getsentry/sentry/downloads","issues_url":"https://api.github.com/repos/getsentry/sentry/issues{/number}","pulls_url":"https://api.github.com/repos/getsentry/sentry/pulls{/number}","milestones_url":"https://api.github.com/repos/getsentry/sentry/milestones{/number}","notifications_url":"https://api.github.com/repos/getsentry/sentry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getsentry/sentry/labels{/name}","releases_url":"https://api.github.com/repos/getsentry/sentry/releases{/id}","deployments_url":"https://api.github.com/repos/getsentry/sentry/deployments","created_at":"2010-08-30T22:06:41Z","updated_at":"2018-09-12T13:38:26Z","pushed_at":"2018-09-12T13:35:43Z","git_url":"git://github.com/getsentry/sentry.git","ssh_url":"git@github.com:getsentry/sentry.git","clone_url":"https://github.com/getsentry/sentry.git","svn_url":"https://github.com/getsentry/sentry","homepage":"https://sentry.io","size":92228,"stargazers_count":18044,"watchers_count":18044,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2085,"mirror_url":null,"archived":false,"open_issues_count":822,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":2085,"open_issues":822,"watchers":18044,"default_branch":"master"}},"base":{"label":"getsentry:master","ref":"master","sha":"98a2aa72b3bcff97121a8d3f01f555ec4d6a23a1","user":{"login":"getsentry","id":1396951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1396951?v=4","gravatar_id":"","url":"https://api.github.com/users/getsentry","html_url":"https://github.com/getsentry","followers_url":"https://api.github.com/users/getsentry/followers","following_url":"https://api.github.com/users/getsentry/following{/other_user}","gists_url":"https://api.github.com/users/getsentry/gists{/gist_id}","starred_url":"https://api.github.com/users/getsentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getsentry/subscriptions","organizations_url":"https://api.github.com/users/getsentry/orgs","repos_url":"https://api.github.com/users/getsentry/repos","events_url":"https://api.github.com/users/getsentry/events{/privacy}","received_events_url":"https://api.github.com/users/getsentry/received_events","type":"Organization","site_admin":false},"repo":{"id":873328,"node_id":"MDEwOlJlcG9zaXRvcnk4NzMzMjg=","name":"sentry","full_name":"getsentry/sentry","owner":{"login":"getsentry","id":1396951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1396951?v=4","gravatar_id":"","url":"https://api.github.com/users/getsentry","html_url":"https://github.com/getsentry","followers_url":"https://api.github.com/users/getsentry/followers","following_url":"https://api.github.com/users/getsentry/following{/other_user}","gists_url":"https://api.github.com/users/getsentry/gists{/gist_id}","starred_url":"https://api.github.com/users/getsentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getsentry/subscriptions","organizations_url":"https://api.github.com/users/getsentry/orgs","repos_url":"https://api.github.com/users/getsentry/repos","events_url":"https://api.github.com/users/getsentry/events{/privacy}","received_events_url":"https://api.github.com/users/getsentry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getsentry/sentry","description":"Sentry is cross-platform application monitoring, with a focus on error reporting.","fork":false,"url":"https://api.github.com/repos/getsentry/sentry","forks_url":"https://api.github.com/repos/getsentry/sentry/forks","keys_url":"https://api.github.com/repos/getsentry/sentry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getsentry/sentry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getsentry/sentry/teams","hooks_url":"https://api.github.com/repos/getsentry/sentry/hooks","issue_events_url":"https://api.github.com/repos/getsentry/sentry/issues/events{/number}","events_url":"https://api.github.com/repos/getsentry/sentry/events","assignees_url":"https://api.github.com/repos/getsentry/sentry/assignees{/user}","branches_url":"https://api.github.com/repos/getsentry/sentry/branches{/branch}","tags_url":"https://api.github.com/repos/getsentry/sentry/tags","blobs_url":"https://api.github.com/repos/getsentry/sentry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getsentry/sentry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getsentry/sentry/git/refs{/sha}","trees_url":"https://api.github.com/repos/getsentry/sentry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getsentry/sentry/statuses/{sha}","languages_url":"https://api.github.com/repos/getsentry/sentry/languages","stargazers_url":"https://api.github.com/repos/getsentry/sentry/stargazers","contributors_url":"https://api.github.com/repos/getsentry/sentry/contributors","subscribers_url":"https://api.github.com/repos/getsentry/sentry/subscribers","subscription_url":"https://api.github.com/repos/getsentry/sentry/subscription","commits_url":"https://api.github.com/repos/getsentry/sentry/commits{/sha}","git_commits_url":"https://api.github.com/repos/getsentry/sentry/git/commits{/sha}","comments_url":"https://api.github.com/repos/getsentry/sentry/comments{/number}","issue_comment_url":"https://api.github.com/repos/getsentry/sentry/issues/comments{/number}","contents_url":"https://api.github.com/repos/getsentry/sentry/contents/{+path}","compare_url":"https://api.github.com/repos/getsentry/sentry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getsentry/sentry/merges","archive_url":"https://api.github.com/repos/getsentry/sentry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getsentry/sentry/downloads","issues_url":"https://api.github.com/repos/getsentry/sentry/issues{/number}","pulls_url":"https://api.github.com/repos/getsentry/sentry/pulls{/number}","milestones_url":"https://api.github.com/repos/getsentry/sentry/milestones{/number}","notifications_url":"https://api.github.com/repos/getsentry/sentry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getsentry/sentry/labels{/name}","releases_url":"https://api.github.com/repos/getsentry/sentry/releases{/id}","deployments_url":"https://api.github.com/repos/getsentry/sentry/deployments","created_at":"2010-08-30T22:06:41Z","updated_at":"2018-09-12T13:38:26Z","pushed_at":"2018-09-12T13:35:43Z","git_url":"git://github.com/getsentry/sentry.git","ssh_url":"git@github.com:getsentry/sentry.git","clone_url":"https://github.com/getsentry/sentry.git","svn_url":"https://github.com/getsentry/sentry","homepage":"https://sentry.io","size":92228,"stargazers_count":18044,"watchers_count":18044,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2085,"mirror_url":null,"archived":false,"open_issues_count":822,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":2085,"open_issues":822,"watchers":18044,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/9724"},"html":{"href":"https://github.com/getsentry/sentry/pull/9724"},"issue":{"href":"https://api.github.com/repos/getsentry/sentry/issues/9724"},"comments":{"href":"https://api.github.com/repos/getsentry/sentry/issues/9724/comments"},"review_comments":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/9724/comments"},"review_comment":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/9724/commits"},"statuses":{"href":"https://api.github.com/repos/getsentry/sentry/statuses/ee31d1f0887709f829874fda71bd58b2bfac3342"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"markstory"}}