{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/3696","labels_url":"https://api.github.com/repos/openshift/origin/issues/3696/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/3696/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/3696/events","html_url":"https://github.com/openshift/origin/pull/3696","id":94982587,"number":3696,"title":"[WIP] buildchain: Refactor to use the graph library","user":{"login":"kargakis","id":3900799,"avatar_url":"https://avatars.githubusercontent.com/u/3900799?v=3","gravatar_id":"","url":"https://api.github.com/users/kargakis","html_url":"https://github.com/kargakis","followers_url":"https://api.github.com/users/kargakis/followers","following_url":"https://api.github.com/users/kargakis/following{/other_user}","gists_url":"https://api.github.com/users/kargakis/gists{/gist_id}","starred_url":"https://api.github.com/users/kargakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kargakis/subscriptions","organizations_url":"https://api.github.com/users/kargakis/orgs","repos_url":"https://api.github.com/users/kargakis/repos","events_url":"https://api.github.com/users/kargakis/events{/privacy}","received_events_url":"https://api.github.com/users/kargakis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-14T16:21:04Z","updated_at":"2015-07-14T16:51:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/3696","html_url":"https://github.com/openshift/origin/pull/3696","diff_url":"https://github.com/openshift/origin/pull/3696.diff","patch_url":"https://github.com/openshift/origin/pull/3696.patch"},"body":"@deads2k @bparees \r\n\r\n```\r\n[vagrant@openshiftdev sample-app]$ oc get is\r\nNAME                 DOCKER REPO                                   TAGS      UPDATED\r\norigin-ruby-sample   172.30.249.163:5000/test/origin-ruby-sample   latest    25 hours ago\r\nruby-20-centos7      openshift/ruby-20-centos7                     latest    25 hours ago\r\n\r\n[vagrant@openshiftdev sample-app]$ oadm build-chain origin-ruby-sample\r\n1: BuildConfig|test/ruby-sample-build\r\n\tBuildOutput to 4: ImageStreamTag|test/origin-ruby-sample:latest\r\n2: ImageStream|test/ruby-20-centos7\r\n3: ImageStreamTag|test/ruby-20-centos7:latest\r\n\tBuildInputImage to 1: BuildConfig|test/ruby-sample-build\r\n\tReferencedImageStreamGraphEdge to 2: ImageStream|test/ruby-20-centos7\r\n4: ImageStreamTag|test/origin-ruby-sample:latest\r\n\tReferencedImageStreamGraphEdge to 6: ImageStream|test/origin-ruby-sample\r\n5: BuildSource|git|https://github.com/openshift/ruby-hello-world.git#\r\n\tBuildInput to 1: BuildConfig|test/ruby-sample-build\r\n6: ImageStream|test/origin-ruby-sample\r\n```\r\n\r\nTBD:\r\n- [ ] Manually create JSON output (like we already do with DOT, not sure though how it'll happen)\r\n- [ ] Create DOT output\r\n\r\n\r\n@deads2k from what I understand so far, I'll have to traverse the inbound edges to the given imageStream in order to output its dependencies right? From the output above it seems that A depends on B so the graph package will create a directed edge from A to B. What we were doing so far in build-chain is the opposite, draw a directed edge from B to A."},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/121306251","html_url":"https://github.com/openshift/origin/pull/3696#issuecomment-121306251","issue_url":"https://api.github.com/repos/openshift/origin/issues/3696","id":121306251,"user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T16:51:39Z","updated_at":"2015-07-14T16:51:39Z","body":"You can traverse edges backwards using https://github.com/openshift/origin/blob/master/pkg/api/graph/graph.go#L259 .  You could also reverse the edges."}}