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

MTA-2041: send err to analysis command #149

Closed
wants to merge 1 commit into from

Conversation

eemcmullan
Copy link
Collaborator

Because we send errs to logs: https://github.com/konveyor/kantra/blob/main/cmd/analyze.go#L746 the errors hit during analysis or shim would not bubble up to the analyze command itself: https://github.com/konveyor/kantra/blob/main/cmd/analyze.go#L128

Closes #148

Signed-off-by: Emily McMullan <emcmulla@redhat.com>
@@ -119,12 +119,10 @@ func NewAnalyzeCmd(log logr.Logger) *cobra.Command {
}
xmlOutputDir, err := analyzeCmd.ConvertXML(cmd.Context())
if err != nil {
log.Error(err, "failed to convert xml rules")
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like error comes out empty everytime because the analyzer command is not producing any output to stderr. I am wondering whether we should fix that in analyzer-lsp and not remove these lines.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will take a look there

Copy link
Contributor

Choose a reason for hiding this comment

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

it might be worth adding a flag, that can say print to stderr on failure for all of the commands (shim/lsp/dep).

Copy link
Collaborator Author

@eemcmullan eemcmullan Jan 25, 2024

Choose a reason for hiding this comment

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

The issue is that without sending the error to stderr, the error on output is blank like so:

ERRO[0042] container run error                           error="exit status 1"
Error:

Instead of a flag, maybe we need to force this? Is this something we want to close here and open as an issue in analyzer? @pranavgaikwad @shawn-hurley

@@ -172,8 +172,7 @@ func (w *windupShimCommand) Run(ctx context.Context) error {
WithCleanup(w.cleanup),
)
if err != nil {
w.log.V(1).Error(err, "failed to run convert command")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above

@eemcmullan
Copy link
Collaborator Author

closing for fix in analyzer-lsp konveyor/analyzer-lsp#479

@eemcmullan eemcmullan closed this Feb 1, 2024
@eemcmullan eemcmullan deleted the return-err branch May 23, 2024 17:55
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.

the terminal doesn't display the error
3 participants