sourcecred/src
Dandelion Mané 02a8e02922 graph: add support for dangling edges
This commit modifies the Graph class so that it permits dangling edges;
that is to say, edges whose src or dst are not present in the graph.
Dangling edges may be directly added to the graph, or existing edges may
become dangling if their src or dst is removed.

This change is prerequisite to #1136; if we require that nodes have
metadata, we should also make it possible to add edges to nodes that
don't yet exist, as the plugin creating an edge may not have access to
the full metadata needed to add the node.

To support this change, there is now an `isDanglingEdge` method on the
graph, which reports whether or not the edge is dangling. Also,
`Graph.edges` requires that the client make an explicit choice on
whether dangling edges are desired. This ensures that we do not
accidentally include dangling edges in a case where they are
inappropriate (e.g. creating a Markov chain) or accidentally discard
dangling edges when they are needed (e.g. when merging or serializing).

The Graph's invariant checker has been updated to reflect the new
semantics.

The Graph compat version has been bumped, since this is a break in
backwards compatibility.

Note that this commit does not change the behavior of any plugins; that
is to say, no plugins create dangling edges (yet).

Test plan: The advanced graph test case has been updated to include
dangling edges. The tests for Graph, PagerankGraph, and
GraphToMarkovChain have been updated. `yarn test --full` passes.
2019-07-03 15:19:11 +03:00
..
analysis Factor out distribution modules (#1182) 2019-06-13 23:24:37 +03:00
assets/logo Add logo variants for CredBot and Discourse (#717) 2018-08-29 15:15:10 -07:00
cli remove `sourcecred export-graph` 2019-06-13 22:40:07 +03:00
core graph: add support for dangling edges 2019-07-03 15:19:11 +03:00
explorer Graph: reify Object nodes (#1188) 2019-06-14 03:22:31 +03:00
graphql Update reaction types (#1068) 2019-01-24 06:24:22 -05:00
homepage Temporarily remove the odyssey plugin (#1178) 2019-06-13 17:07:05 +03:00
plugins graph: add support for dangling edges 2019-07-03 15:19:11 +03:00
tools Make `yarn test` more quiet (#1037) 2019-01-05 18:16:29 -08:00
util Add a WeightsFileManager (#1150) 2019-05-21 04:41:00 +03:00
webutil link: verify that routes have trailing slash (#1001) 2018-11-08 20:53:30 -08:00