-
Notifications
You must be signed in to change notification settings - Fork 74
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
separate sleuth
command for 'oss index'
#165
Conversation
I am pro this, overall. It certainly makes the code a lot cleaner and easier to follow (I think), so feel free to keep moving on it. |
cmd/iq_test.go
Outdated
// not sure why calling executeCommand() fails as part of test suite, but is fine individually. | ||
//_, err := executeCommand(rootCmd, iqCmd.Use, "--path", "invalidPath", "-a", "appId") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these are a fix it later thing??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these are a fix it later thing??
Yes, or at least an "understand it better later" thing. Added TODO comments. cbcbbe3
I'm pretty sure this is an example of the dangers of using shared state - meaning the configOssi
is essentially global, and testing gets wonky quickly because of the side effects of manipulating configOssi
. Combine that with some of the essentially global state of Cobra/Viper initialization, and complexity abounds.
I would prefer these tests to work using executeCommand()
because that would verify more of the Cobra stuff, but I spent enough time trying to figure out why the executeCommand()
flavor works when run alone, but causes failures when run in a test suite with other tests.
cmd/iq_test.go
Outdated
// not sure why calling executeCommand() fails as part of test suite, but is fine individually. | ||
//_, err := executeCommand(rootCmd, iqCmd.Use, "--path", GopkgLockFilename, "-a", "appId") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these are a fix it later thing??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these are a fix it later thing??
Yes, or at least an "understand it better later" thing. Added TODO comments. cbcbbe3
If no objections, I'll merge this puppy, now that the build is passing. |
…ial release (#161) * Cobra/Viper CLI. * Goodbye go.sum old friend You were fine to start but newer better things came along. We will never forget your contributions to the cause. * fix missing -p flag, document --loud flag * Make some packages internal (#163) * remove types that migrated to go-sona-types library (#164) * store config using nested yaml (ossi.yadda, iq.yadda). * separate `sleuth` command for 'oss index' (#165) new sub command named `sleuth` for running nancy against OSS Index. * make `--clean-cache` available as root command, since it is not specific to ossi or iq. (#169) * Latest dependencies, remove obsolete 'replace' directives (#173) * Use goreleaser to build native linux installers (#175) Co-authored-by: Nathan Zender <github@nathanzender.com> Co-authored-by: Jeffry Hesse <5544326+DarthHater@users.noreply.github.com>
…ial release (sonatype-nexus-community#161) * Cobra/Viper CLI. * Goodbye go.sum old friend You were fine to start but newer better things came along. We will never forget your contributions to the cause. * fix missing -p flag, document --loud flag * Make some packages internal (sonatype-nexus-community#163) * remove types that migrated to go-sona-types library (sonatype-nexus-community#164) * store config using nested yaml (ossi.yadda, iq.yadda). * separate `sleuth` command for 'oss index' (sonatype-nexus-community#165) new sub command named `sleuth` for running nancy against OSS Index. * make `--clean-cache` available as root command, since it is not specific to ossi or iq. (sonatype-nexus-community#169) * Latest dependencies, remove obsolete 'replace' directives (sonatype-nexus-community#173) * Use goreleaser to build native linux installers (sonatype-nexus-community#175) Co-authored-by: Nathan Zender <github@nathanzender.com> Co-authored-by: Jeffry Hesse <5544326+DarthHater@users.noreply.github.com>
This PR creates a new sub command named
sleuth
for running nancy against OSS Index.There is more work to do regarding updating cmd examples and README.md, but I wanted to put this out there to get initial reactions.
cc @bhamail / @DarthHater