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

Make bundle validate subcommand respect verbosity #3795

Merged
merged 2 commits into from Aug 28, 2020

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Aug 27, 2020

Make bundle validate subcommand respect verbosity

This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: #3793

@joelanford
Copy link
Member

@JAORMX Can you add a changelog fragment for the bugfix to this PR?

Also, btw we typically merge the master PR and then cherry-pick it back to the previous maintained branches.

@JAORMX
Copy link
Contributor Author

JAORMX commented Aug 27, 2020

@joelanford got it; I'll close the other PRs then. And I'll add the changelog entry

@asmacdo
Copy link
Member

asmacdo commented Aug 27, 2020

The travis failure is just a link-checker flake, I checked the failing link and it's working now. I'm not going to restart the job since adding the changelog will run again.

@JAORMX
Copy link
Contributor Author

JAORMX commented Aug 27, 2020

Pull-request updated, HEAD is now 80b42f8

@JAORMX JAORMX force-pushed the bundle-validate-debug branch 2 times, most recently from 80b42f8 to 4327b78 Compare August 27, 2020 15:16
CHANGELOG.md Outdated Show resolved Hide resolved
This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793
// Always print non-output logs to stderr as to not pollute actual command output.
// Note that it allows the JSON result be redirected to the Stdout. E.g
// if we run the command with `| jq . > result.json` the command will print just the logs
// and the file will have only the JSON result.
logger := log.NewEntry(internal.NewLoggerTo(os.Stderr))
if viper.GetBool(flags.VerboseOpt) {
logger.Logger.SetLevel(log.DebugLevel)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be possible add the unit test to ensure it in validate_test.go?

@asmacdo
Copy link
Member

asmacdo commented Aug 28, 2020

@JAORMX Thank you! We would like to include this in the 0.19.3 release, and because code freeze for that is today, I went ahead and added the unit test so we can get this merged. I will cherrypick this into 0.19.

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 28, 2020
@JAORMX
Copy link
Contributor Author

JAORMX commented Aug 28, 2020

Thanks folks! It's a little late for me already (Friday evening) so I really appreciate the help here

@@ -18,6 +18,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/bundle/internal"
log "github.com/sirupsen/logrus"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to merge first: #3808
You will need to rebase it with the master. So, could you please fix the order of the imports here.
The sdk one should be kept and the end it will be:

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	log "github.com/sirupsen/logrus"

       	"github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/bundle/internal"
)
``

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

requires rebase with master and I have a nit comment.
Otherwise, /lgtm

Really tks for your contribution 🥇

@asmacdo asmacdo merged commit 16403cb into operator-framework:master Aug 28, 2020
@asmacdo
Copy link
Member

asmacdo commented Aug 28, 2020

/cherry-pick v0.19.x

@openshift-cherrypick-robot

@asmacdo: #3795 failed to apply on top of branch "v0.19.x":

Applying: Make bundle validate subcommand respect verbosity
Using index info to reconstruct a base tree...
A	internal/cmd/operator-sdk/bundle/validate.go
Falling back to patching base and 3-way merge...
Auto-merging cmd/operator-sdk/bundle/validate.go
Applying: add unit test for bundle validate debug logger bug
Using index info to reconstruct a base tree...
A	internal/cmd/operator-sdk/bundle/validate.go
A	internal/cmd/operator-sdk/bundle/validate_test.go
Falling back to patching base and 3-way merge...
Auto-merging cmd/operator-sdk/bundle/validate_test.go
CONFLICT (content): Merge conflict in cmd/operator-sdk/bundle/validate_test.go
Auto-merging cmd/operator-sdk/bundle/validate.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 add unit test for bundle validate debug logger bug
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick v0.19.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

asmacdo added a commit to asmacdo/operator-sdk that referenced this pull request Aug 28, 2020
…#3795)

* Make bundle validate subcommand respect verbosity

This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793

* add unit test

Co-authored-by: Austin Macdonald <austin@redhat.com>
asmacdo added a commit that referenced this pull request Aug 28, 2020
* Make bundle validate subcommand respect verbosity

This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: #3793

* add unit test

Co-authored-by: Austin Macdonald <austin@redhat.com>

Co-authored-by: Juan Osorio Robles <jaosorior@redhat.com>
joelanford pushed a commit to joelanford/operator-sdk that referenced this pull request Sep 17, 2020
…#3795)

* Make bundle validate subcommand respect verbosity

This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793

* add unit test 

Co-authored-by: Austin Macdonald <austin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bundle validate does not respect the --verbose-flag
6 participants