-
Notifications
You must be signed in to change notification settings - Fork 250
Protobuf API v2 support #399
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bc459f2
Conversion nearly complete minus map / list support, conformance serv…
TristonianJones e00d4c0
Refactor of the type provider value adaptation code and support for p…
TristonianJones 5e15445
All but on test passing related to the null handling of wrapper values
TristonianJones 61f6d2f
All tests passing, with support for dynamicpb.Message values in addit…
TristonianJones 59d2a82
Minor adjustments to fix a performance regression
TristonianJones e9bcd2b
Refactor the protobuf type unwrapping to happen within the pb package…
TristonianJones a66e22b
Fix imports
TristonianJones 473f45e
Additional coverage for the IsSet, GetFrom, and MaybeUnwrap methods
TristonianJones 4b8d624
General improvements in code tidyness
TristonianJones 61ba196
Passing conformance tests updated to latest CEL-Spec
TristonianJones d759464
Ensure deps are the same between go mod and Bazel
TristonianJones 0492f89
Additional tests and comments
TristonianJones fb2dbae
Updates based on review feedback
TristonianJones 6e9364b
Move recursive unwrapping into pb/type.go
TristonianJones 8d33dae
Support recursive type unwrapping for dynamic messages
TristonianJones 7839053
Updates based on review feedback
TristonianJones File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,117 +1,131 @@ | ||
| workspace(name = "cel_go") | ||
|
|
||
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
| load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository") | ||
|
|
||
| http_archive( | ||
| name = "io_bazel_rules_go", | ||
| urls = ["https://github.com/bazelbuild/rules_go/releases/download/0.18.6/rules_go-0.18.6.tar.gz"], | ||
| sha256 = "f04d2373bcaf8aa09bccb08a98a57e721306c8f6043a2a0ee610fd6853dcde3d" | ||
| sha256 = "207fad3e6689135c5d8713e5a17ba9d1290238f47b9ba545b63d9303406209c6", | ||
| urls = [ | ||
| "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.7/rules_go-v0.24.7.tar.gz", | ||
| "https://github.com/bazelbuild/rules_go/releases/download/v0.24.7/rules_go-v0.24.7.tar.gz", | ||
| ], | ||
| ) | ||
|
|
||
| http_archive( | ||
| name = "bazel_gazelle", | ||
| urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.17.0/bazel-gazelle-0.17.0.tar.gz"], | ||
| sha256 = "3c681998538231a2d24d0c07ed5a7658cb72bfb5fd4bf9911157c0e9ac6a2687", | ||
| sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c", | ||
| urls = [ | ||
| "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz", | ||
| "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.2/bazel-gazelle-v0.22.2.tar.gz", | ||
| ], | ||
| ) | ||
|
|
||
| load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") | ||
| load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") | ||
| load("@bazel_gazelle//:deps.bzl", "go_repository") | ||
|
|
||
| # Do *not* call *_dependencies(), etc, yet. See comment at the end. | ||
|
|
||
| go_repository( | ||
| name = "org_golang_google_genproto", | ||
| build_file_proto_mode = "disable", | ||
| commit = "bd91e49a0898e27abb88c339b432fa53d7497ac0", | ||
| importpath = "google.golang.org/genproto", | ||
| # Latest version as of 10/27/2020 | ||
| http_archive( | ||
| name = "rules_proto", | ||
| sha256 = "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da", | ||
| strip_prefix = "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488", | ||
| urls = [ | ||
| "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", | ||
| "https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", | ||
| ], | ||
| ) | ||
|
|
||
| go_repository( | ||
| name = "com_github_antlr", | ||
| commit = "621b933c7a7f01c67ae9de15103151fa0f9d6d90", | ||
| importpath = "github.com/antlr/antlr4", | ||
| # Latest version of googleapis as of 7/27/2020 | ||
| http_archive( | ||
| name = "com_google_googleapis", | ||
| sha256 = "1f742f6cafe616fe73302db010e0b7ee6579cb1ce06010427b7d0995cbd80ce4", | ||
| strip_prefix = "googleapis-6a813acf535e4746fa4a135ce23547bb6425c26d", | ||
| urls = [ | ||
| "https://github.com/googleapis/googleapis/archive/6a813acf535e4746fa4a135ce23547bb6425c26d.tar.gz", | ||
| ] | ||
| ) | ||
|
|
||
| git_repository( | ||
| name = "com_google_cel_spec", | ||
| commit = "a5c6815d863aa677ede77054a41fb5bd0f410194", # PR #151 | ||
| remote = "https://github.com/google/cel-spec.git", | ||
| # protobuf | ||
| http_archive( | ||
| name = "com_google_protobuf", | ||
| sha256 = "1c744a6a1f2c901e68c5521bc275e22bdc66256eeb605c2781923365b7087e5f", | ||
| strip_prefix = "protobuf-3.13.0", | ||
| urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.13.0.zip"], | ||
| ) | ||
|
|
||
| # Required to use embedded BUILD.bazel file in googleapis/google/rpc | ||
| git_repository( | ||
| name = "io_grpc_grpc_java", | ||
| remote = "https://github.com/grpc/grpc-java.git", | ||
| tag = "v1.22.1", | ||
| load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") | ||
| load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") | ||
| load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") | ||
| load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") | ||
| load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") | ||
|
|
||
| switched_rules_by_language( | ||
| name = "com_google_googleapis_imports", | ||
| go = True, | ||
| ) | ||
|
|
||
| new_git_repository( | ||
| name = "com_google_googleapis", | ||
| remote = "https://github.com/googleapis/googleapis.git", | ||
| commit = "980cdfa876e54b1db4395617e14037612af25466", | ||
| build_file_content = """ | ||
| load('@io_bazel_rules_go//proto:def.bzl', 'go_proto_library') | ||
|
|
||
| cc_proto_library( | ||
| name = 'cc_rpc_status', | ||
| deps = ['//google/rpc:status_proto'], | ||
| visibility = ['//visibility:public'], | ||
| # Do *not* call *_dependencies(), etc, yet. See comment at the end. | ||
|
|
||
| go_repository( | ||
| name = "org_golang_google_protobuf", | ||
| build_file_proto_mode = "disable_global", | ||
| importpath = "google.golang.org/protobuf", | ||
| tag = "v1.25.0", | ||
| ) | ||
|
|
||
| cc_proto_library( | ||
| name = 'cc_rpc_code', | ||
| deps = ['//google/rpc:code_proto'], | ||
| visibility = ['//visibility:public'], | ||
| # Generated Google APIs protos for Golang 11/16/2020 | ||
| go_repository( | ||
| name = "org_golang_google_genproto", | ||
| build_file_proto_mode = "disable_global", | ||
| commit = "62d171c70ae133bd47722027b62f8820407cf744", | ||
| importpath = "google.golang.org/genproto", | ||
| ) | ||
|
|
||
| cc_proto_library( | ||
| name = 'cc_expr_v1beta1', | ||
| deps = [ | ||
| '//google/api/expr/v1beta1/eval_proto', | ||
| '//google/api/expr/v1beta1/value_proto', | ||
| ], | ||
| visibility = ['//visibility:public'], | ||
| # gRPC deps for v1.33.2 (including x/text and x/net) | ||
| go_repository( | ||
| name = "org_golang_google_grpc", | ||
| build_file_proto_mode = "disable_global", | ||
| importpath = "google.golang.org/grpc", | ||
| tag = "v1.33.2", | ||
| ) | ||
|
|
||
| go_proto_library( | ||
| name = 'rpc_status_go_proto', | ||
| # TODO: Switch to the correct import path when bazel rules fixed. | ||
| #importpath = 'google.golang.org/genproto/googleapis/rpc/status', | ||
| importpath = 'github.com/googleapis/googleapis/google/rpc', | ||
| proto = '//google/rpc:status_proto', | ||
| visibility = ['//visibility:public'], | ||
| go_repository( | ||
| name = "org_golang_x_net", | ||
| importpath = "golang.org/x/net", | ||
| sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=", | ||
| version = "v0.0.0-20190311183353-d8887717615a", | ||
| ) | ||
|
|
||
| go_proto_library( | ||
| name = 'expr_v1beta1_go_proto', | ||
| importpath = 'google.golang.org/genproto/googleapis/api/expr/v1beta1', | ||
| proto = '//google/api/expr/v1beta1', | ||
| visibility = ['//visibility:public'], | ||
| deps = ['@com_google_googleapis//:rpc_status_go_proto'], | ||
| go_repository( | ||
| name = "org_golang_x_text", | ||
| importpath = "golang.org/x/text", | ||
| sum = "h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=", | ||
| version = "v0.3.2", | ||
| ) | ||
| """ | ||
|
|
||
| # Antlr deps to pickup golang concurrency fixes 4/30/2020 | ||
| go_repository( | ||
| name = "com_github_antlr", | ||
| commit = "621b933c7a7f01c67ae9de15103151fa0f9d6d90", | ||
| importpath = "github.com/antlr/antlr4", | ||
| ) | ||
|
|
||
| # CEL Spec deps | ||
| go_repository( | ||
| name = "org_golang_google_grpc", | ||
| importpath = "google.golang.org/grpc", | ||
| tag = "v1.11.3", | ||
| remote = "https://github.com/grpc/grpc-go.git", | ||
| vcs = "git", | ||
| name = "com_google_cel_spec", | ||
| commit = "1b5a71c00310535ae98f892ff187d976e46ff37e", | ||
| importpath = "github.com/google/cel-spec", | ||
| ) | ||
|
|
||
| # strcase deps | ||
| go_repository( | ||
| name = "org_golang_x_text", | ||
| importpath = "golang.org/x/text", | ||
| tag = "v0.3.0", | ||
| remote = "https://github.com/golang/text", | ||
| vcs = "git", | ||
| name = "com_github_stoewer_go_strcase", | ||
| importpath = "github.com/stoewer/go-strcase", | ||
| sum = "h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=", | ||
| version = "v1.2.0", | ||
| ) | ||
|
|
||
| # Run the dependencies at the end. These will silently try to import some | ||
| # of the above repositories but at different versions, so ours must come first. | ||
| go_rules_dependencies() | ||
| go_register_toolchains() | ||
| gazelle_dependencies() | ||
| rules_proto_dependencies() | ||
| rules_proto_toolchains() | ||
| protobuf_deps() | ||
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.