{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/treeherder/pulls/comments/67433954","id":67433954,"diff_hunk":"@@ -88,10 +89,15 @@ def list(self, request, project, jm):\n         - count (10)\n         - return_type (dict)\n         \"\"\"\n+        MAX_JOBS_COUNT = 2000\n         filter = UrlQueryFilter(request.query_params)\n \n         offset = int(filter.pop(\"offset\", 0))\n-        count = min(int(filter.pop(\"count\", 10)), 2000)\n+        count = int(filter.pop(\"count\", 10))\n+\n+        if count > MAX_JOBS_COUNT:\n+            return Response({\"error\": \"Specified count exceeds API MAX_JOBS_COUNT value: \" + str(MAX_JOBS_COUNT)}, status=status.HTTP_400_BAD_REQUEST)","path":"treeherder/webapp/api/jobs.py","position":20,"original_position":20,"commit_id":"d5cdc746f699f04fe8bb0d7851c6291389b3499d","original_commit_id":"d5cdc746f699f04fe8bb0d7851c6291389b3499d","user":{"login":"camd","id":419924,"avatar_url":"https://avatars.githubusercontent.com/u/419924?v=3","gravatar_id":"","url":"https://api.github.com/users/camd","html_url":"https://github.com/camd","followers_url":"https://api.github.com/users/camd/followers","following_url":"https://api.github.com/users/camd/following{/other_user}","gists_url":"https://api.github.com/users/camd/gists{/gist_id}","starred_url":"https://api.github.com/users/camd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camd/subscriptions","organizations_url":"https://api.github.com/users/camd/orgs","repos_url":"https://api.github.com/users/camd/repos","events_url":"https://api.github.com/users/camd/events{/privacy}","received_events_url":"https://api.github.com/users/camd/received_events","type":"User","site_admin":false},"body":"concatenating values to strings is done with ``format()``, and it's best to wrap to keep things as close to 80 chars wide as possible like this:\r\n\r\n    return Response(\r\n        {\"error\": \"Specified count exceeds API MAX_JOBS_COUNT value: {}\".format(MAX_JOBS_COUNT)},\r\n        status=status.HTTP_400_BAD_REQUEST\r\n    )\r\n    \r\n","created_at":"2016-06-16T22:14:10Z","updated_at":"2016-06-16T22:14:10Z","html_url":"https://github.com/mozilla/treeherder/pull/1594#discussion_r67433954","pull_request_url":"https://api.github.com/repos/mozilla/treeherder/pulls/1594","_links":{"self":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/comments/67433954"},"html":{"href":"https://github.com/mozilla/treeherder/pull/1594#discussion_r67433954"},"pull_request":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/1594"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/treeherder/pulls/1594","id":73924666,"html_url":"https://github.com/mozilla/treeherder/pull/1594","diff_url":"https://github.com/mozilla/treeherder/pull/1594.diff","patch_url":"https://github.com/mozilla/treeherder/pull/1594.patch","issue_url":"https://api.github.com/repos/mozilla/treeherder/issues/1594","number":1594,"state":"open","locked":false,"title":"Bug 1203551 - Don't allow count to exceed MAX_JOBS_COUNT in the jobs api","user":{"login":"KWierso","id":172215,"avatar_url":"https://avatars.githubusercontent.com/u/172215?v=3","gravatar_id":"","url":"https://api.github.com/users/KWierso","html_url":"https://github.com/KWierso","followers_url":"https://api.github.com/users/KWierso/followers","following_url":"https://api.github.com/users/KWierso/following{/other_user}","gists_url":"https://api.github.com/users/KWierso/gists{/gist_id}","starred_url":"https://api.github.com/users/KWierso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KWierso/subscriptions","organizations_url":"https://api.github.com/users/KWierso/orgs","repos_url":"https://api.github.com/users/KWierso/repos","events_url":"https://api.github.com/users/KWierso/events{/privacy}","received_events_url":"https://api.github.com/users/KWierso/received_events","type":"User","site_admin":false},"body":"\n\n<!-- Reviewable:start -->\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/mozilla/treeherder/1594)\n<!-- Reviewable:end -->\n","created_at":"2016-06-15T14:44:45Z","updated_at":"2016-06-16T22:14:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a35111000194ca3d91a4d1421794ba62049a264c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/treeherder/pulls/1594/commits","review_comments_url":"https://api.github.com/repos/mozilla/treeherder/pulls/1594/comments","review_comment_url":"https://api.github.com/repos/mozilla/treeherder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/treeherder/issues/1594/comments","statuses_url":"https://api.github.com/repos/mozilla/treeherder/statuses/d5cdc746f699f04fe8bb0d7851c6291389b3499d","head":{"label":"KWierso:1203551","ref":"1203551","sha":"d5cdc746f699f04fe8bb0d7851c6291389b3499d","user":{"login":"KWierso","id":172215,"avatar_url":"https://avatars.githubusercontent.com/u/172215?v=3","gravatar_id":"","url":"https://api.github.com/users/KWierso","html_url":"https://github.com/KWierso","followers_url":"https://api.github.com/users/KWierso/followers","following_url":"https://api.github.com/users/KWierso/following{/other_user}","gists_url":"https://api.github.com/users/KWierso/gists{/gist_id}","starred_url":"https://api.github.com/users/KWierso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KWierso/subscriptions","organizations_url":"https://api.github.com/users/KWierso/orgs","repos_url":"https://api.github.com/users/KWierso/repos","events_url":"https://api.github.com/users/KWierso/events{/privacy}","received_events_url":"https://api.github.com/users/KWierso/received_events","type":"User","site_admin":false},"repo":{"id":34485965,"name":"treeherder","full_name":"KWierso/treeherder","owner":{"login":"KWierso","id":172215,"avatar_url":"https://avatars.githubusercontent.com/u/172215?v=3","gravatar_id":"","url":"https://api.github.com/users/KWierso","html_url":"https://github.com/KWierso","followers_url":"https://api.github.com/users/KWierso/followers","following_url":"https://api.github.com/users/KWierso/following{/other_user}","gists_url":"https://api.github.com/users/KWierso/gists{/gist_id}","starred_url":"https://api.github.com/users/KWierso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KWierso/subscriptions","organizations_url":"https://api.github.com/users/KWierso/orgs","repos_url":"https://api.github.com/users/KWierso/repos","events_url":"https://api.github.com/users/KWierso/events{/privacy}","received_events_url":"https://api.github.com/users/KWierso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KWierso/treeherder","description":"The backend of treeherder, a replacement for TBPL. See wiki page for where to file bugs.","fork":true,"url":"https://api.github.com/repos/KWierso/treeherder","forks_url":"https://api.github.com/repos/KWierso/treeherder/forks","keys_url":"https://api.github.com/repos/KWierso/treeherder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KWierso/treeherder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KWierso/treeherder/teams","hooks_url":"https://api.github.com/repos/KWierso/treeherder/hooks","issue_events_url":"https://api.github.com/repos/KWierso/treeherder/issues/events{/number}","events_url":"https://api.github.com/repos/KWierso/treeherder/events","assignees_url":"https://api.github.com/repos/KWierso/treeherder/assignees{/user}","branches_url":"https://api.github.com/repos/KWierso/treeherder/branches{/branch}","tags_url":"https://api.github.com/repos/KWierso/treeherder/tags","blobs_url":"https://api.github.com/repos/KWierso/treeherder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KWierso/treeherder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KWierso/treeherder/git/refs{/sha}","trees_url":"https://api.github.com/repos/KWierso/treeherder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KWierso/treeherder/statuses/{sha}","languages_url":"https://api.github.com/repos/KWierso/treeherder/languages","stargazers_url":"https://api.github.com/repos/KWierso/treeherder/stargazers","contributors_url":"https://api.github.com/repos/KWierso/treeherder/contributors","subscribers_url":"https://api.github.com/repos/KWierso/treeherder/subscribers","subscription_url":"https://api.github.com/repos/KWierso/treeherder/subscription","commits_url":"https://api.github.com/repos/KWierso/treeherder/commits{/sha}","git_commits_url":"https://api.github.com/repos/KWierso/treeherder/git/commits{/sha}","comments_url":"https://api.github.com/repos/KWierso/treeherder/comments{/number}","issue_comment_url":"https://api.github.com/repos/KWierso/treeherder/issues/comments{/number}","contents_url":"https://api.github.com/repos/KWierso/treeherder/contents/{+path}","compare_url":"https://api.github.com/repos/KWierso/treeherder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KWierso/treeherder/merges","archive_url":"https://api.github.com/repos/KWierso/treeherder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KWierso/treeherder/downloads","issues_url":"https://api.github.com/repos/KWierso/treeherder/issues{/number}","pulls_url":"https://api.github.com/repos/KWierso/treeherder/pulls{/number}","milestones_url":"https://api.github.com/repos/KWierso/treeherder/milestones{/number}","notifications_url":"https://api.github.com/repos/KWierso/treeherder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KWierso/treeherder/labels{/name}","releases_url":"https://api.github.com/repos/KWierso/treeherder/releases{/id}","deployments_url":"https://api.github.com/repos/KWierso/treeherder/deployments","created_at":"2015-04-23T22:58:25Z","updated_at":"2016-05-06T00:18:53Z","pushed_at":"2016-06-16T19:01:57Z","git_url":"git://github.com/KWierso/treeherder.git","ssh_url":"git@github.com:KWierso/treeherder.git","clone_url":"https://github.com/KWierso/treeherder.git","svn_url":"https://github.com/KWierso/treeherder","homepage":"https://wiki.mozilla.org/Auto-tools/Projects/Treeherder","size":42410,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"8fcad12483a9c506de64739bfe1db0e705646306","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":8463294,"name":"treeherder","full_name":"mozilla/treeherder","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/treeherder","description":"Dashboard & service for managing CI data for Mozilla projects","fork":false,"url":"https://api.github.com/repos/mozilla/treeherder","forks_url":"https://api.github.com/repos/mozilla/treeherder/forks","keys_url":"https://api.github.com/repos/mozilla/treeherder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/treeherder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/treeherder/teams","hooks_url":"https://api.github.com/repos/mozilla/treeherder/hooks","issue_events_url":"https://api.github.com/repos/mozilla/treeherder/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/treeherder/events","assignees_url":"https://api.github.com/repos/mozilla/treeherder/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/treeherder/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/treeherder/tags","blobs_url":"https://api.github.com/repos/mozilla/treeherder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/treeherder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/treeherder/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/treeherder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/treeherder/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/treeherder/languages","stargazers_url":"https://api.github.com/repos/mozilla/treeherder/stargazers","contributors_url":"https://api.github.com/repos/mozilla/treeherder/contributors","subscribers_url":"https://api.github.com/repos/mozilla/treeherder/subscribers","subscription_url":"https://api.github.com/repos/mozilla/treeherder/subscription","commits_url":"https://api.github.com/repos/mozilla/treeherder/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/treeherder/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/treeherder/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/treeherder/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/treeherder/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/treeherder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/treeherder/merges","archive_url":"https://api.github.com/repos/mozilla/treeherder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/treeherder/downloads","issues_url":"https://api.github.com/repos/mozilla/treeherder/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/treeherder/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/treeherder/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/treeherder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/treeherder/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/treeherder/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/treeherder/deployments","created_at":"2013-02-27T19:17:37Z","updated_at":"2016-06-13T17:04:30Z","pushed_at":"2016-06-16T18:51:36Z","git_url":"git://github.com/mozilla/treeherder.git","ssh_url":"git@github.com:mozilla/treeherder.git","clone_url":"https://github.com/mozilla/treeherder.git","svn_url":"https://github.com/mozilla/treeherder","homepage":"https://wiki.mozilla.org/EngineeringProductivity/Projects/Treeherder","size":398289,"stargazers_count":54,"watchers_count":54,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":104,"mirror_url":null,"open_issues_count":25,"forks":104,"open_issues":25,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/1594"},"html":{"href":"https://github.com/mozilla/treeherder/pull/1594"},"issue":{"href":"https://api.github.com/repos/mozilla/treeherder/issues/1594"},"comments":{"href":"https://api.github.com/repos/mozilla/treeherder/issues/1594/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/1594/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/treeherder/pulls/1594/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/treeherder/statuses/d5cdc746f699f04fe8bb0d7851c6291389b3499d"}}}}
{"actor":{"display_login":"camd"}}