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

unified printing strategy #5334

Closed

Conversation

stevekuznetsov
Copy link
Contributor

Fixes #5332
Fixes #5256

Updates the following commands to use cmdutil.PrintSuccess:

  • openshift admin new-project
  • openshift admin groups new
  • openshift cli new-project (TODO)
  • openshift cli start-build
  • openshift cli secrets new
  • openshift cli secrets new-dockercfg
  • openshift cli secrets new-basicauth
  • openshift cli secrets new-sshauth
  • openshift ex sync-groups

@deads2k

@stevekuznetsov
Copy link
Contributor Author

[test] me

},
}

kcmdutil.AddOutputFlagsForMutation(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

refactor this method upstream to bind to a variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k what benefits from that change do I use to justify that PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k what benefits from that change do I use to justify that PR?

Currently, the printer and output methods on the Factory are very difficult to use during delegation flows. They rely on having a cmd set up with exactly the "right" flags. We should refactor the Factory to specify the actual values they need.

Having the proper object bound in will allow you separate the data from its expression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k thanks

@openshift-bot openshift-bot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 22, 2015
@@ -78,6 +78,9 @@ func NewCmdStartBuild(fullName string, f *clientcmd.Factory, out io.Writer) *cob

cmd.Flags().String("git-post-receive", "", "The contents of the post-receive hook to trigger a build")
cmd.Flags().String("git-repository", "", "The path to the git repository for post-receive; defaults to the current directory")

cmdutil.AddOutputFlagsForMutation(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

Omit start build from this pr because this breaks a lot of examples and tests that expect the output to be the name only. We'll need a more nuanced solution there.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 24, 2015
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 14, 2015
@stevekuznetsov stevekuznetsov force-pushed the skuznets/print-success branch 8 times, most recently from 2b17e27 to 4daf41d Compare January 6, 2016 16:28
@stevekuznetsov
Copy link
Contributor Author

@deads2k I haven't made upstream changes to AddOutputFlagsForMutation yet, but I've updated the rest of this pull. Ready for another look.

@stevekuznetsov
Copy link
Contributor Author

[test]
[extended:ldap_groups]

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 6, 2016
@stevekuznetsov stevekuznetsov force-pushed the skuznets/print-success branch 3 times, most recently from 1f70f77 to a0d1048 Compare January 6, 2016 20:58
@deads2k deads2k self-assigned this Jan 8, 2016
@deads2k
Copy link
Contributor

deads2k commented Jan 9, 2016

re[test]

@deads2k
Copy link
Contributor

deads2k commented Jan 11, 2016

legit failure this time.

@stevekuznetsov
Copy link
Contributor Author

Jenkins cache cleared, re[test]

@stevekuznetsov
Copy link
Contributor Author

@danmcp the bot comment here claims the test succeeded, but both jobs failed. Why?

@stevekuznetsov
Copy link
Contributor Author

imagestream flake here:

FAILURE after 59.313s: hack/../test/cmd/builds.sh:76: executing 'oc get is ruby-22-centos7' expecting any result and text 'latest'; re-trying every 0.2s until completion or 60.000s: the command timed out
Standard output from the command:
NAME              DOCKER REPO              TAGS      UPDATED
ruby-22-centos7   centos/ruby-22-centos7
... repeated 146 times
There was no error output from the command.

#6259

@danmcp
Copy link

danmcp commented Jan 21, 2016

@stevekuznetsov It's almost certainly because @deads2k and myself had killed a few jobs by hand yesterday and didn't clean everything up fully. This was the one that passed:

https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/224/

@stevekuznetsov
Copy link
Contributor Author

re[test]

@stevekuznetsov
Copy link
Contributor Author

flake on test/cmd/builds here:

Running hack/../test/cmd/builds.sh:68: executing 'oc new-build -D "FROM centos:7" -o json | python -m json.tool' expecting success...
FAILURE after 30.228s: hack/../test/cmd/builds.sh:68: executing 'oc new-build -D "FROM centos:7" -o json | python -m json.tool' expecting success: the command returned the wrong error code
There was no output from the command.
Standard error from the command:
error: only a partial match was found for "centos:7": "cmd-builds/centos"
No JSON object could be decoded

#6818

@stevekuznetsov
Copy link
Contributor Author

I honestly can't tell what caused the failure in this log.

re[test], @deads2k barring a real fail I think this is ready

@fabianofranz
Copy link
Member

UP, @stevekuznetsov please rebase and let's try to get this in.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 22, 2016
@stevekuznetsov
Copy link
Contributor Author

@fabianofranz this is broken, blocked on factory.ClientMapperForCommand not existing anymore (???) -- do you have the bandwidth to take this over?

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 65558ac

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 24, 2016
@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/1578/) (Extended Tests: ldap_groups)

@openshift-bot
Copy link
Contributor

Origin Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 2, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 21, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 28, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 5, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 23, 2016
@stevekuznetsov
Copy link
Contributor Author

Closing this as I don't think it's really relevant anymore ... @fabianofranz feel free to pick this up if it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants