{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/rawls/pulls/comments/40953771","id":40953771,"diff_hunk":"@@ -100,6 +107,9 @@ class GraphEntityDAO extends EntityDAO with GraphDAO {\n   }\n \n   override def cloneEntities(destWorkspaceContext: WorkspaceContext, entities: Seq[Entity], txn: RawlsTransaction) = txn withGraph { db =>\n-    entities.map( e => save(destWorkspaceContext, e, txn) )\n+    //save the entities with no references to other entities first","path":"src/main/scala/org/broadinstitute/dsde/rawls/dataaccess/GraphEntityDAO.scala","position":21,"original_position":21,"commit_id":"f84cdad4539f4d743b926cd86eedef932f99da38","original_commit_id":"f84cdad4539f4d743b926cd86eedef932f99da38","user":{"login":"helgridly","id":775136,"avatar_url":"https://avatars.githubusercontent.com/u/775136?v=3","gravatar_id":"","url":"https://api.github.com/users/helgridly","html_url":"https://github.com/helgridly","followers_url":"https://api.github.com/users/helgridly/followers","following_url":"https://api.github.com/users/helgridly/following{/other_user}","gists_url":"https://api.github.com/users/helgridly/gists{/gist_id}","starred_url":"https://api.github.com/users/helgridly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgridly/subscriptions","organizations_url":"https://api.github.com/users/helgridly/orgs","repos_url":"https://api.github.com/users/helgridly/repos","events_url":"https://api.github.com/users/helgridly/events{/privacy}","received_events_url":"https://api.github.com/users/helgridly/received_events","type":"User","site_admin":false},"body":"I think we need to say here why we're doing this; it's not obvious.","created_at":"2015-10-01T19:09:43Z","updated_at":"2015-10-01T19:09:43Z","html_url":"https://github.com/broadinstitute/rawls/pull/150#discussion_r40953771","pull_request_url":"https://api.github.com/repos/broadinstitute/rawls/pulls/150","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/rawls/pulls/comments/40953771"},"html":{"href":"https://github.com/broadinstitute/rawls/pull/150#discussion_r40953771"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/rawls/pulls/150"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/rawls/pulls/150","id":46446084,"html_url":"https://github.com/broadinstitute/rawls/pull/150","diff_url":"https://github.com/broadinstitute/rawls/pull/150.diff","patch_url":"https://github.com/broadinstitute/rawls/pull/150.patch","issue_url":"https://api.github.com/repos/broadinstitute/rawls/issues/150","number":150,"state":"open","locked":false,"title":"Fix copy entities","user":{"login":"MatthewBemis","id":7257391,"avatar_url":"https://avatars.githubusercontent.com/u/7257391?v=3","gravatar_id":"","url":"https://api.github.com/users/MatthewBemis","html_url":"https://github.com/MatthewBemis","followers_url":"https://api.github.com/users/MatthewBemis/followers","following_url":"https://api.github.com/users/MatthewBemis/following{/other_user}","gists_url":"https://api.github.com/users/MatthewBemis/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthewBemis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthewBemis/subscriptions","organizations_url":"https://api.github.com/users/MatthewBemis/orgs","repos_url":"https://api.github.com/users/MatthewBemis/repos","events_url":"https://api.github.com/users/MatthewBemis/events{/privacy}","received_events_url":"https://api.github.com/users/MatthewBemis/received_events","type":"User","site_admin":false},"body":"This PR solves two separate bugs related to [DSDEEPB-1389](https://broadinstitute.atlassian.net/browse/DSDEEPB-1389).\r\n\r\nThe first was related to listEntitiesAllTypes, which would break if there were no entities in the workspace. This is the problem that silver team was running into. Upon fixing that, a second problem was uncovered. The second problem was more significant and the fix for that has been extracted from Hussein's mummified PR #114, particularly [this commit](https://github.com/broadinstitute/rawls/commit/2e6fde0bc0d360e141bcd393b542ada6779155b7).\r\n\r\n- [x] **Submitter**: Rebase to master. DO NOT SQUASH\r\n- [x] **Submitter**: Make sure Swagger is updated if API changes\r\n- [x] **Submitter**: Make sure documentation for code is complete\r\n- [x] **Submitter**: Review code comments; remove done TODOs, create stories for remaining TODOs\r\n- [x] **Submitter**: Include the JIRA issue number in the PR description\r\n- [x] **Submitter**: Add description or comments on the PR explaining the hows/whys (if not obvious)\r\n- [x] **Submitter**: **Assign PR to** ![](http://i.imgur.com/9dLzbPd.png)\r\n- [x] ![](http://i.imgur.com/9dLzbPd.png): does a once-over of the PR\r\n- [x] ![](http://i.imgur.com/9dLzbPd.png): Anoint a lead reviewer (LR). **Assign PR to LR**\r\n- [ ] **LR**: Initial review by LR and others.\r\n- [ ] Comment / review / update cycle:\r\n  * Rest of team may comments on PR at will\r\n  * **LR assigns to submitter** for feedback fixes\r\n  * Submitter updates documentation as needed\r\n  * Submitter rebases to master again if necessary\r\n  * Submitter makes further commits. DO NOT SQUASH. **Reassign to LR** for further feedback\r\n- [ ] **LR**: sign off, **assign to submitter** to finalize\r\n- [ ] **Submitter**: Squash commits, rebase if necessary\r\n- [ ] **Submitter**: Verify all tests go green, including CI tests\r\n- [ ] **Submitter**: Merge to master\r\n- [ ] **Submitter**: Delete branch after merge\r\n- [ ] **Submitter**: Check configuration files in Jenkins in case they need changes\r\n- [ ] **Submitter**: Verify swagger UI on dev server still works after deployment\r\n- [ ] **Submitter**: Inform other teams of any API changes via hipchat and/or email\r\n- [ ] **Submitter**: Mark JIRA issue as resolved once this checklist is completed","created_at":"2015-09-30T19:36:13Z","updated_at":"2015-10-01T19:09:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5331aac007272c4aa619cf68ba75697aaf315ae","assignee":{"login":"helgridly","id":775136,"avatar_url":"https://avatars.githubusercontent.com/u/775136?v=3","gravatar_id":"","url":"https://api.github.com/users/helgridly","html_url":"https://github.com/helgridly","followers_url":"https://api.github.com/users/helgridly/followers","following_url":"https://api.github.com/users/helgridly/following{/other_user}","gists_url":"https://api.github.com/users/helgridly/gists{/gist_id}","starred_url":"https://api.github.com/users/helgridly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgridly/subscriptions","organizations_url":"https://api.github.com/users/helgridly/orgs","repos_url":"https://api.github.com/users/helgridly/repos","events_url":"https://api.github.com/users/helgridly/events{/privacy}","received_events_url":"https://api.github.com/users/helgridly/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/rawls/pulls/150/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/rawls/pulls/150/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/rawls/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/rawls/issues/150/comments","statuses_url":"https://api.github.com/repos/broadinstitute/rawls/statuses/f84cdad4539f4d743b926cd86eedef932f99da38","head":{"label":"broadinstitute:fix_copy_entities","ref":"fix_copy_entities","sha":"f84cdad4539f4d743b926cd86eedef932f99da38","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34129770,"name":"rawls","full_name":"broadinstitute/rawls","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/rawls","description":"Rawls service for DSDE","fork":false,"url":"https://api.github.com/repos/broadinstitute/rawls","forks_url":"https://api.github.com/repos/broadinstitute/rawls/forks","keys_url":"https://api.github.com/repos/broadinstitute/rawls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/rawls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/rawls/teams","hooks_url":"https://api.github.com/repos/broadinstitute/rawls/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/rawls/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/rawls/events","assignees_url":"https://api.github.com/repos/broadinstitute/rawls/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/rawls/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/rawls/tags","blobs_url":"https://api.github.com/repos/broadinstitute/rawls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/rawls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/rawls/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/rawls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/rawls/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/rawls/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/rawls/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/rawls/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/rawls/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/rawls/subscription","commits_url":"https://api.github.com/repos/broadinstitute/rawls/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/rawls/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/rawls/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/rawls/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/rawls/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/rawls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/rawls/merges","archive_url":"https://api.github.com/repos/broadinstitute/rawls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/rawls/downloads","issues_url":"https://api.github.com/repos/broadinstitute/rawls/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/rawls/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/rawls/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/rawls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/rawls/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/rawls/releases{/id}","created_at":"2015-04-17T17:16:07Z","updated_at":"2015-06-12T15:10:03Z","pushed_at":"2015-09-30T20:51:52Z","git_url":"git://github.com/broadinstitute/rawls.git","ssh_url":"git@github.com:broadinstitute/rawls.git","clone_url":"https://github.com/broadinstitute/rawls.git","svn_url":"https://github.com/broadinstitute/rawls","homepage":null,"size":4137,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":3,"default_branch":"master"}},"base":{"label":"broadinstitute:master","ref":"master","sha":"cccea0e66c2bff1cd961a73b22d33dc86565d461","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34129770,"name":"rawls","full_name":"broadinstitute/rawls","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/rawls","description":"Rawls service for DSDE","fork":false,"url":"https://api.github.com/repos/broadinstitute/rawls","forks_url":"https://api.github.com/repos/broadinstitute/rawls/forks","keys_url":"https://api.github.com/repos/broadinstitute/rawls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/rawls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/rawls/teams","hooks_url":"https://api.github.com/repos/broadinstitute/rawls/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/rawls/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/rawls/events","assignees_url":"https://api.github.com/repos/broadinstitute/rawls/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/rawls/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/rawls/tags","blobs_url":"https://api.github.com/repos/broadinstitute/rawls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/rawls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/rawls/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/rawls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/rawls/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/rawls/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/rawls/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/rawls/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/rawls/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/rawls/subscription","commits_url":"https://api.github.com/repos/broadinstitute/rawls/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/rawls/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/rawls/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/rawls/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/rawls/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/rawls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/rawls/merges","archive_url":"https://api.github.com/repos/broadinstitute/rawls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/rawls/downloads","issues_url":"https://api.github.com/repos/broadinstitute/rawls/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/rawls/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/rawls/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/rawls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/rawls/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/rawls/releases{/id}","created_at":"2015-04-17T17:16:07Z","updated_at":"2015-06-12T15:10:03Z","pushed_at":"2015-09-30T20:51:52Z","git_url":"git://github.com/broadinstitute/rawls.git","ssh_url":"git@github.com:broadinstitute/rawls.git","clone_url":"https://github.com/broadinstitute/rawls.git","svn_url":"https://github.com/broadinstitute/rawls","homepage":null,"size":4137,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/rawls/pulls/150"},"html":{"href":"https://github.com/broadinstitute/rawls/pull/150"},"issue":{"href":"https://api.github.com/repos/broadinstitute/rawls/issues/150"},"comments":{"href":"https://api.github.com/repos/broadinstitute/rawls/issues/150/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/rawls/pulls/150/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/rawls/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/rawls/pulls/150/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/rawls/statuses/f84cdad4539f4d743b926cd86eedef932f99da38"}}}}