-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: get a diff only when in debug #55
Conversation
proto/merge.go
Outdated
@@ -100,7 +100,7 @@ func mergedFileDescriptors(debug bool) (*descriptorpb.FileDescriptorSet, error) | |||
// If there's a mismatch, we log a warning. If there was no | |||
// mismatch, then we do nothing, and take the protoregistry file | |||
// descriptor as the correct one. | |||
if !protov2.Equal(protodesc.ToFileDescriptorProto(protoregFd), fd) { | |||
if !protov2.Equal(protodesc.ToFileDescriptorProto(protoregFd), fd) && debug { |
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.
Oh, I understand now what you meant on Slack. The diff isn't printed anyway, because it is printed only on debug... So even before that we did not have a way to easily call debug from the SDK.
Maybe in a follow-up we should add an option in proto.MergedRegistry() to call DebugFileDescriptorsMismatch
instead of MergedFileDescriptors
? This way we can handle the display of the debug directly in the SDK.
Needs a changelog as well. |
c78ce25
to
8d22e1e
Compare
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.
This makes sense @facundomedica, sorry for missing that in my original PR. Thanks!
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
When running with
debug=false
calculating diffs make no sense given that they are not going to be printed. This was causing a lot of time being spent here for no reasonref: cosmos/cosmos-sdk#15594