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

Remove unneeded message on command completion. Set error output to Stderr #432

Merged

Conversation

vicmarbev
Copy link
Contributor

@vicmarbev vicmarbev commented Sep 1, 2022

Fixes #426
Basically I removed the "Succeeded" message and redirect error output to Stderr. Do you see any problem with this approach? Is there any case that we want to print that "Succeeded" message?

Signed-off-by: Víctor Martínez Bevià vicmarbev@gmail.com

Signed-off-by: Víctor Martínez Bevià <vicmarbev@gmail.com>
@joaopapereira
Copy link
Member

Hey @vicmarbev the removal of Succeed text might have some impact on the tools that consume imgpkg as a binary, like vendir or even imgpkg. Is there any particular reason for you to want to remove it?

When you run imgpkg ... | cat you will see that the message does not show up. Would that be enough? another option would be to do imgpkg --tty=false this should also remove messages that are meant for humans to read.

Signed-off-by: Víctor Martínez Bevià <vicmarbev@gmail.com>
@vicmarbev
Copy link
Contributor Author

What about that last commit? It's the same approach they used in Kapp about this issue: carvel-dev/kapp#592

@vicmarbev vicmarbev changed the title Remove unneeded message. Set error output to Stderr Remove unneeded message on command completion. Set error output to Stderr Sep 5, 2022
@vicmarbev vicmarbev had a problem deploying to TanzuNet Registry Dev e2e September 5, 2022 12:17 Failure
@cppforlife
Copy link
Contributor

some work is happening in kapp to clean up similar functionality. will want to port over those changes here. stay tuned.

@cppforlife
Copy link
Contributor

updated kapp change: carvel-dev/kapp@ed8c3f2

@vicmarbev
Copy link
Contributor Author

Hi @cppforlife could you help me with the IsCobraInternalCommand not declared by package error? I see no difference with the carvel-kapp version

@joaopapereira
Copy link
Member

I was looking at the PR and to be fair I am not sure I agree with the name of the function that was added to cobrautil. help is not a cobra internal command. It looks like we are overreaching here with the naming.

@praveenrewar
Copy link
Member

I was looking at the PR and to be fair I am not sure I agree with the name of the function that was added to cobrautil. help is not a cobra internal command. It looks like we are overreaching here with the naming.

Yeah, I agree with you on this. help is set by cobra by default but it can also be set manually by us, also it is a little bit tricky in the sense that it's set at runtime unlike other commands. I was trying to describe this behaviour and the best thing I could come up with was internal (as the other commands being checked in that function are cobra internal commands). I am definitely open to changing this up if we can think of a better name.

@joaopapereira
Copy link
Member

I think what we want is maybe a function that let us know that we should not provide extra output to them because in some sense this is the only use of this particular function.
What do you think of IsCobraManagedCommand?

@praveenrewar
Copy link
Member

What do you think of IsCobraManagedCommand?

💯
Makes sense to me.

could you help me with the IsCobraInternalCommand not declared by package error? I see no difference with the carvel-kapp version

@vicmarbev I don't see any diff in the vendor directory, you might wanna run go mod vendor or the ./hack/build.sh script.

@joaopapereira
Copy link
Member

I think the problem might be as simple as the vendored packaged was not added to the commit. So if there is a change in the vendor we need to dad the file and commit it.

If this does not solve the problem I can take a look at it later

@vicmarbev vicmarbev temporarily deployed to TanzuNet Registry Dev e2e October 4, 2022 06:51 Inactive
@vicmarbev vicmarbev temporarily deployed to GCR e2e October 4, 2022 06:51 Inactive
@vicmarbev
Copy link
Contributor Author

What do you think of IsCobraManagedCommand?

💯 Makes sense to me.

could you help me with the IsCobraInternalCommand not declared by package error? I see no difference with the carvel-kapp version

@vicmarbev I don't see any diff in the vendor directory, you might wanna run go mod vendor or the ./hack/build.sh script.

That did it. Thanks!

@vicmarbev
Copy link
Contributor Author

Anything else needed for this PR?

@joaopapereira
Copy link
Member

@vicmarbev I am waiting on the PR cppforlife/cobrautil#6 to get merged and when that is done I would ask you to bump the cobrautil library and I think we should be ready to go

@joaopapereira
Copy link
Member

@vicmarbev whenever you can please bump cobrautil to the latest version so that we can use the new function. After that I think we will be ready to merge this PR

@vicmarbev vicmarbev temporarily deployed to TanzuNet Registry Dev e2e October 26, 2022 09:16 Inactive
@vicmarbev vicmarbev temporarily deployed to GCR e2e October 26, 2022 09:16 Inactive
Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

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

LGTM

@joaopapereira joaopapereira merged commit 84ac0d2 into carvel-dev:develop Oct 26, 2022
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.

Extra output and errors during shell completion
4 participants