{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/comments/152305913","pull_request_review_id":78146961,"id":152305913,"diff_hunk":"@@ -74,32 +110,65 @@ class AppS3BucketViewSet(viewsets.ModelViewSet):\n \n     def perform_create(self, serializer):","path":"control_panel_api/views.py","position":94,"original_position":94,"commit_id":"e2fc2e1373565bb26dcd597c8d897fc064d64c15","original_commit_id":"e2fc2e1373565bb26dcd597c8d897fc064d64c15","user":{"login":"xoen","id":238563,"avatar_url":"https://avatars0.githubusercontent.com/u/238563?v=4","gravatar_id":"","url":"https://api.github.com/users/xoen","html_url":"https://github.com/xoen","followers_url":"https://api.github.com/users/xoen/followers","following_url":"https://api.github.com/users/xoen/following{/other_user}","gists_url":"https://api.github.com/users/xoen/gists{/gist_id}","starred_url":"https://api.github.com/users/xoen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xoen/subscriptions","organizations_url":"https://api.github.com/users/xoen/orgs","repos_url":"https://api.github.com/users/xoen/repos","events_url":"https://api.github.com/users/xoen/events{/privacy}","received_events_url":"https://api.github.com/users/xoen/received_events","type":"User","site_admin":false},"body":"Should this wrapped in a transaction as well?","created_at":"2017-11-21T15:18:58Z","updated_at":"2017-11-21T15:18:58Z","html_url":"https://github.com/ministryofjustice/analytics-platform-control-panel/pull/67#discussion_r152305913","pull_request_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/67","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/comments/152305913"},"html":{"href":"https://github.com/ministryofjustice/analytics-platform-control-panel/pull/67#discussion_r152305913"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/67","id":153671328,"html_url":"https://github.com/ministryofjustice/analytics-platform-control-panel/pull/67","diff_url":"https://github.com/ministryofjustice/analytics-platform-control-panel/pull/67.diff","patch_url":"https://github.com/ministryofjustice/analytics-platform-control-panel/pull/67.patch","issue_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues/67","number":67,"state":"open","locked":false,"title":"Handle aws and helm errors and add transaction support","user":{"login":"jmoz","id":94684,"avatar_url":"https://avatars0.githubusercontent.com/u/94684?v=4","gravatar_id":"","url":"https://api.github.com/users/jmoz","html_url":"https://github.com/jmoz","followers_url":"https://api.github.com/users/jmoz/followers","following_url":"https://api.github.com/users/jmoz/following{/other_user}","gists_url":"https://api.github.com/users/jmoz/gists{/gist_id}","starred_url":"https://api.github.com/users/jmoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmoz/subscriptions","organizations_url":"https://api.github.com/users/jmoz/orgs","repos_url":"https://api.github.com/users/jmoz/repos","events_url":"https://api.github.com/users/jmoz/events{/privacy}","received_events_url":"https://api.github.com/users/jmoz/received_events","type":"User","site_admin":false},"body":"## What\r\n\r\n- Add explicit transaction support on view functions.\r\n- AWS and helm explicit error handling - let the lower level exceptions bubble up to the view, log, then throw a subclassed APIView exception.\r\n- For 2 stage view operations e.g. aws call then helm call, if it fails on the 2nd helm call, we can revert the aws call.\r\n\r\n## How to review\r\n\r\n1. Run the tests.\r\n2. Rename the helm command for an obvious error on User create and check that the aws call is rolled back and no db item is saved.\r\n\r\nhttps://trello.com/c/GZphN2qR/479-db-transactions-aws-helm-error-handling-3","created_at":"2017-11-20T16:16:04Z","updated_at":"2017-11-21T15:18:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12191d0d7b2034c6e2cbbda2f4fa81133440cb2f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"andyhd","id":35194,"avatar_url":"https://avatars3.githubusercontent.com/u/35194?v=4","gravatar_id":"","url":"https://api.github.com/users/andyhd","html_url":"https://github.com/andyhd","followers_url":"https://api.github.com/users/andyhd/followers","following_url":"https://api.github.com/users/andyhd/following{/other_user}","gists_url":"https://api.github.com/users/andyhd/gists{/gist_id}","starred_url":"https://api.github.com/users/andyhd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyhd/subscriptions","organizations_url":"https://api.github.com/users/andyhd/orgs","repos_url":"https://api.github.com/users/andyhd/repos","events_url":"https://api.github.com/users/andyhd/events{/privacy}","received_events_url":"https://api.github.com/users/andyhd/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/67/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/67/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues/67/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/statuses/e2fc2e1373565bb26dcd597c8d897fc064d64c15","head":{"label":"ministryofjustice:aws-error-handling","ref":"aws-error-handling","sha":"e2fc2e1373565bb26dcd597c8d897fc064d64c15","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":97129318,"name":"analytics-platform-control-panel","full_name":"ministryofjustice/analytics-platform-control-panel","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/analytics-platform-control-panel","description":"Control panel contains admin functions like creating users and granting access to apps","fork":false,"url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel","forks_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/forks","keys_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/events","assignees_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/merges","archive_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/deployments","created_at":"2017-07-13T14:05:47Z","updated_at":"2017-11-07T01:17:32Z","pushed_at":"2017-11-20T16:16:05Z","git_url":"git://github.com/ministryofjustice/analytics-platform-control-panel.git","ssh_url":"git@github.com:ministryofjustice/analytics-platform-control-panel.git","clone_url":"https://github.com/ministryofjustice/analytics-platform-control-panel.git","svn_url":"https://github.com/ministryofjustice/analytics-platform-control-panel","homepage":null,"size":243,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"9ee80ceb53fd8a00fab642c530285b285373377b","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":97129318,"name":"analytics-platform-control-panel","full_name":"ministryofjustice/analytics-platform-control-panel","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/analytics-platform-control-panel","description":"Control panel contains admin functions like creating users and granting access to apps","fork":false,"url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel","forks_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/forks","keys_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/events","assignees_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/merges","archive_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/deployments","created_at":"2017-07-13T14:05:47Z","updated_at":"2017-11-07T01:17:32Z","pushed_at":"2017-11-20T16:16:05Z","git_url":"git://github.com/ministryofjustice/analytics-platform-control-panel.git","ssh_url":"git@github.com:ministryofjustice/analytics-platform-control-panel.git","clone_url":"https://github.com/ministryofjustice/analytics-platform-control-panel.git","svn_url":"https://github.com/ministryofjustice/analytics-platform-control-panel","homepage":null,"size":243,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/67"},"html":{"href":"https://github.com/ministryofjustice/analytics-platform-control-panel/pull/67"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues/67"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/analytics-platform-control-panel/statuses/e2fc2e1373565bb26dcd597c8d897fc064d64c15"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"xoen"}}