{"action":"created","comment":{"url":"https://api.github.com/repos/sourcecred/sourcecred/pulls/comments/192231521","pull_request_review_id":124963637,"id":192231521,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjIzMTUyMQ==","diff_hunk":"@@ -808,6 +808,128 @@ describe(\"graph\", () => {\n       expect(g.equals(h)).toBe(false);\n     });\n   });\n+\n+  describe(\"JSON serialization\", () => {\n+    const nodes = {\n+      a: () => new BarPayload(1, \"alpha\"),\n+      b: () => new BarPayload(2, \"bravo\"),\n+      absent: () => new BarPayload(3, \"goodbye\"),\n+      isolated: () => new BarPayload(4, \"...\"),\n+      phantom: () => new BarPayload(5, \"boo!\"),\n+    };\n+    const edge = (srcPayload, dstPayload, id): Edge<string> => ({\n+      address: {owner: {plugin: EXAMPLE_PLUGIN_NAME, type: \"EDGE\"}, id},\n+      src: srcPayload.address(),\n+      dst: dstPayload.address(),\n+      payload: \"not much\",\n+    });\n+    const edges: {[string]: () => Edge<string>} = {\n+      a_b: () => edge(nodes.a(), nodes.b(), \"a_b\"),\n+      a_absent: () => edge(nodes.a(), nodes.absent(), \"a_absent\"),\n+      absent_b: () => edge(nodes.absent(), nodes.b(), \"absent_b\"),\n+      phantom: () => edge(nodes.b(), nodes.a(), \"phantom\"),\n+    };\n+    const sampleGraph = () => {\n+      return newGraph()\n+        .addNode(nodes.a())\n+        .addNode(nodes.b())\n+        .addNode(nodes.isolated())\n+        .addNode(nodes.phantom())\n+        .removeNode(nodes.phantom().address())\n+        .addEdge(edges.a_b())\n+        .addEdge(edges.a_absent())\n+        .addEdge(edges.absent_b())\n+        .addEdge(edges.phantom())\n+        .removeEdge(edges.phantom().address);\n+    };\n+\n+    it(\"serializes a sample graph\", () => {\n+      expect(sampleGraph().toJSON()).toMatchSnapshot();\n+    });\n+\n+    it(\"installs appropriate plugin handlers\", () => {\n+      const g = newGraph();\n+      const plugins = g.plugins();\n+      expect(g.plugins()).not.toHaveLength(0);","path":"src/core2/graph.test.js","position":46,"original_position":46,"commit_id":"1765275562a8e4fb1acb1274d91785a44919d26a","original_commit_id":"1765275562a8e4fb1acb1274d91785a44919d26a","user":{"login":"decentralion","id":1400023,"node_id":"MDQ6VXNlcjE0MDAwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1400023?v=4","gravatar_id":"","url":"https://api.github.com/users/decentralion","html_url":"https://github.com/decentralion","followers_url":"https://api.github.com/users/decentralion/followers","following_url":"https://api.github.com/users/decentralion/following{/other_user}","gists_url":"https://api.github.com/users/decentralion/gists{/gist_id}","starred_url":"https://api.github.com/users/decentralion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decentralion/subscriptions","organizations_url":"https://api.github.com/users/decentralion/orgs","repos_url":"https://api.github.com/users/decentralion/repos","events_url":"https://api.github.com/users/decentralion/events{/privacy}","received_events_url":"https://api.github.com/users/decentralion/received_events","type":"User","site_admin":false},"body":"nit: s/g.plugins()/plugins/g","created_at":"2018-05-31T20:44:48Z","updated_at":"2018-05-31T20:47:50Z","html_url":"https://github.com/sourcecred/sourcecred/pull/323#discussion_r192231521","pull_request_url":"https://api.github.com/repos/sourcecred/sourcecred/pulls/323","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/sourcecred/sourcecred/pulls/comments/192231521"},"html":{"href":"https://github.com/sourcecred/sourcecred/pull/323#discussion_r192231521"},"pull_request":{"href":"https://api.github.com/repos/sourcecred/sourcecred/pulls/323"}}},"pull_request":{"url":"https://api.github.com/repos/sourcecred/sourcecred/pulls/323","id":191862999,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxODYyOTk5","html_url":"https://github.com/sourcecred/sourcecred/pull/323","diff_url":"https://github.com/sourcecred/sourcecred/pull/323.diff","patch_url":"https://github.com/sourcecred/sourcecred/pull/323.patch","issue_url":"https://api.github.com/repos/sourcecred/sourcecred/issues/323","number":323,"state":"open","locked":false,"title":"Implement `toJSON` and `fromJSON` for GraphV2","user":{"login":"wchargin","id":4317806,"node_id":"MDQ6VXNlcjQzMTc4MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/4317806?v=4","gravatar_id":"","url":"https://api.github.com/users/wchargin","html_url":"https://github.com/wchargin","followers_url":"https://api.github.com/users/wchargin/followers","following_url":"https://api.github.com/users/wchargin/following{/other_user}","gists_url":"https://api.github.com/users/wchargin/gists{/gist_id}","starred_url":"https://api.github.com/users/wchargin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wchargin/subscriptions","organizations_url":"https://api.github.com/users/wchargin/orgs","repos_url":"https://api.github.com/users/wchargin/repos","events_url":"https://api.github.com/users/wchargin/events{/privacy}","received_events_url":"https://api.github.com/users/wchargin/received_events","type":"User","site_admin":false},"body":"Summary:\r\nThe storage format is similar to the V1 storage format. Nodes are sorted\r\nby address and stored in an ordered list. Edges have `srcIndex` and\r\n`dstIndex`, keyed against the node order. Each node stores the name of\r\nits plugin and the result of invoking `toJSON` on its payload.\r\n\r\nTest Plan:\r\nUnit tests added; run `yarn travis`. The single added snapshot is easy\r\nto read and verify.\r\n\r\nwchargin-branch: v2-json","created_at":"2018-05-31T20:20:20Z","updated_at":"2018-05-31T20:47:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9d3a8a60ee78cb87d61596700adc12e7e49f51f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sourcecred/sourcecred/pulls/323/commits","review_comments_url":"https://api.github.com/repos/sourcecred/sourcecred/pulls/323/comments","review_comment_url":"https://api.github.com/repos/sourcecred/sourcecred/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sourcecred/sourcecred/issues/323/comments","statuses_url":"https://api.github.com/repos/sourcecred/sourcecred/statuses/1765275562a8e4fb1acb1274d91785a44919d26a","head":{"label":"sourcecred:wchargin-v2-json","ref":"wchargin-v2-json","sha":"1765275562a8e4fb1acb1274d91785a44919d26a","user":{"login":"sourcecred","id":35711667,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NzExNjY3","avatar_url":"https://avatars1.githubusercontent.com/u/35711667?v=4","gravatar_id":"","url":"https://api.github.com/users/sourcecred","html_url":"https://github.com/sourcecred","followers_url":"https://api.github.com/users/sourcecred/followers","following_url":"https://api.github.com/users/sourcecred/following{/other_user}","gists_url":"https://api.github.com/users/sourcecred/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcecred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcecred/subscriptions","organizations_url":"https://api.github.com/users/sourcecred/orgs","repos_url":"https://api.github.com/users/sourcecred/repos","events_url":"https://api.github.com/users/sourcecred/events{/privacy}","received_events_url":"https://api.github.com/users/sourcecred/received_events","type":"Organization","site_admin":false},"repo":{"id":120145570,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAxNDU1NzA=","name":"sourcecred","full_name":"sourcecred/sourcecred","owner":{"login":"sourcecred","id":35711667,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NzExNjY3","avatar_url":"https://avatars1.githubusercontent.com/u/35711667?v=4","gravatar_id":"","url":"https://api.github.com/users/sourcecred","html_url":"https://github.com/sourcecred","followers_url":"https://api.github.com/users/sourcecred/followers","following_url":"https://api.github.com/users/sourcecred/following{/other_user}","gists_url":"https://api.github.com/users/sourcecred/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcecred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcecred/subscriptions","organizations_url":"https://api.github.com/users/sourcecred/orgs","repos_url":"https://api.github.com/users/sourcecred/repos","events_url":"https://api.github.com/users/sourcecred/events{/privacy}","received_events_url":"https://api.github.com/users/sourcecred/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sourcecred/sourcecred","description":"shine a light on open-source contributors","fork":false,"url":"https://api.github.com/repos/sourcecred/sourcecred","forks_url":"https://api.github.com/repos/sourcecred/sourcecred/forks","keys_url":"https://api.github.com/repos/sourcecred/sourcecred/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcecred/sourcecred/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcecred/sourcecred/teams","hooks_url":"https://api.github.com/repos/sourcecred/sourcecred/hooks","issue_events_url":"https://api.github.com/repos/sourcecred/sourcecred/issues/events{/number}","events_url":"https://api.github.com/repos/sourcecred/sourcecred/events","assignees_url":"https://api.github.com/repos/sourcecred/sourcecred/assignees{/user}","branches_url":"https://api.github.com/repos/sourcecred/sourcecred/branches{/branch}","tags_url":"https://api.github.com/repos/sourcecred/sourcecred/tags","blobs_url":"https://api.github.com/repos/sourcecred/sourcecred/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcecred/sourcecred/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcecred/sourcecred/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcecred/sourcecred/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcecred/sourcecred/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcecred/sourcecred/languages","stargazers_url":"https://api.github.com/repos/sourcecred/sourcecred/stargazers","contributors_url":"https://api.github.com/repos/sourcecred/sourcecred/contributors","subscribers_url":"https://api.github.com/repos/sourcecred/sourcecred/subscribers","subscription_url":"https://api.github.com/repos/sourcecred/sourcecred/subscription","commits_url":"https://api.github.com/repos/sourcecred/sourcecred/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcecred/sourcecred/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcecred/sourcecred/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcecred/sourcecred/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcecred/sourcecred/contents/{+path}","compare_url":"https://api.github.com/repos/sourcecred/sourcecred/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcecred/sourcecred/merges","archive_url":"https://api.github.com/repos/sourcecred/sourcecred/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcecred/sourcecred/downloads","issues_url":"https://api.github.com/repos/sourcecred/sourcecred/issues{/number}","pulls_url":"https://api.github.com/repos/sourcecred/sourcecred/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcecred/sourcecred/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcecred/sourcecred/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcecred/sourcecred/labels{/name}","releases_url":"https://api.github.com/repos/sourcecred/sourcecred/releases{/id}","deployments_url":"https://api.github.com/repos/sourcecred/sourcecred/deployments","created_at":"2018-02-04T01:32:53Z","updated_at":"2018-05-31T20:22:39Z","pushed_at":"2018-05-31T20:41:02Z","git_url":"git://github.com/sourcecred/sourcecred.git","ssh_url":"git@github.com:sourcecred/sourcecred.git","clone_url":"https://github.com/sourcecred/sourcecred.git","svn_url":"https://github.com/sourcecred/sourcecred","homepage":"","size":1084,"stargazers_count":40,"watchers_count":40,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":19,"watchers":40,"default_branch":"master"}},"base":{"label":"sourcecred:master","ref":"master","sha":"6e442c2f0c62fffd6f82cb7758e4880c7cf0734c","user":{"login":"sourcecred","id":35711667,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NzExNjY3","avatar_url":"https://avatars1.githubusercontent.com/u/35711667?v=4","gravatar_id":"","url":"https://api.github.com/users/sourcecred","html_url":"https://github.com/sourcecred","followers_url":"https://api.github.com/users/sourcecred/followers","following_url":"https://api.github.com/users/sourcecred/following{/other_user}","gists_url":"https://api.github.com/users/sourcecred/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcecred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcecred/subscriptions","organizations_url":"https://api.github.com/users/sourcecred/orgs","repos_url":"https://api.github.com/users/sourcecred/repos","events_url":"https://api.github.com/users/sourcecred/events{/privacy}","received_events_url":"https://api.github.com/users/sourcecred/received_events","type":"Organization","site_admin":false},"repo":{"id":120145570,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAxNDU1NzA=","name":"sourcecred","full_name":"sourcecred/sourcecred","owner":{"login":"sourcecred","id":35711667,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NzExNjY3","avatar_url":"https://avatars1.githubusercontent.com/u/35711667?v=4","gravatar_id":"","url":"https://api.github.com/users/sourcecred","html_url":"https://github.com/sourcecred","followers_url":"https://api.github.com/users/sourcecred/followers","following_url":"https://api.github.com/users/sourcecred/following{/other_user}","gists_url":"https://api.github.com/users/sourcecred/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcecred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcecred/subscriptions","organizations_url":"https://api.github.com/users/sourcecred/orgs","repos_url":"https://api.github.com/users/sourcecred/repos","events_url":"https://api.github.com/users/sourcecred/events{/privacy}","received_events_url":"https://api.github.com/users/sourcecred/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sourcecred/sourcecred","description":"shine a light on open-source contributors","fork":false,"url":"https://api.github.com/repos/sourcecred/sourcecred","forks_url":"https://api.github.com/repos/sourcecred/sourcecred/forks","keys_url":"https://api.github.com/repos/sourcecred/sourcecred/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcecred/sourcecred/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcecred/sourcecred/teams","hooks_url":"https://api.github.com/repos/sourcecred/sourcecred/hooks","issue_events_url":"https://api.github.com/repos/sourcecred/sourcecred/issues/events{/number}","events_url":"https://api.github.com/repos/sourcecred/sourcecred/events","assignees_url":"https://api.github.com/repos/sourcecred/sourcecred/assignees{/user}","branches_url":"https://api.github.com/repos/sourcecred/sourcecred/branches{/branch}","tags_url":"https://api.github.com/repos/sourcecred/sourcecred/tags","blobs_url":"https://api.github.com/repos/sourcecred/sourcecred/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcecred/sourcecred/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcecred/sourcecred/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcecred/sourcecred/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcecred/sourcecred/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcecred/sourcecred/languages","stargazers_url":"https://api.github.com/repos/sourcecred/sourcecred/stargazers","contributors_url":"https://api.github.com/repos/sourcecred/sourcecred/contributors","subscribers_url":"https://api.github.com/repos/sourcecred/sourcecred/subscribers","subscription_url":"https://api.github.com/repos/sourcecred/sourcecred/subscription","commits_url":"https://api.github.com/repos/sourcecred/sourcecred/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcecred/sourcecred/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcecred/sourcecred/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcecred/sourcecred/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcecred/sourcecred/contents/{+path}","compare_url":"https://api.github.com/repos/sourcecred/sourcecred/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcecred/sourcecred/merges","archive_url":"https://api.github.com/repos/sourcecred/sourcecred/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcecred/sourcecred/downloads","issues_url":"https://api.github.com/repos/sourcecred/sourcecred/issues{/number}","pulls_url":"https://api.github.com/repos/sourcecred/sourcecred/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcecred/sourcecred/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcecred/sourcecred/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcecred/sourcecred/labels{/name}","releases_url":"https://api.github.com/repos/sourcecred/sourcecred/releases{/id}","deployments_url":"https://api.github.com/repos/sourcecred/sourcecred/deployments","created_at":"2018-02-04T01:32:53Z","updated_at":"2018-05-31T20:22:39Z","pushed_at":"2018-05-31T20:41:02Z","git_url":"git://github.com/sourcecred/sourcecred.git","ssh_url":"git@github.com:sourcecred/sourcecred.git","clone_url":"https://github.com/sourcecred/sourcecred.git","svn_url":"https://github.com/sourcecred/sourcecred","homepage":"","size":1084,"stargazers_count":40,"watchers_count":40,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":19,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sourcecred/sourcecred/pulls/323"},"html":{"href":"https://github.com/sourcecred/sourcecred/pull/323"},"issue":{"href":"https://api.github.com/repos/sourcecred/sourcecred/issues/323"},"comments":{"href":"https://api.github.com/repos/sourcecred/sourcecred/issues/323/comments"},"review_comments":{"href":"https://api.github.com/repos/sourcecred/sourcecred/pulls/323/comments"},"review_comment":{"href":"https://api.github.com/repos/sourcecred/sourcecred/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sourcecred/sourcecred/pulls/323/commits"},"statuses":{"href":"https://api.github.com/repos/sourcecred/sourcecred/statuses/1765275562a8e4fb1acb1274d91785a44919d26a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"decentralion"}}