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

Show the use of proper gogo/googleapi types with status. #10

Merged
merged 3 commits into from
Mar 29, 2018

Conversation

johanbrandhorst
Copy link
Member

This avoids the use of google.golang.org/genproto package types (except for the mandatory status type).

@johanbrandhorst johanbrandhorst force-pushed the show-proper-use-of-errors branch 2 times, most recently from f50526a to a916715 Compare March 17, 2018 20:24
server/server.go Outdated
}

return nil, st.Err()
byts, _ := proto.Marshal(b)
Copy link
Member

Choose a reason for hiding this comment

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

Remember to check the error.

server/server.go Outdated
},
},
}
byts, _ := proto.Marshal(b)
Copy link
Member

Choose a reason for hiding this comment

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

Remember to check the error

server/server.go Outdated
"github.com/gogo/protobuf/types"
"google.golang.org/genproto/googleapis/rpc/errdetails"
pbAny "github.com/golang/protobuf/ptypes/any"
Copy link
Member

Choose a reason for hiding this comment

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

Are we still planning to get rid of these pbAny and pbStatus types and replace them with gogo types in future?


"github.com/cockroachdb/cockroach/pkg/util/protoutil"
gogoproto "github.com/gogo/protobuf/proto"
golangproto "github.com/golang/protobuf/proto"
Copy link
Member

Choose a reason for hiding this comment

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

nice :)

status/README.md Outdated
The changes applies include changing the use of the
`golang/protobuf` packages to `gogo/protobuf`, and changing the
generated files from `google.golang.org/genproto/googleapis` to
`github.com/goog/googleapis/`.
Copy link
Member

Choose a reason for hiding this comment

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

gogo not goog :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops

@johanbrandhorst
Copy link
Member Author

I'm going to remove the manual vendor changes and wait with merging this until upstream (grpc/grpc-go#1927) has been merged (or rejected 😭).

@awalterschulze
Copy link
Member

awalterschulze commented Mar 18, 2018 via email

Gopkg.toml Outdated
name = "google.golang.org/grpc"
version = "1.10.0"
# version = "1.10.0"#
source = "github.com/johanbrandhorst/grpc-go"
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: Revert back once grpc/grpc-go#1927 is merged

Gopkg.toml Outdated
branch = "patch-1"
name = "google.golang.org/grpc"
# version = "1.10.0"#
source = "github.com/johanbrandhorst/grpc-go"
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: Revert this once grpc/grpc-go#1927 is merged

Gopkg.toml Outdated
name = "github.com/golang/mock"
name = "github.com/mwitkow/go-proto-validators"

[[override]]
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: Set this back to [[constraint]]

@johanbrandhorst
Copy link
Member Author

Updated in anticipation of grpc/grpc-go#1927. Will just need setting the Gopkg.toml back then we can merge.

@awalterschulze
Copy link
Member

Ooo wow. This looks great. I hope 1927 goes through. Great work.

Adds an error detail to the ListUsers call in order to
ensure both streaming and unary calls properly
translate gogo statuses.
Upgrading to 1.11.0 revealed that we weren't using the
ipv4 scheme at all as I expected. Now just pass through
the raw localhost address instead.
@johanbrandhorst
Copy link
Member Author

I've update this with the new gRPC version, and gogo/status, and everything seems to work alright.

Copy link
Member

@awalterschulze awalterschulze left a comment

Choose a reason for hiding this comment

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

Beautiful :)

@johanbrandhorst johanbrandhorst merged commit 7699aa9 into master Mar 29, 2018
@johanbrandhorst johanbrandhorst deleted the show-proper-use-of-errors branch March 29, 2018 12:03
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.

2 participants