{"action":"created","issue":{"url":"https://api.github.com/repos/guardian/riff-raff/issues/353","repository_url":"https://api.github.com/repos/guardian/riff-raff","labels_url":"https://api.github.com/repos/guardian/riff-raff/issues/353/labels{/name}","comments_url":"https://api.github.com/repos/guardian/riff-raff/issues/353/comments","events_url":"https://api.github.com/repos/guardian/riff-raff/issues/353/events","html_url":"https://github.com/guardian/riff-raff/pull/353","id":178892833,"number":353,"title":"Build a deployment graph from a list of deployments","user":{"login":"sihil","id":1236466,"avatar_url":"https://avatars.githubusercontent.com/u/1236466?v=3","gravatar_id":"","url":"https://api.github.com/users/sihil","html_url":"https://github.com/sihil","followers_url":"https://api.github.com/users/sihil/followers","following_url":"https://api.github.com/users/sihil/following{/other_user}","gists_url":"https://api.github.com/users/sihil/gists{/gist_id}","starred_url":"https://api.github.com/users/sihil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sihil/subscriptions","organizations_url":"https://api.github.com/users/sihil/orgs","repos_url":"https://api.github.com/users/sihil/repos","events_url":"https://api.github.com/users/sihil/events{/privacy}","received_events_url":"https://api.github.com/users/sihil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-23T14:31:33Z","updated_at":"2016-09-29T16:59:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/guardian/riff-raff/pulls/353","html_url":"https://github.com/guardian/riff-raff/pull/353","diff_url":"https://github.com/guardian/riff-raff/pull/353.diff","patch_url":"https://github.com/guardian/riff-raff/pull/353.patch"},"body":"From a list of deployments with dependencies we should build a graph of deployments. This is achieved using a graph builder that creates all of the necessary edges to fulfil the deployments. We create three sets of edges:\r\n - from the `StartNode` to all nodes that have no listed dependencies (i.e. nothing goes before them)\r\n - from a dependency node to a dependent node (i.e. each edge that is expressed by an entry in a deployment's dependencies list)\r\n - from any node on which no nodes depend to the `EndNode`\r\n\r\nThese three sets joined together creates a complete graph for the Deployments.\r\n\r\nIt was realised that building a graph at this stage only makes sense if we can make later transformations easy. As such this PR also implements a `flatMap` on `Graph` that allows individual nodes to be replaced with multiple nodes. This makes sense for splitting out actions for example or even stacks and regions - although this is likely to be done in completely different graphs which are later joined together.\r\n\r\nFinally, this PR also improves the DSL for creating edges so that priorities can be more cleanly expressed - mostly done during tests."},"comment":{"url":"https://api.github.com/repos/guardian/riff-raff/issues/comments/250527468","html_url":"https://github.com/guardian/riff-raff/pull/353#issuecomment-250527468","issue_url":"https://api.github.com/repos/guardian/riff-raff/issues/353","id":250527468,"user":{"login":"sihil","id":1236466,"avatar_url":"https://avatars.githubusercontent.com/u/1236466?v=3","gravatar_id":"","url":"https://api.github.com/users/sihil","html_url":"https://github.com/sihil","followers_url":"https://api.github.com/users/sihil/followers","following_url":"https://api.github.com/users/sihil/following{/other_user}","gists_url":"https://api.github.com/users/sihil/gists{/gist_id}","starred_url":"https://api.github.com/users/sihil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sihil/subscriptions","organizations_url":"https://api.github.com/users/sihil/orgs","repos_url":"https://api.github.com/users/sihil/repos","events_url":"https://api.github.com/users/sihil/events{/privacy}","received_events_url":"https://api.github.com/users/sihil/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T16:59:28Z","updated_at":"2016-09-29T16:59:28Z","body":"On @philwills request I've fully documented the Graph class. Feedback welcome although part of me would prefer others to contribute if it's not clear.\r\n\r\nWhilst documenting I realised that `MidNode` was a stupid name and have switched it out for `ValueNode`."}}
{"actor":{"display_login":"sihil"}}