{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-releng/services/pulls/comments/169380267","pull_request_review_id":97897347,"id":169380267,"diff_hunk":"@@ -31,47 +33,49 @@ def __init__(self, configuration):\n         self.api_url = configuration['phabricator_url']\n         self.api_token = configuration['phabricator_token']\n \n-        # Start on first page\n-        self.before = None\n+        # Start by getting top id\n+        diffs, _ = self.request_phabricator(limit=1)\n+        assert len(diffs) == 1\n+        self.top_id = diffs[0]['id']\n+\n+    def request_phabricator(self, after=None, limit=20, order='newest'):\n+        '''\n+        Load raw differential objects from the api\n+        '''\n+        logger.debug('Loading phabricator differentials', after=after, limit=limit, order=order)\n+        url = '{}/differential.diff.search'.format(self.api_url)\n+        payload = {\n+            'api.token': self.api_token,\n+            'after': after,\n+            'order': order,\n+            'limit': limit,\n+        }\n+        response = requests.post(url, payload)\n+        response.raise_for_status()\n+        data = response.json()\n+        assert data['error_code'] is None, \\\n+            'Conduit error: {} - {}'.format(\n+                data['error_code'],\n+                data['error_info'],\n+            )\n+\n+        after = data['result']['cursor']['after']\n+        after = after and int(after)","path":"src/shipit_pulse_listener/shipit_pulse_listener/listener.py","position":42,"original_position":42,"commit_id":"a75e5343743d81c8a704be4d781fe79dd0b8ef68","original_commit_id":"a75e5343743d81c8a704be4d781fe79dd0b8ef68","user":{"login":"marco-c","id":1616846,"avatar_url":"https://avatars1.githubusercontent.com/u/1616846?v=4","gravatar_id":"","url":"https://api.github.com/users/marco-c","html_url":"https://github.com/marco-c","followers_url":"https://api.github.com/users/marco-c/followers","following_url":"https://api.github.com/users/marco-c/following{/other_user}","gists_url":"https://api.github.com/users/marco-c/gists{/gist_id}","starred_url":"https://api.github.com/users/marco-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marco-c/subscriptions","organizations_url":"https://api.github.com/users/marco-c/orgs","repos_url":"https://api.github.com/users/marco-c/repos","events_url":"https://api.github.com/users/marco-c/events{/privacy}","received_events_url":"https://api.github.com/users/marco-c/received_events","type":"User","site_admin":false},"body":"Actually, you probably don't need to convert it to an integer","created_at":"2018-02-20T16:36:43Z","updated_at":"2018-02-20T16:36:44Z","html_url":"https://github.com/mozilla-releng/services/pull/857#discussion_r169380267","pull_request_url":"https://api.github.com/repos/mozilla-releng/services/pulls/857","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mozilla-releng/services/pulls/comments/169380267"},"html":{"href":"https://github.com/mozilla-releng/services/pull/857#discussion_r169380267"},"pull_request":{"href":"https://api.github.com/repos/mozilla-releng/services/pulls/857"}},"in_reply_to_id":169379707},"pull_request":{"url":"https://api.github.com/repos/mozilla-releng/services/pulls/857","id":170207485,"html_url":"https://github.com/mozilla-releng/services/pull/857","diff_url":"https://github.com/mozilla-releng/services/pull/857.diff","patch_url":"https://github.com/mozilla-releng/services/pull/857.patch","issue_url":"https://api.github.com/repos/mozilla-releng/services/issues/857","number":857,"state":"open","locked":false,"title":"shipit-pulse-listener: Fixes to run Phabricator parsing on production","user":{"login":"La0","id":101004,"avatar_url":"https://avatars3.githubusercontent.com/u/101004?v=4","gravatar_id":"","url":"https://api.github.com/users/La0","html_url":"https://github.com/La0","followers_url":"https://api.github.com/users/La0/followers","following_url":"https://api.github.com/users/La0/following{/other_user}","gists_url":"https://api.github.com/users/La0/gists{/gist_id}","starred_url":"https://api.github.com/users/La0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/La0/subscriptions","organizations_url":"https://api.github.com/users/La0/orgs","repos_url":"https://api.github.com/users/La0/repos","events_url":"https://api.github.com/users/La0/events{/privacy}","received_events_url":"https://api.github.com/users/La0/received_events","type":"User","site_admin":false},"body":"`shipit_static_analysis` now needs a Phabricator DIFF id instead of a DREV.\r\nAlso the list of diffs on productions is already quite large, so i added a hard limit to run analysis on the last 12 hours of diffs, instead of the whole history.","created_at":"2018-02-20T14:30:01Z","updated_at":"2018-02-20T16:36:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd40be8039ab73b51747e673d8c38a72e802a0cd","assignee":{"login":"La0","id":101004,"avatar_url":"https://avatars3.githubusercontent.com/u/101004?v=4","gravatar_id":"","url":"https://api.github.com/users/La0","html_url":"https://github.com/La0","followers_url":"https://api.github.com/users/La0/followers","following_url":"https://api.github.com/users/La0/following{/other_user}","gists_url":"https://api.github.com/users/La0/gists{/gist_id}","starred_url":"https://api.github.com/users/La0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/La0/subscriptions","organizations_url":"https://api.github.com/users/La0/orgs","repos_url":"https://api.github.com/users/La0/repos","events_url":"https://api.github.com/users/La0/events{/privacy}","received_events_url":"https://api.github.com/users/La0/received_events","type":"User","site_admin":false},"assignees":[{"login":"La0","id":101004,"avatar_url":"https://avatars3.githubusercontent.com/u/101004?v=4","gravatar_id":"","url":"https://api.github.com/users/La0","html_url":"https://github.com/La0","followers_url":"https://api.github.com/users/La0/followers","following_url":"https://api.github.com/users/La0/following{/other_user}","gists_url":"https://api.github.com/users/La0/gists{/gist_id}","starred_url":"https://api.github.com/users/La0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/La0/subscriptions","organizations_url":"https://api.github.com/users/La0/orgs","repos_url":"https://api.github.com/users/La0/repos","events_url":"https://api.github.com/users/La0/events{/privacy}","received_events_url":"https://api.github.com/users/La0/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":608459590,"url":"https://api.github.com/repos/mozilla-releng/services/labels/4.app:%20shipit_pulse_listener","name":"4.app: shipit_pulse_listener","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-releng/services/pulls/857/commits","review_comments_url":"https://api.github.com/repos/mozilla-releng/services/pulls/857/comments","review_comment_url":"https://api.github.com/repos/mozilla-releng/services/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-releng/services/issues/857/comments","statuses_url":"https://api.github.com/repos/mozilla-releng/services/statuses/a75e5343743d81c8a704be4d781fe79dd0b8ef68","head":{"label":"La0:pl-phabricator","ref":"pl-phabricator","sha":"a75e5343743d81c8a704be4d781fe79dd0b8ef68","user":{"login":"La0","id":101004,"avatar_url":"https://avatars3.githubusercontent.com/u/101004?v=4","gravatar_id":"","url":"https://api.github.com/users/La0","html_url":"https://github.com/La0","followers_url":"https://api.github.com/users/La0/followers","following_url":"https://api.github.com/users/La0/following{/other_user}","gists_url":"https://api.github.com/users/La0/gists{/gist_id}","starred_url":"https://api.github.com/users/La0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/La0/subscriptions","organizations_url":"https://api.github.com/users/La0/orgs","repos_url":"https://api.github.com/users/La0/repos","events_url":"https://api.github.com/users/La0/events{/privacy}","received_events_url":"https://api.github.com/users/La0/received_events","type":"User","site_admin":false},"repo":{"id":61881468,"name":"mozilla-relengapi","full_name":"La0/mozilla-relengapi","owner":{"login":"La0","id":101004,"avatar_url":"https://avatars3.githubusercontent.com/u/101004?v=4","gravatar_id":"","url":"https://api.github.com/users/La0","html_url":"https://github.com/La0","followers_url":"https://api.github.com/users/La0/followers","following_url":"https://api.github.com/users/La0/following{/other_user}","gists_url":"https://api.github.com/users/La0/gists{/gist_id}","starred_url":"https://api.github.com/users/La0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/La0/subscriptions","organizations_url":"https://api.github.com/users/La0/orgs","repos_url":"https://api.github.com/users/La0/repos","events_url":"https://api.github.com/users/La0/events{/privacy}","received_events_url":"https://api.github.com/users/La0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/La0/mozilla-relengapi","description":"Your Interface to Release Engineering Automation -","fork":true,"url":"https://api.github.com/repos/La0/mozilla-relengapi","forks_url":"https://api.github.com/repos/La0/mozilla-relengapi/forks","keys_url":"https://api.github.com/repos/La0/mozilla-relengapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/La0/mozilla-relengapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/La0/mozilla-relengapi/teams","hooks_url":"https://api.github.com/repos/La0/mozilla-relengapi/hooks","issue_events_url":"https://api.github.com/repos/La0/mozilla-relengapi/issues/events{/number}","events_url":"https://api.github.com/repos/La0/mozilla-relengapi/events","assignees_url":"https://api.github.com/repos/La0/mozilla-relengapi/assignees{/user}","branches_url":"https://api.github.com/repos/La0/mozilla-relengapi/branches{/branch}","tags_url":"https://api.github.com/repos/La0/mozilla-relengapi/tags","blobs_url":"https://api.github.com/repos/La0/mozilla-relengapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/La0/mozilla-relengapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/La0/mozilla-relengapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/La0/mozilla-relengapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/La0/mozilla-relengapi/statuses/{sha}","languages_url":"https://api.github.com/repos/La0/mozilla-relengapi/languages","stargazers_url":"https://api.github.com/repos/La0/mozilla-relengapi/stargazers","contributors_url":"https://api.github.com/repos/La0/mozilla-relengapi/contributors","subscribers_url":"https://api.github.com/repos/La0/mozilla-relengapi/subscribers","subscription_url":"https://api.github.com/repos/La0/mozilla-relengapi/subscription","commits_url":"https://api.github.com/repos/La0/mozilla-relengapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/La0/mozilla-relengapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/La0/mozilla-relengapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/La0/mozilla-relengapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/La0/mozilla-relengapi/contents/{+path}","compare_url":"https://api.github.com/repos/La0/mozilla-relengapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/La0/mozilla-relengapi/merges","archive_url":"https://api.github.com/repos/La0/mozilla-relengapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/La0/mozilla-relengapi/downloads","issues_url":"https://api.github.com/repos/La0/mozilla-relengapi/issues{/number}","pulls_url":"https://api.github.com/repos/La0/mozilla-relengapi/pulls{/number}","milestones_url":"https://api.github.com/repos/La0/mozilla-relengapi/milestones{/number}","notifications_url":"https://api.github.com/repos/La0/mozilla-relengapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/La0/mozilla-relengapi/labels{/name}","releases_url":"https://api.github.com/repos/La0/mozilla-relengapi/releases{/id}","deployments_url":"https://api.github.com/repos/La0/mozilla-relengapi/deployments","created_at":"2016-06-24T11:59:18Z","updated_at":"2016-08-25T19:37:48Z","pushed_at":"2018-02-20T16:23:09Z","git_url":"git://github.com/La0/mozilla-relengapi.git","ssh_url":"git@github.com:La0/mozilla-relengapi.git","clone_url":"https://github.com/La0/mozilla-relengapi.git","svn_url":"https://github.com/La0/mozilla-relengapi","homepage":"https://api.pub.build.mozilla.org","size":55538,"stargazers_count":0,"watchers_count":0,"language":"Nix","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-releng:master","ref":"master","sha":"9d7081fe9ca74e2d9fa0f3584488c324399df519","user":{"login":"mozilla-releng","id":19614164,"avatar_url":"https://avatars1.githubusercontent.com/u/19614164?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-releng","html_url":"https://github.com/mozilla-releng","followers_url":"https://api.github.com/users/mozilla-releng/followers","following_url":"https://api.github.com/users/mozilla-releng/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-releng/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-releng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-releng/subscriptions","organizations_url":"https://api.github.com/users/mozilla-releng/orgs","repos_url":"https://api.github.com/users/mozilla-releng/repos","events_url":"https://api.github.com/users/mozilla-releng/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-releng/received_events","type":"Organization","site_admin":false},"repo":{"id":51109207,"name":"services","full_name":"mozilla-releng/services","owner":{"login":"mozilla-releng","id":19614164,"avatar_url":"https://avatars1.githubusercontent.com/u/19614164?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-releng","html_url":"https://github.com/mozilla-releng","followers_url":"https://api.github.com/users/mozilla-releng/followers","following_url":"https://api.github.com/users/mozilla-releng/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-releng/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-releng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-releng/subscriptions","organizations_url":"https://api.github.com/users/mozilla-releng/orgs","repos_url":"https://api.github.com/users/mozilla-releng/repos","events_url":"https://api.github.com/users/mozilla-releng/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-releng/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-releng/services","description":"Mozilla Release Engineering Services","fork":false,"url":"https://api.github.com/repos/mozilla-releng/services","forks_url":"https://api.github.com/repos/mozilla-releng/services/forks","keys_url":"https://api.github.com/repos/mozilla-releng/services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-releng/services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-releng/services/teams","hooks_url":"https://api.github.com/repos/mozilla-releng/services/hooks","issue_events_url":"https://api.github.com/repos/mozilla-releng/services/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-releng/services/events","assignees_url":"https://api.github.com/repos/mozilla-releng/services/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-releng/services/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-releng/services/tags","blobs_url":"https://api.github.com/repos/mozilla-releng/services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-releng/services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-releng/services/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-releng/services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-releng/services/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-releng/services/languages","stargazers_url":"https://api.github.com/repos/mozilla-releng/services/stargazers","contributors_url":"https://api.github.com/repos/mozilla-releng/services/contributors","subscribers_url":"https://api.github.com/repos/mozilla-releng/services/subscribers","subscription_url":"https://api.github.com/repos/mozilla-releng/services/subscription","commits_url":"https://api.github.com/repos/mozilla-releng/services/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-releng/services/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-releng/services/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-releng/services/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-releng/services/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-releng/services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-releng/services/merges","archive_url":"https://api.github.com/repos/mozilla-releng/services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-releng/services/downloads","issues_url":"https://api.github.com/repos/mozilla-releng/services/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-releng/services/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-releng/services/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-releng/services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-releng/services/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-releng/services/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-releng/services/deployments","created_at":"2016-02-04T22:07:22Z","updated_at":"2018-01-13T05:24:55Z","pushed_at":"2018-02-20T16:23:10Z","git_url":"git://github.com/mozilla-releng/services.git","ssh_url":"git@github.com:mozilla-releng/services.git","clone_url":"https://github.com/mozilla-releng/services.git","svn_url":"https://github.com/mozilla-releng/services","homepage":"https://mozilla-releng.net","size":59508,"stargazers_count":17,"watchers_count":17,"language":"Nix","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":135,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":47,"open_issues":135,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-releng/services/pulls/857"},"html":{"href":"https://github.com/mozilla-releng/services/pull/857"},"issue":{"href":"https://api.github.com/repos/mozilla-releng/services/issues/857"},"comments":{"href":"https://api.github.com/repos/mozilla-releng/services/issues/857/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-releng/services/pulls/857/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-releng/services/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-releng/services/pulls/857/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-releng/services/statuses/a75e5343743d81c8a704be4d781fe79dd0b8ef68"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"marco-c"}}