{"action":"created","comment":{"url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/comments/239070104","pull_request_review_id":181762660,"id":239070104,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTA3MDEwNA==","diff_hunk":"@@ -83,16 +83,30 @@ private void addGetDocForProject(\n             String projectName,\n             JsonObject jsonGetDoc\n     ) {\n-        getDoc.put(\n-                projectName,\n-                new GetDocResult(\n-                        jsonGetDoc.get(\"error\"),\n-                        jsonGetDoc.get(\"versionID\").getAsInt(),\n-                        jsonGetDoc.get(\"createdAt\").getAsString(),\n-                        jsonGetDoc.get(\"email\").getAsString(),\n-                        jsonGetDoc.get(\"name\").getAsString()\n-                )\n-        );\n+        if (jsonGetDoc.has(\"migratedFromId\")) {","path":"src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIStateBuilder.java","position":14,"original_position":14,"commit_id":"031a2e1b292ea9d56c6220e6b1d574fbdaf7dbe9","original_commit_id":"2ef79bd19f5431c009c463df1d9eddcd340a8897","user":{"login":"jdleesmiller","id":160829,"node_id":"MDQ6VXNlcjE2MDgyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/160829?v=4","gravatar_id":"","url":"https://api.github.com/users/jdleesmiller","html_url":"https://github.com/jdleesmiller","followers_url":"https://api.github.com/users/jdleesmiller/followers","following_url":"https://api.github.com/users/jdleesmiller/following{/other_user}","gists_url":"https://api.github.com/users/jdleesmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/jdleesmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdleesmiller/subscriptions","organizations_url":"https://api.github.com/users/jdleesmiller/orgs","repos_url":"https://api.github.com/users/jdleesmiller/repos","events_url":"https://api.github.com/users/jdleesmiller/events{/privacy}","received_events_url":"https://api.github.com/users/jdleesmiller/received_events","type":"User","site_admin":false},"body":"It seems like quite a lot of duplication to call different constructors. What do you think to something like\r\n```\r\nString migratedFromId = null;\r\nif (jsonGetDoc.has(\"migratedFromId\")) {\r\n  migratedFromId = jsonGetDoc.get(\"migratedFromId\")\r\n}\r\n```\r\nand then pass that to the new constructor.\r\n\r\nAlso to check: do we still need the old constructor without this argument?","created_at":"2018-12-05T13:49:56Z","updated_at":"2018-12-05T13:50:38Z","html_url":"https://github.com/overleaf/writelatex-git-bridge/pull/45#discussion_r239070104","pull_request_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/45","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/comments/239070104"},"html":{"href":"https://github.com/overleaf/writelatex-git-bridge/pull/45#discussion_r239070104"},"pull_request":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/45","id":233877712,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzODc3NzEy","html_url":"https://github.com/overleaf/writelatex-git-bridge/pull/45","diff_url":"https://github.com/overleaf/writelatex-git-bridge/pull/45.diff","patch_url":"https://github.com/overleaf/writelatex-git-bridge/pull/45.patch","issue_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues/45","number":45,"state":"open","locked":false,"title":"Migrate repos from v1 to v2","user":{"login":"ShaneKilkelly","id":1540054,"node_id":"MDQ6VXNlcjE1NDAwNTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1540054?v=4","gravatar_id":"","url":"https://api.github.com/users/ShaneKilkelly","html_url":"https://github.com/ShaneKilkelly","followers_url":"https://api.github.com/users/ShaneKilkelly/followers","following_url":"https://api.github.com/users/ShaneKilkelly/following{/other_user}","gists_url":"https://api.github.com/users/ShaneKilkelly/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneKilkelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneKilkelly/subscriptions","organizations_url":"https://api.github.com/users/ShaneKilkelly/orgs","repos_url":"https://api.github.com/users/ShaneKilkelly/repos","events_url":"https://api.github.com/users/ShaneKilkelly/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneKilkelly/received_events","type":"User","site_admin":false},"body":"Child of https://github.com/overleaf/sharelatex/issues/1247\r\n\r\nAllows git-bridge to handle projects which have migrated from v1 to v2.","created_at":"2018-11-27T11:36:36Z","updated_at":"2018-12-05T13:50:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b641cbecadc1649ad358884f6f225daa40e81d1","assignee":{"login":"jdleesmiller","id":160829,"node_id":"MDQ6VXNlcjE2MDgyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/160829?v=4","gravatar_id":"","url":"https://api.github.com/users/jdleesmiller","html_url":"https://github.com/jdleesmiller","followers_url":"https://api.github.com/users/jdleesmiller/followers","following_url":"https://api.github.com/users/jdleesmiller/following{/other_user}","gists_url":"https://api.github.com/users/jdleesmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/jdleesmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdleesmiller/subscriptions","organizations_url":"https://api.github.com/users/jdleesmiller/orgs","repos_url":"https://api.github.com/users/jdleesmiller/repos","events_url":"https://api.github.com/users/jdleesmiller/events{/privacy}","received_events_url":"https://api.github.com/users/jdleesmiller/received_events","type":"User","site_admin":false},"assignees":[{"login":"jdleesmiller","id":160829,"node_id":"MDQ6VXNlcjE2MDgyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/160829?v=4","gravatar_id":"","url":"https://api.github.com/users/jdleesmiller","html_url":"https://github.com/jdleesmiller","followers_url":"https://api.github.com/users/jdleesmiller/followers","following_url":"https://api.github.com/users/jdleesmiller/following{/other_user}","gists_url":"https://api.github.com/users/jdleesmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/jdleesmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdleesmiller/subscriptions","organizations_url":"https://api.github.com/users/jdleesmiller/orgs","repos_url":"https://api.github.com/users/jdleesmiller/repos","events_url":"https://api.github.com/users/jdleesmiller/events{/privacy}","received_events_url":"https://api.github.com/users/jdleesmiller/received_events","type":"User","site_admin":false},{"login":"ShaneKilkelly","id":1540054,"node_id":"MDQ6VXNlcjE1NDAwNTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1540054?v=4","gravatar_id":"","url":"https://api.github.com/users/ShaneKilkelly","html_url":"https://github.com/ShaneKilkelly","followers_url":"https://api.github.com/users/ShaneKilkelly/followers","following_url":"https://api.github.com/users/ShaneKilkelly/following{/other_user}","gists_url":"https://api.github.com/users/ShaneKilkelly/gists{/gist_id}","starred_url":"https://api.github.com/users/ShaneKilkelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShaneKilkelly/subscriptions","organizations_url":"https://api.github.com/users/ShaneKilkelly/orgs","repos_url":"https://api.github.com/users/ShaneKilkelly/repos","events_url":"https://api.github.com/users/ShaneKilkelly/events{/privacy}","received_events_url":"https://api.github.com/users/ShaneKilkelly/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":320478112,"node_id":"MDU6TGFiZWwzMjA0NzgxMTI=","url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/labels/Review","name":"Review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/45/commits","review_comments_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/45/comments","review_comment_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues/45/comments","statuses_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/statuses/031a2e1b292ea9d56c6220e6b1d574fbdaf7dbe9","head":{"label":"overleaf:sk-migrate-repos-v1-v2","ref":"sk-migrate-repos-v1-v2","sha":"031a2e1b292ea9d56c6220e6b1d574fbdaf7dbe9","user":{"login":"overleaf","id":6359919,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYzNTk5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6359919?v=4","gravatar_id":"","url":"https://api.github.com/users/overleaf","html_url":"https://github.com/overleaf","followers_url":"https://api.github.com/users/overleaf/followers","following_url":"https://api.github.com/users/overleaf/following{/other_user}","gists_url":"https://api.github.com/users/overleaf/gists{/gist_id}","starred_url":"https://api.github.com/users/overleaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overleaf/subscriptions","organizations_url":"https://api.github.com/users/overleaf/orgs","repos_url":"https://api.github.com/users/overleaf/repos","events_url":"https://api.github.com/users/overleaf/events{/privacy}","received_events_url":"https://api.github.com/users/overleaf/received_events","type":"Organization","site_admin":false},"repo":{"id":28834984,"node_id":"MDEwOlJlcG9zaXRvcnkyODgzNDk4NA==","name":"writelatex-git-bridge","full_name":"overleaf/writelatex-git-bridge","private":false,"owner":{"login":"overleaf","id":6359919,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYzNTk5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6359919?v=4","gravatar_id":"","url":"https://api.github.com/users/overleaf","html_url":"https://github.com/overleaf","followers_url":"https://api.github.com/users/overleaf/followers","following_url":"https://api.github.com/users/overleaf/following{/other_user}","gists_url":"https://api.github.com/users/overleaf/gists{/gist_id}","starred_url":"https://api.github.com/users/overleaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overleaf/subscriptions","organizations_url":"https://api.github.com/users/overleaf/orgs","repos_url":"https://api.github.com/users/overleaf/repos","events_url":"https://api.github.com/users/overleaf/events{/privacy}","received_events_url":"https://api.github.com/users/overleaf/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/overleaf/writelatex-git-bridge","description":"Bridge between WriteLatex and Git.","fork":true,"url":"https://api.github.com/repos/overleaf/writelatex-git-bridge","forks_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/forks","keys_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/teams","hooks_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/hooks","issue_events_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues/events{/number}","events_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/events","assignees_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/assignees{/user}","branches_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/branches{/branch}","tags_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/tags","blobs_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/refs{/sha}","trees_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/statuses/{sha}","languages_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/languages","stargazers_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/stargazers","contributors_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/contributors","subscribers_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/subscribers","subscription_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/subscription","commits_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/commits{/sha}","git_commits_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/commits{/sha}","comments_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/comments{/number}","issue_comment_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues/comments{/number}","contents_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/contents/{+path}","compare_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/merges","archive_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/downloads","issues_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues{/number}","pulls_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls{/number}","milestones_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/milestones{/number}","notifications_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/labels{/name}","releases_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/releases{/id}","deployments_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/deployments","created_at":"2015-01-05T22:29:08Z","updated_at":"2018-11-15T09:53:05Z","pushed_at":"2018-12-05T10:43:21Z","git_url":"git://github.com/overleaf/writelatex-git-bridge.git","ssh_url":"git@github.com:overleaf/writelatex-git-bridge.git","clone_url":"https://github.com/overleaf/writelatex-git-bridge.git","svn_url":"https://github.com/overleaf/writelatex-git-bridge","homepage":"","size":23294,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"overleaf:master","ref":"master","sha":"1bc9d83131b13a5fcb0ad927aab13993d98b80e4","user":{"login":"overleaf","id":6359919,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYzNTk5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6359919?v=4","gravatar_id":"","url":"https://api.github.com/users/overleaf","html_url":"https://github.com/overleaf","followers_url":"https://api.github.com/users/overleaf/followers","following_url":"https://api.github.com/users/overleaf/following{/other_user}","gists_url":"https://api.github.com/users/overleaf/gists{/gist_id}","starred_url":"https://api.github.com/users/overleaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overleaf/subscriptions","organizations_url":"https://api.github.com/users/overleaf/orgs","repos_url":"https://api.github.com/users/overleaf/repos","events_url":"https://api.github.com/users/overleaf/events{/privacy}","received_events_url":"https://api.github.com/users/overleaf/received_events","type":"Organization","site_admin":false},"repo":{"id":28834984,"node_id":"MDEwOlJlcG9zaXRvcnkyODgzNDk4NA==","name":"writelatex-git-bridge","full_name":"overleaf/writelatex-git-bridge","private":false,"owner":{"login":"overleaf","id":6359919,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYzNTk5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6359919?v=4","gravatar_id":"","url":"https://api.github.com/users/overleaf","html_url":"https://github.com/overleaf","followers_url":"https://api.github.com/users/overleaf/followers","following_url":"https://api.github.com/users/overleaf/following{/other_user}","gists_url":"https://api.github.com/users/overleaf/gists{/gist_id}","starred_url":"https://api.github.com/users/overleaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overleaf/subscriptions","organizations_url":"https://api.github.com/users/overleaf/orgs","repos_url":"https://api.github.com/users/overleaf/repos","events_url":"https://api.github.com/users/overleaf/events{/privacy}","received_events_url":"https://api.github.com/users/overleaf/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/overleaf/writelatex-git-bridge","description":"Bridge between WriteLatex and Git.","fork":true,"url":"https://api.github.com/repos/overleaf/writelatex-git-bridge","forks_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/forks","keys_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/teams","hooks_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/hooks","issue_events_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues/events{/number}","events_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/events","assignees_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/assignees{/user}","branches_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/branches{/branch}","tags_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/tags","blobs_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/refs{/sha}","trees_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/statuses/{sha}","languages_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/languages","stargazers_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/stargazers","contributors_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/contributors","subscribers_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/subscribers","subscription_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/subscription","commits_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/commits{/sha}","git_commits_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/git/commits{/sha}","comments_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/comments{/number}","issue_comment_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues/comments{/number}","contents_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/contents/{+path}","compare_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/merges","archive_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/downloads","issues_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues{/number}","pulls_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls{/number}","milestones_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/milestones{/number}","notifications_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/labels{/name}","releases_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/releases{/id}","deployments_url":"https://api.github.com/repos/overleaf/writelatex-git-bridge/deployments","created_at":"2015-01-05T22:29:08Z","updated_at":"2018-11-15T09:53:05Z","pushed_at":"2018-12-05T10:43:21Z","git_url":"git://github.com/overleaf/writelatex-git-bridge.git","ssh_url":"git@github.com:overleaf/writelatex-git-bridge.git","clone_url":"https://github.com/overleaf/writelatex-git-bridge.git","svn_url":"https://github.com/overleaf/writelatex-git-bridge","homepage":"","size":23294,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/45"},"html":{"href":"https://github.com/overleaf/writelatex-git-bridge/pull/45"},"issue":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues/45"},"comments":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/overleaf/writelatex-git-bridge/statuses/031a2e1b292ea9d56c6220e6b1d574fbdaf7dbe9"}},"author_association":"NONE"}}
{"actor":{"display_login":"jdleesmiller"}}