Skip to content

Commit

Permalink
runtime: rewrite fieldmask logic with protoreflect
Browse files Browse the repository at this point in the history
Replace the use of the descriptorpb when we can use reflection
instead. Also add more thorough test and support repeated fields.
  • Loading branch information
johanbrandhorst committed May 14, 2020
1 parent 43ced79 commit c950d28
Show file tree
Hide file tree
Showing 27 changed files with 1,617 additions and 535 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ HELLOWORLD_GWSRCS=$(HELLOWORLD:.proto=.pb.gw.go)

RUNTIME_TEST_PROTO=runtime/internal/examplepb/example.proto \
runtime/internal/examplepb/proto2.proto \
runtime/internal/examplepb/proto3.proto
runtime/internal/examplepb/proto3.proto \
runtime/internal/examplepb/non_standard_names.proto
RUNTIME_TEST_SRCS=$(RUNTIME_TEST_PROTO:.proto=.pb.go)

EXAMPLE_CLIENT_DIR=examples/internal/clients
Expand Down
1 change: 0 additions & 1 deletion examples/internal/helloworld/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ go_library(
deps = [
"//internal/utilities:go_default_library",
"//runtime:go_default_library",
"@com_github_golang_protobuf//descriptor:go_default_library_gen",
"@com_github_golang_protobuf//proto:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
Expand Down
2 changes: 0 additions & 2 deletions examples/internal/helloworld/helloworld.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions examples/internal/integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go_test(
name = "go_default_test",
srcs = [
"client_test.go",
"fieldmask_test.go",
"integration_test.go",
"main_test.go",
],
Expand All @@ -19,7 +18,6 @@ go_test(
"//examples/internal/server:go_default_library",
"//runtime:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@com_github_golang_protobuf//descriptor:go_default_library_gen",
"@com_github_golang_protobuf//jsonpb:go_default_library_gen",
"@com_github_golang_protobuf//proto:go_default_library",
"@com_github_google_go_cmp//cmp:go_default_library",
Expand Down
183 changes: 0 additions & 183 deletions examples/internal/integration/fieldmask_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions examples/internal/proto/examplepb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ proto_library(
go_proto_library(
name = "examplepb_go_proto",
compilers = [
"@io_bazel_rules_go//proto:go_grpc",
"//protoc-gen-grpc-gateway:go_gen_grpc_gateway", # keep
"@io_bazel_rules_go//proto:go_grpc",
],
importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb",
proto = ":examplepb_proto",
Expand All @@ -80,7 +80,6 @@ go_library(
deps = [
"//internal/utilities:go_default_library",
"//runtime:go_default_library",
"@com_github_golang_protobuf//descriptor:go_default_library_gen",
"@com_github_golang_protobuf//proto:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions examples/internal/proto/examplepb/echo_service.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions examples/internal/proto/examplepb/flow_combination.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions examples/internal/proto/examplepb/non_standard_names.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c950d28

Please sign in to comment.