-
Notifications
You must be signed in to change notification settings - Fork 112
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
Improve errors for outdated protobuf runtimes #465
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When users try to use Connect with types generated by v1 of the protobuf runtime (github.com/golang/protobuf), they get a generic message complaining that their type doesn't implement `proto.Message`. This is confusing, because the message does implement a `proto.Message` interface - just from a different `proto` package. This PR adds a bit of logic to the protobuf codecs to provide better errors in this case. This error message is intentionally long: it uses "github.com/golang/protobuf" and "google.golang.org/protobuf" rather than "v1" and "v2" to avoid confusion with proto2 and proto3, and it includes a link to a Go blog post that explains the migration in detail.
bufdev
approved these changes
Feb 16, 2023
joshcarp
approved these changes
Feb 16, 2023
renovate bot
referenced
this pull request
in open-feature/flagd
Apr 14, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/bufbuild/connect-go](https://togithub.com/bufbuild/connect-go) | require | minor | `v1.5.2` -> `v1.6.0` | --- ### Release Notes <details> <summary>bufbuild/connect-go</summary> ### [`v1.6.0`](https://togithub.com/bufbuild/connect-go/releases/tag/v1.6.0) [Compare Source](https://togithub.com/bufbuild/connect-go/compare/v1.5.2...v1.6.0) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### Enhancements - Improve comments & add procedure consts to generated code by [@​akshayjshah](https://togithub.com/akshayjshah) in [https://github.com/bufbuild/connect-go/pull/480](https://togithub.com/bufbuild/connect-go/pull/480) - Reduce per-call URL parsing cost by [@​mattrobenolt](https://togithub.com/mattrobenolt) in [https://github.com/bufbuild/connect-go/pull/467](https://togithub.com/bufbuild/connect-go/pull/467) - Improve errors for outdated protobuf runtimes by [@​akshayjshah](https://togithub.com/akshayjshah) in [https://github.com/bufbuild/connect-go/pull/465](https://togithub.com/bufbuild/connect-go/pull/465) - Switch README to use `buf curl` by [@​akshayjshah](https://togithub.com/akshayjshah) in [https://github.com/bufbuild/connect-go/pull/474](https://togithub.com/bufbuild/connect-go/pull/474) ##### Bugfixes - Clarify purpose of handler_stream_test.go by [@​Hirochon](https://togithub.com/Hirochon) in [https://github.com/bufbuild/connect-go/pull/472](https://togithub.com/bufbuild/connect-go/pull/472) - Make StreamType constants typed numerics by [@​jhump](https://togithub.com/jhump) in [https://github.com/bufbuild/connect-go/pull/486](https://togithub.com/bufbuild/connect-go/pull/486) - Populate Spec and Peer in Client.CallServerStream by [@​jhump](https://togithub.com/jhump) in [https://github.com/bufbuild/connect-go/pull/487](https://togithub.com/bufbuild/connect-go/pull/487) #### New Contributors - [@​Hirochon](https://togithub.com/Hirochon) made their first contribution in [https://github.com/bufbuild/connect-go/pull/472](https://togithub.com/bufbuild/connect-go/pull/472) **Full Changelog**: bufbuild/connect-go@v1.5.2...v1.6.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/open-feature/flagd). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4zMS40IiwidXBkYXRlZEluVmVyIjoiMzUuMzEuNCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
akshayjshah
added a commit
that referenced
this pull request
Jul 26, 2023
When users try to use Connect with types generated by v1 of the protobuf runtime (github.com/golang/protobuf), they get a generic message complaining that their type doesn't implement `proto.Message`. This is confusing, because the message does implement a `proto.Message` interface - just from a different `proto` package. This PR adds a bit of logic to the protobuf codecs to provide better errors in this case. This error message is intentionally long: it uses "github.com/golang/protobuf" and "google.golang.org/protobuf" rather than "v1" and "v2" to avoid confusion with proto2 and proto3, and it includes a link to a Go blog post that explains the migration in detail. @cyriltovena ran into this, as did a few other other users I've spoken to. Let's save them some debugging time :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When users try to use Connect with types generated by v1 of the protobuf
runtime (github.com/golang/protobuf), they get a generic message
complaining that their type doesn't implement
proto.Message
. This isconfusing, because the message does implement a
proto.Message
interface - just from a different
proto
package. This PR adds a bit oflogic to the protobuf codecs to provide better errors in this case.
This error message is intentionally long: it uses
"github.com/golang/protobuf" and "google.golang.org/protobuf" rather
than "v1" and "v2" to avoid confusion with proto2 and proto3, and it
includes a link to a Go blog post that explains the migration in detail.
@cyriltovena ran into this, as did a few other other users I've spoken to.
Let's save them some debugging time :)