{"action":"created","comment":{"url":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/comments/125322809","pull_request_review_id":47701511,"id":125322809,"diff_hunk":"@@ -65,18 +65,15 @@ class FileUpload @Inject()(val sec: SecuredActions,\n   val chooseXMLFile = sec.AsyncAuthenticatedAction() { authContext => implicit request =>\n \n     val result = for {\n-      envelopeId     <- fileUploadService.createEnvelope\n-      _              <- EitherT.right[Future,CBCErrors,CacheMap](cache.save(envelopeId))\n-      fileId          = UUID.randomUUID.toString\n-      _              <- EitherT.right[Future,CBCErrors,CacheMap](cache.save(FileId(fileId)))\n+      envelopeId     <- cache.readOrCreate[EnvelopeId](fileUploadService.createEnvelope.toOption).toRight(UnexpectedState(\"Unable to get envelopeId\"))","path":"app/uk/gov/hmrc/cbcrfrontend/controllers/FileUpload.scala","position":24,"original_position":24,"commit_id":"0971e1aabcbe0a801a830b3004d6d6d2dbd0be57","original_commit_id":"0971e1aabcbe0a801a830b3004d6d6d2dbd0be57","user":{"login":"MaxWorgan","id":1410832,"avatar_url":"https://avatars0.githubusercontent.com/u/1410832?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxWorgan","html_url":"https://github.com/MaxWorgan","followers_url":"https://api.github.com/users/MaxWorgan/followers","following_url":"https://api.github.com/users/MaxWorgan/following{/other_user}","gists_url":"https://api.github.com/users/MaxWorgan/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxWorgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxWorgan/subscriptions","organizations_url":"https://api.github.com/users/MaxWorgan/orgs","repos_url":"https://api.github.com/users/MaxWorgan/repos","events_url":"https://api.github.com/users/MaxWorgan/events{/privacy}","received_events_url":"https://api.github.com/users/MaxWorgan/received_events","type":"User","site_admin":false},"body":"this could be\r\n```cache.readOrCreate[EnvelopeId](fileUploadService.createEnvelope)\r\n```","created_at":"2017-07-03T16:10:54Z","updated_at":"2017-07-03T16:10:54Z","html_url":"https://github.com/hmrc/cbcr-frontend/pull/71#discussion_r125322809","pull_request_url":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/comments/125322809"},"html":{"href":"https://github.com/hmrc/cbcr-frontend/pull/71#discussion_r125322809"},"pull_request":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/71","id":128658667,"html_url":"https://github.com/hmrc/cbcr-frontend/pull/71","diff_url":"https://github.com/hmrc/cbcr-frontend/pull/71.diff","patch_url":"https://github.com/hmrc/cbcr-frontend/pull/71.patch","issue_url":"https://api.github.com/repos/hmrc/cbcr-frontend/issues/71","number":71,"state":"open","locked":false,"title":"Bugfix/multiple envelope ids","user":{"login":"peteanning","id":22272449,"avatar_url":"https://avatars0.githubusercontent.com/u/22272449?v=3","gravatar_id":"","url":"https://api.github.com/users/peteanning","html_url":"https://github.com/peteanning","followers_url":"https://api.github.com/users/peteanning/followers","following_url":"https://api.github.com/users/peteanning/following{/other_user}","gists_url":"https://api.github.com/users/peteanning/gists{/gist_id}","starred_url":"https://api.github.com/users/peteanning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peteanning/subscriptions","organizations_url":"https://api.github.com/users/peteanning/orgs","repos_url":"https://api.github.com/users/peteanning/repos","events_url":"https://api.github.com/users/peteanning/events{/privacy}","received_events_url":"https://api.github.com/users/peteanning/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-03T16:03:52Z","updated_at":"2017-07-03T16:10:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8dc839788153d3308f3b2c014c7c156b88b68de0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/71/commits","review_comments_url":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/71/comments","review_comment_url":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmrc/cbcr-frontend/issues/71/comments","statuses_url":"https://api.github.com/repos/hmrc/cbcr-frontend/statuses/0971e1aabcbe0a801a830b3004d6d6d2dbd0be57","head":{"label":"hmrc:bugfix/multipleEnvelopeIds","ref":"bugfix/multipleEnvelopeIds","sha":"0971e1aabcbe0a801a830b3004d6d6d2dbd0be57","user":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars2.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"repo":{"id":84958034,"name":"cbcr-frontend","full_name":"hmrc/cbcr-frontend","owner":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars2.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmrc/cbcr-frontend","description":null,"fork":false,"url":"https://api.github.com/repos/hmrc/cbcr-frontend","forks_url":"https://api.github.com/repos/hmrc/cbcr-frontend/forks","keys_url":"https://api.github.com/repos/hmrc/cbcr-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmrc/cbcr-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmrc/cbcr-frontend/teams","hooks_url":"https://api.github.com/repos/hmrc/cbcr-frontend/hooks","issue_events_url":"https://api.github.com/repos/hmrc/cbcr-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/hmrc/cbcr-frontend/events","assignees_url":"https://api.github.com/repos/hmrc/cbcr-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/hmrc/cbcr-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/hmrc/cbcr-frontend/tags","blobs_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmrc/cbcr-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/hmrc/cbcr-frontend/languages","stargazers_url":"https://api.github.com/repos/hmrc/cbcr-frontend/stargazers","contributors_url":"https://api.github.com/repos/hmrc/cbcr-frontend/contributors","subscribers_url":"https://api.github.com/repos/hmrc/cbcr-frontend/subscribers","subscription_url":"https://api.github.com/repos/hmrc/cbcr-frontend/subscription","commits_url":"https://api.github.com/repos/hmrc/cbcr-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmrc/cbcr-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmrc/cbcr-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmrc/cbcr-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/hmrc/cbcr-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmrc/cbcr-frontend/merges","archive_url":"https://api.github.com/repos/hmrc/cbcr-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmrc/cbcr-frontend/downloads","issues_url":"https://api.github.com/repos/hmrc/cbcr-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/hmrc/cbcr-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/hmrc/cbcr-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmrc/cbcr-frontend/labels{/name}","releases_url":"https://api.github.com/repos/hmrc/cbcr-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/hmrc/cbcr-frontend/deployments","created_at":"2017-03-14T14:23:47Z","updated_at":"2017-03-14T14:24:06Z","pushed_at":"2017-07-03T16:03:53Z","git_url":"git://github.com/hmrc/cbcr-frontend.git","ssh_url":"git@github.com:hmrc/cbcr-frontend.git","clone_url":"https://github.com/hmrc/cbcr-frontend.git","svn_url":"https://github.com/hmrc/cbcr-frontend","homepage":"","size":12041,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hmrc:develop","ref":"develop","sha":"809d138e81961ff58376dcbd8fd0cc793fcaf716","user":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars2.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"repo":{"id":84958034,"name":"cbcr-frontend","full_name":"hmrc/cbcr-frontend","owner":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars2.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmrc/cbcr-frontend","description":null,"fork":false,"url":"https://api.github.com/repos/hmrc/cbcr-frontend","forks_url":"https://api.github.com/repos/hmrc/cbcr-frontend/forks","keys_url":"https://api.github.com/repos/hmrc/cbcr-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmrc/cbcr-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmrc/cbcr-frontend/teams","hooks_url":"https://api.github.com/repos/hmrc/cbcr-frontend/hooks","issue_events_url":"https://api.github.com/repos/hmrc/cbcr-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/hmrc/cbcr-frontend/events","assignees_url":"https://api.github.com/repos/hmrc/cbcr-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/hmrc/cbcr-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/hmrc/cbcr-frontend/tags","blobs_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmrc/cbcr-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/hmrc/cbcr-frontend/languages","stargazers_url":"https://api.github.com/repos/hmrc/cbcr-frontend/stargazers","contributors_url":"https://api.github.com/repos/hmrc/cbcr-frontend/contributors","subscribers_url":"https://api.github.com/repos/hmrc/cbcr-frontend/subscribers","subscription_url":"https://api.github.com/repos/hmrc/cbcr-frontend/subscription","commits_url":"https://api.github.com/repos/hmrc/cbcr-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmrc/cbcr-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmrc/cbcr-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmrc/cbcr-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmrc/cbcr-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/hmrc/cbcr-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmrc/cbcr-frontend/merges","archive_url":"https://api.github.com/repos/hmrc/cbcr-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmrc/cbcr-frontend/downloads","issues_url":"https://api.github.com/repos/hmrc/cbcr-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/hmrc/cbcr-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/hmrc/cbcr-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmrc/cbcr-frontend/labels{/name}","releases_url":"https://api.github.com/repos/hmrc/cbcr-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/hmrc/cbcr-frontend/deployments","created_at":"2017-03-14T14:23:47Z","updated_at":"2017-03-14T14:24:06Z","pushed_at":"2017-07-03T16:03:53Z","git_url":"git://github.com/hmrc/cbcr-frontend.git","ssh_url":"git@github.com:hmrc/cbcr-frontend.git","clone_url":"https://github.com/hmrc/cbcr-frontend.git","svn_url":"https://github.com/hmrc/cbcr-frontend","homepage":"","size":12041,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/71"},"html":{"href":"https://github.com/hmrc/cbcr-frontend/pull/71"},"issue":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/issues/71"},"comments":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/hmrc/cbcr-frontend/statuses/0971e1aabcbe0a801a830b3004d6d6d2dbd0be57"}}}}
{"actor":{"display_login":"MaxWorgan"}}