{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/7944","repository_url":"https://api.github.com/repos/openshift/origin","labels_url":"https://api.github.com/repos/openshift/origin/issues/7944/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/7944/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/7944/events","html_url":"https://github.com/openshift/origin/issues/7944","id":140194589,"number":7944,"title":"Fix EdgeFunc Implementation for Graph","user":{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars1.githubusercontent.com/u/7328370?v=4","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false},"labels":[{"id":219524465,"url":"https://api.github.com/repos/openshift/origin/labels/area/techdebt","name":"area/techdebt","color":"006b75","default":false},{"id":210152331,"url":"https://api.github.com/repos/openshift/origin/labels/priority/P3","name":"priority/P3","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars1.githubusercontent.com/u/7328370?v=4","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false},"assignees":[{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars1.githubusercontent.com/u/7328370?v=4","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-03-11T14:18:36Z","updated_at":"2018-02-05T15:55:06Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently we have this definition:\n\n``` go\n// EdgeFunc is passed a new graph, an edge in the current graph, and should mutate\n// the new graph as needed. If true is returned, the existing edge will be added to the graph.\ntype EdgeFunc func(g Interface, from, to graph.Node, edgeKinds sets.String) bool {}\n```\n\nIn the context of using an `EdgeFunc` as we use a `NodeFunc`, _i.e._ using the boolean return value for filtering, we should strictly disallow graph mutation. The following methods would _surprise_ me if the `EdgeFunc` were mutating:\n\n``` go\n// EdgeSubgraph returns the directed subgraph with only the edges that match the\n// provided function.\nfunc (g Graph) EdgeSubgraph(edgeFn EdgeFunc) Graph {}\n\n// Subgraph returns the directed subgraph with only the nodes and edges that match the\n// provided functions.\nfunc (g Graph) Subgraph(nodeFn NodeFunc, edgeFn EdgeFunc) {}\n\n// SubgraphWithNodes returns the directed subgraph with only the listed nodes and edges that\n// match the provided function.\nfunc (g Graph) SubgraphWithNodes(nodes []graph.Node, fn EdgeFunc) {}\n\n// ConnectedEdgeSubgraph creates a new graph that iterates through all edges in the graph\n// and includes all edges the provided function returns true for. Nodes not referenced by\n// an edge will be dropped unless the function adds them explicitly.\nfunc (g Graph) ConnectedEdgeSubgraph(fn EdgeFunc) {}\n```\n\nAll of these furthermore call the `EdgeFunc` by taking an existing edge and passing through `edge.From()` and `edge.To()`, so ti seems like the method signature for an `EdgeFunc` should be:\n\n``` go\n// EdgeFunc is passed a new graph, an edge in the current graph and returns true if the given edge matches some criteria.\ntype EdgeFunc func(g Interface, edge graph.Edge, edgeKinds sets.String) bool {}\n```\n\nThe methods that expect mutation should take an entirely different function (`EdgeMutatorFunc` or similar) and the two should be distinct. We can also implement a `ReadOnly` graph interface if we feel like disallowing mutation is necessary on that level.\n\n/cc @deads2k\n"},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/363127430","html_url":"https://github.com/openshift/origin/issues/7944#issuecomment-363127430","issue_url":"https://api.github.com/repos/openshift/origin/issues/7944","id":363127430,"user":{"login":"openshift-bot","id":1779249,"avatar_url":"https://avatars2.githubusercontent.com/u/1779249?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift-bot","html_url":"https://github.com/openshift-bot","followers_url":"https://api.github.com/users/openshift-bot/followers","following_url":"https://api.github.com/users/openshift-bot/following{/other_user}","gists_url":"https://api.github.com/users/openshift-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift-bot/subscriptions","organizations_url":"https://api.github.com/users/openshift-bot/orgs","repos_url":"https://api.github.com/users/openshift-bot/repos","events_url":"https://api.github.com/users/openshift-bot/events{/privacy}","received_events_url":"https://api.github.com/users/openshift-bot/received_events","type":"User","site_admin":false},"created_at":"2018-02-05T15:55:06Z","updated_at":"2018-02-05T15:55:06Z","author_association":"MEMBER","body":"Issues go stale after 90d of inactivity.\nMark the issue as fresh with `/remove-lifecycle stale`.\nStale issues rot after an additional 30d of inactivity and eventually close.\nIf this issue is safe to close now please do so with `/close`.\n\n/lifecycle stale"}}
{"actor":{"display_login":"openshift-bot"}}