GitHub PullRequestReviewCommentEvent at 2014-06-26 11:32:45
Repository: alaveteli
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments/14235555","id":14235555,"diff_hunk":"@@ -170,36 +199,36 @@ def body_request_events\n         since_date_str = params[:since_date]\n         if since_date_str.nil?\n             @events = InfoRequestEvent.find_by_sql([\n-              %(select info_request_events.*\n-                from info_requests\n-                join info_request_events on info_requests.id = info_request_events.info_request_id\n-                where info_requests.public_body_id = ?\n-                and info_request_events.event_type in (\n-                  'sent', 'followup_sent', 'resent', 'followup_resent'\n-                )\n-                order by info_request_events.created_at desc\n-              ), @public_body.id\n+                %(select info_request_events.*\n+                    from info_requests\n+                    join info_request_events on info_requests.id = info_request_events.info_request_id\n+                    where info_requests.public_body_id = ?\n+                    and info_request_events.event_type in (\n+                       'sent', 'followup_sent', 'resent', 'followup_resent'\n+                    )\n+                    order by info_request_events.created_at desc\n+                ), @public_body.id\n             ])\n         else\n             begin\n-              since_date = Date.strptime(since_date_str, \"%Y-%m-%d\")\n+                since_date = Date.strptime(since_date_str, \"%Y-%m-%d\")\n             rescue ArgumentError\n-              render :json => {\"errors\" => [\n-                      \"Parameter since_date must be in format yyyy-mm-dd (not '#{since_date_str}')\" ] },\n-                  :status => 500\n-              return\n+                render :json => {\"errors\" => [\n+                                    \"Parameter since_date must be in format yyyy-mm-dd (not '#{since_date_str}')\" ] },","path":"app/controllers/api_controller.rb","position":187,"original_position":187,"commit_id":"4681635dea0074a9d0f21072711b3eff23daa930","original_commit_id":"4681635dea0074a9d0f21072711b3eff23daa930","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?","gravatar_id":"38d9cefd9971a05bf447f07c6cd332cc","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Use 2 spaces for indentation in an array, relative to the start of the line where the left bracket is.<br>Line is too long. [118/80]<br>Space inside square brackets detected.","created_at":"2014-06-26T11:32:45Z","updated_at":"2014-06-26T11:32:45Z","html_url":"https://github.com/mysociety/alaveteli/pull/1631#discussion_r14235555","pull_request_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/1631","_links":{"self":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments/14235555"},"html":{"href":"https://github.com/mysociety/alaveteli/pull/1631#discussion_r14235555"},"pull_request":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/1631"}}},"pull_request":{"url":"https://api.github.com/repos/mysociety/alaveteli/pulls/1631","id":17484753,"html_url":"https://github.com/mysociety/alaveteli/pull/1631","diff_url":"https://github.com/mysociety/alaveteli/pull/1631.diff","patch_url":"https://github.com/mysociety/alaveteli/pull/1631.patch","issue_url":"https://api.github.com/repos/mysociety/alaveteli/issues/1631","number":1631,"state":"open","title":"Add request state updating functionality to API","user":{"login":"lizconlan","id":27760,"avatar_url":"https://avatars.githubusercontent.com/u/27760?","gravatar_id":"f943610b98a484c0e703a1567cad8d4d","url":"https://api.github.com/users/lizconlan","html_url":"https://github.com/lizconlan","followers_url":"https://api.github.com/users/lizconlan/followers","following_url":"https://api.github.com/users/lizconlan/following{/other_user}","gists_url":"https://api.github.com/users/lizconlan/gists{/gist_id}","starred_url":"https://api.github.com/users/lizconlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizconlan/subscriptions","organizations_url":"https://api.github.com/users/lizconlan/orgs","repos_url":"https://api.github.com/users/lizconlan/repos","events_url":"https://api.github.com/users/lizconlan/events{/privacy}","received_events_url":"https://api.github.com/users/lizconlan/received_events","type":"User","site_admin":false},"body":"WIP\r\n\r\nAdds a new `update_state` method to the API that uses the existing API key mechanism to send a status update to a request created via an external API request. Intended usage - foi-register end-users confirming whether the information they requested has been disclosed ([the parallel work on foi-register can be found here](https://github.com/mysociety/foi-register/tree/issues/169-ask-user-to-confirm-request-state)). Status description mismatches should be handled on the foi-register side but unexpected status values are rejected with a 500 error by the API.\r\n\r\nAdds an optional parameter to the pre-existing `add_correspondence` API method to allow it to update status (intended use - updates from a public body) if a `state` value is supplied. Again, the foi-register code is responsible for handling state description mismatches but in this case the API deals with erroneous data by ignoring that part of the request.\r\n\r\nApologies for having restructured `api_controller_spec` but I kept losing track of which API methods the various tests were targeting. I will be happy to change it back before finalising the Pull Request if I've caused trouble.","created_at":"2014-06-23T16:37:59Z","updated_at":"2014-06-26T11:32:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea76cf77b95ba80ff85987f6751e5181c7d5665c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/1631/commits","review_comments_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/1631/comments","review_comment_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/issues/1631/comments","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/4681635dea0074a9d0f21072711b3eff23daa930","head":{"label":"mysociety:issues/1418-update-described-state-via-api","ref":"issues/1418-update-described-state-via-api","sha":"4681635dea0074a9d0f21072711b3eff23daa930","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?","gravatar_id":"cb4e9c9ec6d33ee844baa03bd8f58cd3","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":1125389,"name":"alaveteli","full_name":"mysociety/alaveteli","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?","gravatar_id":"cb4e9c9ec6d33ee844baa03bd8f58cd3","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/alaveteli","description":"Provide a Freedom of Information request system for your jurisdiction","fork":false,"url":"https://api.github.com/repos/mysociety/alaveteli","forks_url":"https://api.github.com/repos/mysociety/alaveteli/forks","keys_url":"https://api.github.com/repos/mysociety/alaveteli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/alaveteli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/alaveteli/teams","hooks_url":"https://api.github.com/repos/mysociety/alaveteli/hooks","issue_events_url":"https://api.github.com/repos/mysociety/alaveteli/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/alaveteli/events","assignees_url":"https://api.github.com/repos/mysociety/alaveteli/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/alaveteli/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/alaveteli/tags","blobs_url":"https://api.github.com/repos/mysociety/alaveteli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/alaveteli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/alaveteli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/alaveteli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/alaveteli/languages","stargazers_url":"https://api.github.com/repos/mysociety/alaveteli/stargazers","contributors_url":"https://api.github.com/repos/mysociety/alaveteli/contributors","subscribers_url":"https://api.github.com/repos/mysociety/alaveteli/subscribers","subscription_url":"https://api.github.com/repos/mysociety/alaveteli/subscription","commits_url":"https://api.github.com/repos/mysociety/alaveteli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/alaveteli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/alaveteli/issues/comments/{number}","contents_url":"https://api.github.com/repos/mysociety/alaveteli/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/alaveteli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/alaveteli/merges","archive_url":"https://api.github.com/repos/mysociety/alaveteli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/alaveteli/downloads","issues_url":"https://api.github.com/repos/mysociety/alaveteli/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/alaveteli/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/alaveteli/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/alaveteli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/alaveteli/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/alaveteli/releases{/id}","created_at":"2010-11-30T13:11:39Z","updated_at":"2014-06-26T08:56:43Z","pushed_at":"2014-06-26T11:32:38Z","git_url":"git://github.com/mysociety/alaveteli.git","ssh_url":"git@github.com:mysociety/alaveteli.git","clone_url":"https://github.com/mysociety/alaveteli.git","svn_url":"https://github.com/mysociety/alaveteli","homepage":"http://alaveteli.org","size":82980,"stargazers_count":119,"watchers_count":119,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":76,"mirror_url":null,"open_issues_count":403,"forks":76,"open_issues":403,"watchers":119,"default_branch":"rails-3-develop"}},"base":{"label":"mysociety:rails-3-develop","ref":"rails-3-develop","sha":"b7b2a57f89d10735bbbff876a781c55336d1e0bd","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?","gravatar_id":"cb4e9c9ec6d33ee844baa03bd8f58cd3","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":1125389,"name":"alaveteli","full_name":"mysociety/alaveteli","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?","gravatar_id":"cb4e9c9ec6d33ee844baa03bd8f58cd3","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/alaveteli","description":"Provide a Freedom of Information request system for your jurisdiction","fork":false,"url":"https://api.github.com/repos/mysociety/alaveteli","forks_url":"https://api.github.com/repos/mysociety/alaveteli/forks","keys_url":"https://api.github.com/repos/mysociety/alaveteli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/alaveteli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/alaveteli/teams","hooks_url":"https://api.github.com/repos/mysociety/alaveteli/hooks","issue_events_url":"https://api.github.com/repos/mysociety/alaveteli/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/alaveteli/events","assignees_url":"https://api.github.com/repos/mysociety/alaveteli/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/alaveteli/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/alaveteli/tags","blobs_url":"https://api.github.com/repos/mysociety/alaveteli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/alaveteli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/alaveteli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/alaveteli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/alaveteli/languages","stargazers_url":"https://api.github.com/repos/mysociety/alaveteli/stargazers","contributors_url":"https://api.github.com/repos/mysociety/alaveteli/contributors","subscribers_url":"https://api.github.com/repos/mysociety/alaveteli/subscribers","subscription_url":"https://api.github.com/repos/mysociety/alaveteli/subscription","commits_url":"https://api.github.com/repos/mysociety/alaveteli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/alaveteli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/alaveteli/issues/comments/{number}","contents_url":"https://api.github.com/repos/mysociety/alaveteli/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/alaveteli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/alaveteli/merges","archive_url":"https://api.github.com/repos/mysociety/alaveteli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/alaveteli/downloads","issues_url":"https://api.github.com/repos/mysociety/alaveteli/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/alaveteli/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/alaveteli/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/alaveteli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/alaveteli/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/alaveteli/releases{/id}","created_at":"2010-11-30T13:11:39Z","updated_at":"2014-06-26T08:56:43Z","pushed_at":"2014-06-26T11:32:38Z","git_url":"git://github.com/mysociety/alaveteli.git","ssh_url":"git@github.com:mysociety/alaveteli.git","clone_url":"https://github.com/mysociety/alaveteli.git","svn_url":"https://github.com/mysociety/alaveteli","homepage":"http://alaveteli.org","size":82980,"stargazers_count":119,"watchers_count":119,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":76,"mirror_url":null,"open_issues_count":403,"forks":76,"open_issues":403,"watchers":119,"default_branch":"rails-3-develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/1631"},"html":{"href":"https://github.com/mysociety/alaveteli/pull/1631"},"issue":{"href":"https://api.github.com/repos/mysociety/alaveteli/issues/1631"},"comments":{"href":"https://api.github.com/repos/mysociety/alaveteli/issues/1631/comments"},"review_comments":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/1631/comments"},"review_comment":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/1631/commits"},"statuses":{"href":"https://api.github.com/repos/mysociety/alaveteli/statuses/4681635dea0074a9d0f21072711b3eff23daa930"}}}}