{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/44565034","id":44565034,"diff_hunk":"@@ -0,0 +1,87 @@\n+package analysis\n+\n+import (\n+\t\"fmt\"\n+\n+\t\"github.com/gonum/graph\"\n+\n+\tosgraph \"github.com/openshift/origin/pkg/api/graph\"\n+\tbuildedges \"github.com/openshift/origin/pkg/build/graph\"\n+\tbuildgraph \"github.com/openshift/origin/pkg/build/graph/nodes\"\n+\tdeployedges \"github.com/openshift/origin/pkg/deploy/graph\"\n+\tdeploygraph \"github.com/openshift/origin/pkg/deploy/graph/nodes\"\n+\timageedges \"github.com/openshift/origin/pkg/image/graph\"\n+\timagegraph \"github.com/openshift/origin/pkg/image/graph/nodes\"\n+)\n+\n+const (\n+\tImageStreamTagNotAvailableWarning = \"ImageStreamTagNotAvailable\"\n+\tMissingImageStreamWarning         = \"MissingImageStream\"\n+\tMissingImageStreamTagWarning      = \"MissingImageStreamTag\"\n+)\n+\n+// FindDeploymentConfigTriggerErrors checks for possible failures in deployment config\n+// image change triggers.\n+//\n+// Precedence of failures:\n+// 1. The image stream of the tag of interest does not exist.\n+// 2. The image stream tag does not exist but a build config points to it.\n+// 3. The image stream tag does not exist.\n+func FindDeploymentConfigTriggerErrors(g osgraph.Graph) []osgraph.Marker {\n+\tmarkers := []osgraph.Marker{}\n+\n+dc:\n+\tfor _, uncastDcNode := range g.NodesByKind(deploygraph.DeploymentConfigNodeKind) {\n+\t\tfor _, uncastIstNode := range g.PredecessorNodesByEdgeKind(uncastDcNode, deployedges.TriggersDeploymentEdgeKind) {\n+\t\t\tif istNode := uncastIstNode.(*imagegraph.ImageStreamTagNode); !istNode.Found() {\n+\t\t\t\tdcNode := uncastDcNode.(*deploygraph.DeploymentConfigNode)\n+\n+\t\t\t\t// 1. Image stream for tag of interest does not exist\n+\t\t\t\tfor _, uncastIsNode := range g.SuccessorNodesByEdgeKind(uncastIstNode, imageedges.ReferencedImageStreamGraphEdgeKind) {\n+\t\t\t\t\tisNode := uncastIsNode.(*imagegraph.ImageStreamNode)\n+\t\t\t\t\tif isNode.Found() {\n+\t\t\t\t\t\tbreak\n+\t\t\t\t\t}\n+\t\t\t\t\tmarkers = append(markers, osgraph.Marker{\n+\t\t\t\t\t\tNode:         uncastDcNode,\n+\t\t\t\t\t\tRelatedNodes: []graph.Node{uncastIstNode, uncastIsNode},\n+\n+\t\t\t\t\t\tSeverity: osgraph.WarningSeverity,\n+\t\t\t\t\t\tKey:      MissingImageStreamWarning,\n+\t\t\t\t\t\tMessage: fmt.Sprintf(\"The image trigger for %s will have no effect because %s does not exist.\",\n+\t\t\t\t\t\t\tdcNode.ResourceString(), isNode.ResourceString()),\n+\t\t\t\t\t})\n+\t\t\t\t\tcontinue dc\n+\t\t\t\t}\n+\n+\t\t\t\t// 2. Build config points to image stream tag of interest","path":"pkg/deploy/graph/analysis/dc.go","position":57,"original_position":57,"commit_id":"9a2c1553d910afa0f796cbe08ac8138d9c5810ce","original_commit_id":"9a2c1553d910afa0f796cbe08ac8138d9c5810ce","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},"body":"This one means we're just waiting on a build, right?  Isn't that the discussion we just had with ben?","created_at":"2015-11-11T18:13:28Z","updated_at":"2015-11-11T18:13:28Z","html_url":"https://github.com/openshift/origin/pull/5085#discussion_r44565034","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/5085","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/44565034"},"html":{"href":"https://github.com/openshift/origin/pull/5085#discussion_r44565034"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/5085"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/5085","id":47440160,"html_url":"https://github.com/openshift/origin/pull/5085","diff_url":"https://github.com/openshift/origin/pull/5085.diff","patch_url":"https://github.com/openshift/origin/pull/5085.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/5085","number":5085,"state":"open","locked":false,"title":"status: Warn about transient deployment trigger errors","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},"body":"@deads2k \r\n\r\n>  I do think we should handle multiple bad triggers as markers for warnings and the separately mark a deployment that can't succeed on the same line. Something like \" #1 deployment waiting on image or update (image stream doesn't exist)\"\r\n\r\nSeparate marker for each warning means we traverse the graph and not follow the message set up by the dc controller. Or is it enough to break down the message into markers?\r\n","created_at":"2015-10-12T16:38:52Z","updated_at":"2015-11-11T18:13:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5e566b50b6736323de1a952352ba786aff806e2","assignee":null,"milestone":{"url":"https://api.github.com/repos/openshift/origin/milestones/10","html_url":"https://github.com/openshift/origin/milestones/1.1.1","labels_url":"https://api.github.com/repos/openshift/origin/milestones/10/labels","id":1394546,"number":10,"title":"1.1.1","description":"","creator":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":0,"state":"open","created_at":"2015-11-04T22:47:05Z","updated_at":"2015-11-10T21:00:40Z","due_on":"2015-12-09T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/openshift/origin/pulls/5085/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/5085/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/5085/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/9a2c1553d910afa0f796cbe08ac8138d9c5810ce","head":{"label":"kargakis:oc-status-deployments","ref":"oc-status-deployments","sha":"9a2c1553d910afa0f796cbe08ac8138d9c5810ce","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},"repo":{"id":29889288,"name":"origin","full_name":"kargakis/origin","owner":{"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},"private":false,"html_url":"https://github.com/kargakis/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/kargakis/origin","forks_url":"https://api.github.com/repos/kargakis/origin/forks","keys_url":"https://api.github.com/repos/kargakis/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kargakis/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kargakis/origin/teams","hooks_url":"https://api.github.com/repos/kargakis/origin/hooks","issue_events_url":"https://api.github.com/repos/kargakis/origin/issues/events{/number}","events_url":"https://api.github.com/repos/kargakis/origin/events","assignees_url":"https://api.github.com/repos/kargakis/origin/assignees{/user}","branches_url":"https://api.github.com/repos/kargakis/origin/branches{/branch}","tags_url":"https://api.github.com/repos/kargakis/origin/tags","blobs_url":"https://api.github.com/repos/kargakis/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kargakis/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kargakis/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/kargakis/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kargakis/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/kargakis/origin/languages","stargazers_url":"https://api.github.com/repos/kargakis/origin/stargazers","contributors_url":"https://api.github.com/repos/kargakis/origin/contributors","subscribers_url":"https://api.github.com/repos/kargakis/origin/subscribers","subscription_url":"https://api.github.com/repos/kargakis/origin/subscription","commits_url":"https://api.github.com/repos/kargakis/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/kargakis/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/kargakis/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/kargakis/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/kargakis/origin/contents/{+path}","compare_url":"https://api.github.com/repos/kargakis/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kargakis/origin/merges","archive_url":"https://api.github.com/repos/kargakis/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kargakis/origin/downloads","issues_url":"https://api.github.com/repos/kargakis/origin/issues{/number}","pulls_url":"https://api.github.com/repos/kargakis/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/kargakis/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/kargakis/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kargakis/origin/labels{/name}","releases_url":"https://api.github.com/repos/kargakis/origin/releases{/id}","created_at":"2015-01-27T00:24:14Z","updated_at":"2015-05-07T09:50:35Z","pushed_at":"2015-11-11T17:31:38Z","git_url":"git://github.com/kargakis/origin.git","ssh_url":"git@github.com:kargakis/origin.git","clone_url":"https://github.com/kargakis/origin.git","svn_url":"https://github.com/kargakis/origin","homepage":"https://openshift.github.io","size":182369,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"60781e3028ae63d489755eecf450b236d7a3c0b6","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","created_at":"2014-07-30T20:04:05Z","updated_at":"2015-11-10T23:44:20Z","pushed_at":"2015-11-11T18:11:34Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":301043,"stargazers_count":799,"watchers_count":799,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":495,"mirror_url":null,"open_issues_count":688,"forks":495,"open_issues":688,"watchers":799,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/5085"},"html":{"href":"https://github.com/openshift/origin/pull/5085"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/5085"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/5085/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/5085/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/5085/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/9a2c1553d910afa0f796cbe08ac8138d9c5810ce"}}}}