From 2001d3a6992ad0ed9da5b92703b8ec02ccdf1149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dandelion=20Man=C3=A9?= Date: Wed, 29 Aug 2018 14:24:00 -0700 Subject: [PATCH] Update GitHub example data (#716) I've added [a post by a bot]. Change generated by running: ```sh src/plugins/github/fetchGithubRepoTest.sh -u ``` Test plan: `yarn travis --full` passes. Note that I properly re-archived the GitHub repository. Closes #714. [a post by a bot]: https://github.com/sourcecred/example-github/issues/6#issuecomment-417104047 --- .../__snapshots__/createGraph.test.js.snap | 271 +++++++++++------- .../__snapshots__/relationalView.test.js.snap | 6 +- .../github/example/example-github.json | 13 +- 3 files changed, 178 insertions(+), 112 deletions(-) diff --git a/src/plugins/github/__snapshots__/createGraph.test.js.snap b/src/plugins/github/__snapshots__/createGraph.test.js.snap index 9bb9107..0fd248b 100644 --- a/src/plugins/github/__snapshots__/createGraph.test.js.snap +++ b/src/plugins/github/__snapshots__/createGraph.test.js.snap @@ -8,6 +8,26 @@ Array [ }, Object { "edges": Array [ + Object { + "address": Array [ + "sourcecred", + "github", + "AUTHORS", + "3", + "USERLIKE", + "USER", + "credbot", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "6", + "417104047", + ], + "dstIndex": 13, + "srcIndex": 30, + }, Object { "address": Array [ "sourcecred", @@ -23,8 +43,8 @@ Array [ "example-github", "1", ], - "dstIndex": 16, - "srcIndex": 29, + "dstIndex": 17, + "srcIndex": 31, }, Object { "address": Array [ @@ -41,8 +61,8 @@ Array [ "example-github", "10", ], - "dstIndex": 17, - "srcIndex": 29, + "dstIndex": 18, + "srcIndex": 31, }, Object { "address": Array [ @@ -59,8 +79,8 @@ Array [ "example-github", "2", ], - "dstIndex": 18, - "srcIndex": 29, + "dstIndex": 19, + "srcIndex": 31, }, Object { "address": Array [ @@ -77,8 +97,8 @@ Array [ "example-github", "4", ], - "dstIndex": 19, - "srcIndex": 29, + "dstIndex": 20, + "srcIndex": 31, }, Object { "address": Array [ @@ -95,8 +115,8 @@ Array [ "example-github", "6", ], - "dstIndex": 20, - "srcIndex": 29, + "dstIndex": 21, + "srcIndex": 31, }, Object { "address": Array [ @@ -113,8 +133,8 @@ Array [ "example-github", "7", ], - "dstIndex": 21, - "srcIndex": 29, + "dstIndex": 22, + "srcIndex": 31, }, Object { "address": Array [ @@ -131,8 +151,8 @@ Array [ "example-github", "8", ], - "dstIndex": 22, - "srcIndex": 29, + "dstIndex": 23, + "srcIndex": 31, }, Object { "address": Array [ @@ -149,8 +169,8 @@ Array [ "example-github", "3", ], - "dstIndex": 23, - "srcIndex": 29, + "dstIndex": 24, + "srcIndex": 31, }, Object { "address": Array [ @@ -167,8 +187,8 @@ Array [ "example-github", "5", ], - "dstIndex": 24, - "srcIndex": 29, + "dstIndex": 25, + "srcIndex": 31, }, Object { "address": Array [ @@ -185,8 +205,8 @@ Array [ "example-github", "9", ], - "dstIndex": 25, - "srcIndex": 29, + "dstIndex": 26, + "srcIndex": 31, }, Object { "address": Array [ @@ -206,7 +226,7 @@ Array [ "373768703", ], "dstIndex": 2, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -226,7 +246,7 @@ Array [ "373768850", ], "dstIndex": 3, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -246,7 +266,7 @@ Array [ "385576185", ], "dstIndex": 4, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -266,7 +286,7 @@ Array [ "385576220", ], "dstIndex": 5, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -286,7 +306,7 @@ Array [ "385576248", ], "dstIndex": 6, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -306,7 +326,7 @@ Array [ "385576273", ], "dstIndex": 7, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -326,7 +346,7 @@ Array [ "385576920", ], "dstIndex": 8, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -346,7 +366,7 @@ Array [ "385576936", ], "dstIndex": 9, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -366,7 +386,7 @@ Array [ "373768442", ], "dstIndex": 10, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -386,7 +406,7 @@ Array [ "373768538", ], "dstIndex": 11, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -406,7 +426,7 @@ Array [ "385223316", ], "dstIndex": 12, - "srcIndex": 29, + "srcIndex": 31, }, Object { "address": Array [ @@ -425,8 +445,8 @@ Array [ "3", "369162222", ], - "dstIndex": 13, - "srcIndex": 29, + "dstIndex": 14, + "srcIndex": 31, }, Object { "address": Array [ @@ -443,8 +463,8 @@ Array [ "example-github", "10", ], - "dstIndex": 17, - "srcIndex": 30, + "dstIndex": 18, + "srcIndex": 32, }, Object { "address": Array [ @@ -461,8 +481,8 @@ Array [ "example-github", "9", ], - "dstIndex": 25, - "srcIndex": 30, + "dstIndex": 26, + "srcIndex": 32, }, Object { "address": Array [ @@ -480,8 +500,8 @@ Array [ "5", "100313899", ], - "dstIndex": 27, - "srcIndex": 30, + "dstIndex": 28, + "srcIndex": 32, }, Object { "address": Array [ @@ -499,8 +519,8 @@ Array [ "5", "100314038", ], - "dstIndex": 28, - "srcIndex": 30, + "dstIndex": 29, + "srcIndex": 32, }, Object { "address": Array [ @@ -519,8 +539,8 @@ Array [ "5", "396430464", ], - "dstIndex": 14, - "srcIndex": 30, + "dstIndex": 15, + "srcIndex": 32, }, Object { "address": Array [ @@ -540,8 +560,8 @@ Array [ "100313899", "171460198", ], - "dstIndex": 15, - "srcIndex": 30, + "dstIndex": 16, + "srcIndex": 32, }, Object { "address": Array [ @@ -554,8 +574,8 @@ Array [ "example-github", "1", ], - "dstIndex": 26, - "srcIndex": 16, + "dstIndex": 27, + "srcIndex": 17, }, Object { "address": Array [ @@ -568,8 +588,8 @@ Array [ "example-github", "10", ], - "dstIndex": 26, - "srcIndex": 17, + "dstIndex": 27, + "srcIndex": 18, }, Object { "address": Array [ @@ -582,8 +602,8 @@ Array [ "example-github", "2", ], - "dstIndex": 26, - "srcIndex": 18, + "dstIndex": 27, + "srcIndex": 19, }, Object { "address": Array [ @@ -596,8 +616,8 @@ Array [ "example-github", "4", ], - "dstIndex": 26, - "srcIndex": 19, + "dstIndex": 27, + "srcIndex": 20, }, Object { "address": Array [ @@ -610,8 +630,8 @@ Array [ "example-github", "6", ], - "dstIndex": 26, - "srcIndex": 20, + "dstIndex": 27, + "srcIndex": 21, }, Object { "address": Array [ @@ -624,8 +644,8 @@ Array [ "example-github", "7", ], - "dstIndex": 26, - "srcIndex": 21, + "dstIndex": 27, + "srcIndex": 22, }, Object { "address": Array [ @@ -638,8 +658,8 @@ Array [ "example-github", "8", ], - "dstIndex": 26, - "srcIndex": 22, + "dstIndex": 27, + "srcIndex": 23, }, Object { "address": Array [ @@ -652,8 +672,8 @@ Array [ "example-github", "3", ], - "dstIndex": 26, - "srcIndex": 23, + "dstIndex": 27, + "srcIndex": 24, }, Object { "address": Array [ @@ -666,8 +686,8 @@ Array [ "example-github", "5", ], - "dstIndex": 26, - "srcIndex": 24, + "dstIndex": 27, + "srcIndex": 25, }, Object { "address": Array [ @@ -680,8 +700,8 @@ Array [ "example-github", "9", ], - "dstIndex": 26, - "srcIndex": 25, + "dstIndex": 27, + "srcIndex": 26, }, Object { "address": Array [ @@ -695,8 +715,8 @@ Array [ "5", "100313899", ], - "dstIndex": 24, - "srcIndex": 27, + "dstIndex": 25, + "srcIndex": 28, }, Object { "address": Array [ @@ -710,8 +730,8 @@ Array [ "5", "100314038", ], - "dstIndex": 24, - "srcIndex": 28, + "dstIndex": 25, + "srcIndex": 29, }, Object { "address": Array [ @@ -726,7 +746,7 @@ Array [ "2", "373768703", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 2, }, Object { @@ -742,7 +762,7 @@ Array [ "2", "373768850", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 3, }, Object { @@ -758,7 +778,7 @@ Array [ "2", "385576185", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 4, }, Object { @@ -774,7 +794,7 @@ Array [ "2", "385576220", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 5, }, Object { @@ -790,7 +810,7 @@ Array [ "2", "385576248", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 6, }, Object { @@ -806,7 +826,7 @@ Array [ "2", "385576273", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 7, }, Object { @@ -822,7 +842,7 @@ Array [ "2", "385576920", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 8, }, Object { @@ -838,7 +858,7 @@ Array [ "2", "385576936", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 9, }, Object { @@ -854,7 +874,7 @@ Array [ "6", "373768442", ], - "dstIndex": 20, + "dstIndex": 21, "srcIndex": 10, }, Object { @@ -870,7 +890,7 @@ Array [ "6", "373768538", ], - "dstIndex": 20, + "dstIndex": 21, "srcIndex": 11, }, Object { @@ -886,9 +906,25 @@ Array [ "6", "385223316", ], - "dstIndex": 20, + "dstIndex": 21, "srcIndex": 12, }, + Object { + "address": Array [ + "sourcecred", + "github", + "HAS_PARENT", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "6", + "417104047", + ], + "dstIndex": 21, + "srcIndex": 13, + }, Object { "address": Array [ "sourcecred", @@ -902,8 +938,8 @@ Array [ "3", "369162222", ], - "dstIndex": 23, - "srcIndex": 13, + "dstIndex": 24, + "srcIndex": 14, }, Object { "address": Array [ @@ -918,8 +954,8 @@ Array [ "5", "396430464", ], - "dstIndex": 24, - "srcIndex": 14, + "dstIndex": 25, + "srcIndex": 15, }, Object { "address": Array [ @@ -935,8 +971,8 @@ Array [ "100313899", "171460198", ], - "dstIndex": 27, - "srcIndex": 15, + "dstIndex": 28, + "srcIndex": 16, }, Object { "address": Array [ @@ -950,7 +986,7 @@ Array [ "3", ], "dstIndex": 0, - "srcIndex": 23, + "srcIndex": 24, }, Object { "address": Array [ @@ -964,7 +1000,7 @@ Array [ "5", ], "dstIndex": 1, - "srcIndex": 24, + "srcIndex": 25, }, Object { "address": Array [ @@ -982,8 +1018,8 @@ Array [ "example-github", "10", ], - "dstIndex": 17, - "srcIndex": 17, + "dstIndex": 18, + "srcIndex": 18, }, Object { "address": Array [ @@ -1001,8 +1037,8 @@ Array [ "example-github", "2", ], - "dstIndex": 18, - "srcIndex": 17, + "dstIndex": 19, + "srcIndex": 18, }, Object { "address": Array [ @@ -1020,8 +1056,8 @@ Array [ "example-github", "1", ], - "dstIndex": 16, - "srcIndex": 18, + "dstIndex": 17, + "srcIndex": 19, }, Object { "address": Array [ @@ -1038,8 +1074,8 @@ Array [ "USER", "wchargin", ], - "dstIndex": 30, - "srcIndex": 24, + "dstIndex": 32, + "srcIndex": 25, }, Object { "address": Array [ @@ -1059,7 +1095,7 @@ Array [ "example-github", "6", ], - "dstIndex": 20, + "dstIndex": 21, "srcIndex": 2, }, Object { @@ -1103,7 +1139,7 @@ Array [ "example-github", "5", ], - "dstIndex": 24, + "dstIndex": 25, "srcIndex": 4, }, Object { @@ -1125,7 +1161,7 @@ Array [ "5", "100313899", ], - "dstIndex": 27, + "dstIndex": 28, "srcIndex": 5, }, Object { @@ -1149,7 +1185,7 @@ Array [ "100313899", "171460198", ], - "dstIndex": 15, + "dstIndex": 16, "srcIndex": 6, }, Object { @@ -1169,7 +1205,7 @@ Array [ "USER", "wchargin", ], - "dstIndex": 30, + "dstIndex": 32, "srcIndex": 7, }, Object { @@ -1190,7 +1226,7 @@ Array [ "example-github", "1", ], - "dstIndex": 16, + "dstIndex": 17, "srcIndex": 8, }, Object { @@ -1211,7 +1247,7 @@ Array [ "example-github", "2", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 8, }, Object { @@ -1232,7 +1268,7 @@ Array [ "example-github", "3", ], - "dstIndex": 23, + "dstIndex": 24, "srcIndex": 8, }, Object { @@ -1254,7 +1290,7 @@ Array [ "5", "100313899", ], - "dstIndex": 27, + "dstIndex": 28, "srcIndex": 8, }, Object { @@ -1278,7 +1314,7 @@ Array [ "100313899", "171460198", ], - "dstIndex": 15, + "dstIndex": 16, "srcIndex": 8, }, Object { @@ -1299,7 +1335,7 @@ Array [ "example-github", "2", ], - "dstIndex": 18, + "dstIndex": 19, "srcIndex": 12, }, Object { @@ -1320,8 +1356,8 @@ Array [ "example-github", "2", ], - "dstIndex": 18, - "srcIndex": 13, + "dstIndex": 19, + "srcIndex": 14, }, ], "nodes": Array [ @@ -1447,6 +1483,16 @@ Array [ "6", "385223316", ], + Array [ + "sourcecred", + "github", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "6", + "417104047", + ], Array [ "sourcecred", "github", @@ -1583,6 +1629,13 @@ Array [ "5", "100314038", ], + Array [ + "sourcecred", + "github", + "USERLIKE", + "USER", + "credbot", + ], Array [ "sourcecred", "github", diff --git a/src/plugins/github/__snapshots__/relationalView.test.js.snap b/src/plugins/github/__snapshots__/relationalView.test.js.snap index 719f789..154b3b8 100644 --- a/src/plugins/github/__snapshots__/relationalView.test.js.snap +++ b/src/plugins/github/__snapshots__/relationalView.test.js.snap @@ -111,7 +111,7 @@ Array [ ] `; -exports[`plugins/github/relationalView RelationalView entity: comments has expected number of them 1`] = `14`; +exports[`plugins/github/relationalView RelationalView entity: comments has expected number of them 1`] = `15`; exports[`plugins/github/relationalView RelationalView entity: comments they have expected urls 1`] = ` Array [ @@ -126,6 +126,7 @@ Array [ "https://github.com/sourcecred/example-github/issues/6#issuecomment-373768442", "https://github.com/sourcecred/example-github/issues/6#issuecomment-373768538", "https://github.com/sourcecred/example-github/issues/6#issuecomment-385223316", + "https://github.com/sourcecred/example-github/issues/6#issuecomment-417104047", "https://github.com/sourcecred/example-github/pull/3#issuecomment-369162222", "https://github.com/sourcecred/example-github/pull/5#issuecomment-396430464", "https://github.com/sourcecred/example-github/pull/5#discussion_r171460198", @@ -173,11 +174,12 @@ Array [ ] `; -exports[`plugins/github/relationalView RelationalView entity: userlikes has expected number of them 1`] = `2`; +exports[`plugins/github/relationalView RelationalView entity: userlikes has expected number of them 1`] = `3`; exports[`plugins/github/relationalView RelationalView entity: userlikes they have expected urls 1`] = ` Array [ "https://github.com/decentralion", + "https://github.com/credbot", "https://github.com/wchargin", ] `; diff --git a/src/plugins/github/example/example-github.json b/src/plugins/github/example/example-github.json index c701b4d..bd3136d 100644 --- a/src/plugins/github/example/example-github.json +++ b/src/plugins/github/example/example-github.json @@ -196,10 +196,21 @@ "body": "This comment references an #2, which itself references an issue. This comment is thus allows us to test that in-references are not included when requesting a Post's references.", "id": "MDEyOklzc3VlQ29tbWVudDM4NTIyMzMxNg==", "url": "https://github.com/sourcecred/example-github/issues/6#issuecomment-385223316" + }, + { + "author": { + "__typename": "User", + "id": "MDQ6VXNlcjQyODE5Mzgy", + "login": "credbot", + "url": "https://github.com/credbot" + }, + "body": "Hi! I'm a bot! Beep boop beep!!", + "id": "MDEyOklzc3VlQ29tbWVudDQxNzEwNDA0Nw==", + "url": "https://github.com/sourcecred/example-github/issues/6#issuecomment-417104047" } ], "pageInfo": { - "endCursor": "Y3Vyc29yOnYyOpHOFvYKlA==", + "endCursor": "Y3Vyc29yOnYyOpHOGNyArw==", "hasNextPage": false } },