-
Notifications
You must be signed in to change notification settings - Fork 25
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
✨ Support multiple inputs with bulk option #250
Conversation
It was requested to allow multiple inputs for kantra analyze command. Full multiple inputs support (or a limited/hidden input-bin directory support) would bring unwanted complications for codebase and unwanted usage of kantra tool instead of using Konveyor Hub (discussed in eng team). It looks much cleaner to me to state in README, that kantra analyze is intentionaly a single input command, but allow script multiple inputs analysis on user-side with --bulk command option, that allows run mutliple analysis into the same output directly and create a combined static report. Related to - https://github.com/konveyor/kantra/issues/180 - konveyor#234 (alternative) Signed-off-by: Marek Aufart <maufart@redhat.com>
} | ||
|
||
func (a *analyzeCommand) inputShortName() string { | ||
return filepath.Base(a.input) |
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.
Thinking also about safer way - urlencode fullpath (https://pkg.go.dev/net/url#QueryEscape) instead of just file basename.
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.
I think this is is more than fine
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.
I would almost suggest to inline this call, but it's not a big deal.
} | ||
err = copyFileContents(depsPath, fmt.Sprintf("%s.%s", analysisLogFilePath, a.inputShortName())) | ||
if err == nil { // dependencies file presence is optional | ||
err = os.Remove(depsPath); |
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.
A "normal" golang mv
did not work correctly in container mount volumes, using copy&delete.
-s, --source stringArray source technology to consider for analysis. Use multiple times for additional sources: --source <source1> --source <source2> ... | ||
-t, --target stringArray target technology to consider for analysis. Use multiple times for additional targets: --target <target1> --target <target2> ... | ||
--analyze-known-libraries analyze known open-source libraries | ||
--bulk running multiple analyze commands in bulk will result to combined static report |
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.
Could we maybe call this something like --bulk-run
?
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.
Good point, I was thinking more about short bulk
since -run
looks to me kind of expected when the command is executed; another option might be combine(-ouput)
which might be descriptive on what is expected to be done, but longer. Keeping this question open.
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.
I think that something about combining output makes sense, if we can handle running combine AFTER a normal analysis run is made.
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.
Because of time, I think this is fine for now. We can always revisit naming
Just a couple small things. Otherwise, LGTM! Thank you! |
@aufi looks like it just needs a rebase |
Signed-off-by: Marek Aufart <aufi.cz@gmail.com>
It was requested to allow multiple inputs for kantra analyze command. Full multiple inputs support PR#234 (or a limited/hidden input-bin directory support) would bring unwanted complications for codebase and unwanted usage of kantra tool instead of using Konveyor Hub (discussed in eng team).
It looks much cleaner to me to state in README, that kantra analyze is intentionaly a single input command, but allow script multiple inputs analysis on user-side with --bulk command option, that allows run mutliple analysis into the same output directly and create a combined static report.
Related to