diff --git a/src/v3/plugins/github/__snapshots__/createGraph.test.js.snap b/src/v3/plugins/github/__snapshots__/createGraph.test.js.snap index 71e982e..032b142 100644 --- a/src/v3/plugins/github/__snapshots__/createGraph.test.js.snap +++ b/src/v3/plugins/github/__snapshots__/createGraph.test.js.snap @@ -873,6 +873,340 @@ Array [ "dstIndex": 1, "srcIndex": 23, }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "4", + "ISSUE", + "sourcecred", + "example-github", + "2", + "4", + "ISSUE", + "sourcecred", + "example-github", + "1", + ], + "dstIndex": 16, + "srcIndex": 17, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "4", + "PULL", + "sourcecred", + "example-github", + "5", + "2", + "USERLIKE", + "wchargin", + ], + "dstIndex": 29, + "srcIndex": 23, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "4", + "PULL", + "sourcecred", + "example-github", + "9", + "2", + "USERLIKE", + "wchargin", + ], + "dstIndex": 29, + "srcIndex": 24, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "373768703", + "4", + "ISSUE", + "sourcecred", + "example-github", + "6", + ], + "dstIndex": 19, + "srcIndex": 2, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "373768850", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "6", + "373768538", + ], + "dstIndex": 11, + "srcIndex": 3, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576185", + "4", + "PULL", + "sourcecred", + "example-github", + "5", + ], + "dstIndex": 23, + "srcIndex": 4, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576220", + "5", + "REVIEW", + "sourcecred", + "example-github", + "5", + "100313899", + ], + "dstIndex": 26, + "srcIndex": 5, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576248", + "7", + "COMMENT", + "REVIEW", + "sourcecred", + "example-github", + "5", + "100313899", + "171460198", + ], + "dstIndex": 15, + "srcIndex": 6, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576273", + "2", + "USERLIKE", + "wchargin", + ], + "dstIndex": 29, + "srcIndex": 7, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576920", + "4", + "ISSUE", + "sourcecred", + "example-github", + "1", + ], + "dstIndex": 16, + "srcIndex": 8, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576920", + "4", + "ISSUE", + "sourcecred", + "example-github", + "2", + ], + "dstIndex": 17, + "srcIndex": 8, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576920", + "4", + "PULL", + "sourcecred", + "example-github", + "3", + ], + "dstIndex": 22, + "srcIndex": 8, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576920", + "5", + "REVIEW", + "sourcecred", + "example-github", + "5", + "100313899", + ], + "dstIndex": 26, + "srcIndex": 8, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "2", + "385576920", + "7", + "COMMENT", + "REVIEW", + "sourcecred", + "example-github", + "5", + "100313899", + "171460198", + ], + "dstIndex": 15, + "srcIndex": 8, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "ISSUE", + "sourcecred", + "example-github", + "6", + "385223316", + "4", + "ISSUE", + "sourcecred", + "example-github", + "2", + ], + "dstIndex": 17, + "srcIndex": 12, + }, + Object { + "address": Array [ + "sourcecred", + "github", + "REFERENCES", + "6", + "COMMENT", + "PULL", + "sourcecred", + "example-github", + "3", + "369162222", + "4", + "ISSUE", + "sourcecred", + "example-github", + "2", + ], + "dstIndex": 17, + "srcIndex": 13, + }, ], "nodes": Array [ Array [ diff --git a/src/v3/plugins/github/createGraph.js b/src/v3/plugins/github/createGraph.js index a1d9fb8..3d2b74b 100644 --- a/src/v3/plugins/github/createGraph.js +++ b/src/v3/plugins/github/createGraph.js @@ -39,6 +39,14 @@ class GraphCreator { this.graph.addEdge(createEdge.mergedAs(pull.address(), commit)); } } + + for (const referrer of view.textContentEntities()) { + for (const referent of referrer.references()) { + this.graph.addEdge( + createEdge.references(referrer.address(), referent.address()) + ); + } + } } addNode(addr: N.StructuredAddress) {