Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tolerate multiple bcs pointing to same istag for oc status #9308

Merged
merged 1 commit into from
Jun 15, 2016

Conversation

gabemontero
Copy link
Contributor

Fixes #8022

@Kargakis @deads2k @stevekuznetsov @csrwng PTAL if you have the cycles

istNode := uncastIstNode.(*imagegraph.ImageStreamTagNode)
if bcNode := buildedges.BuildConfigForTag(g, uncastIstNode); bcNode != nil && !istNode.Found() {
// findPendingTags is the guts behind FindPendingTags .... break out some of the contents and reduce some indentation
func findPendingTags(bcNodes []*buildgraph.BuildConfigNode, markers []osgraph.Marker, istNode *imagegraph.ImageStreamTagNode, uncastIstNode graph.Node, g osgraph.Graph, f osgraph.Namer) []osgraph.Marker {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The number of arguments here smells bad ... almost not sure if we should be passing in istNode and bcNodes if they're trivial to get from the uncastIstNode.

Similarly, we don't need the markers, we can just return our own list and FindPendingTags can do the append.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored ... part of just completed push

@gabemontero
Copy link
Contributor Author

updates based on comments from @stevekuznetsov pushed - thanks.

@@ -162,6 +162,62 @@ func FindCircularBuilds(g osgraph.Graph, f osgraph.Namer) []osgraph.Marker {
return markers
}

// findPendingTags is the guts behind FindPendingTags .... break out some of the content and reduce some indentation
func findPendingTags(uncastIstNode graph.Node, g osgraph.Graph, f osgraph.Namer) []osgraph.Marker {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only one tag and you are returning markers: findPendingTagMarkers ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

part of next push

@deads2k
Copy link
Contributor

deads2k commented Jun 14, 2016

I like the refactor, much easier to read.

@gabemontero
Copy link
Contributor Author

updates based on comments pushed ... thanks @deads2k @Kargakis @stevekuznetsov


Severity: osgraph.WarningSeverity,
Key: TagNotAvailableWarning,
Message: fmt.Sprintf("%s needs to be imported or created by a build.", f.ResourceName(istNode)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may still want to show this message in case a build failed but I don't feel strong about it. We already point to the build failure and deployment config markers take care of the deployment part.

@0xmichalis
Copy link
Contributor

LGTM but I will defer to @deads2k and @stevekuznetsov for a final review

func findPendingTagMarkers(istNode *imagegraph.ImageStreamTagNode, g osgraph.Graph, f osgraph.Namer) []osgraph.Marker {
markers := []osgraph.Marker{}

var latestBuild *buildgraph.BuildNode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildFound := false? The actual value isn't important, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct ... part of next push

@deads2k
Copy link
Contributor

deads2k commented Jun 15, 2016

One nit.

lgtm

// use of f.ResourceName(bcNode) will produce a string like oc start-build BuildConfig|example/ruby-hello-world
ret = ret + fmt.Sprintf("oc start-build %s", bcNode.BuildConfig.GetName())
if i < (len(bcNodes) - 1) {
ret = ret + ", "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the line not copy-paste-able into the shell... do we care? Do we want each suggestion on it's own line?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the line not copy-paste-able into the shell... do we care? Do we want each suggestion on it's own line?

I think this is better. Otherwise I'll get tons of lines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste is your horse to beat, so that sounds good :)

@stevekuznetsov
Copy link
Contributor

output nit, otherwise LGTM

@gabemontero
Copy link
Contributor Author

buildFound comment resolution pushed; left the oc start-build suggestion single line (they can just mark a subset of the line for copy/paste)

thanks gentlemen

@csrwng or @bparees - looks like this one is ready for the merge comment ... please post it here at your earliest convenience.

@deads2k
Copy link
Contributor

deads2k commented Jun 15, 2016

[merge]

@gabemontero
Copy link
Contributor Author

ah - thanks @deads2k (didn't realize you had that power)

@openshift-bot
Copy link
Contributor

openshift-bot commented Jun 15, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4905/) (Image: devenv-rhel7_4382)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to de1519d

@stevekuznetsov
Copy link
Contributor

@deads2k comes in here like

I've got the power

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to de1519d

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4905/)

@openshift-bot openshift-bot merged commit bac5286 into openshift:master Jun 15, 2016
@gabemontero gabemontero deleted the issue8022 branch June 17, 2016 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants