From f425ce6826a1b8d60fc4352be7a1f93f1cfa5722 Mon Sep 17 00:00:00 2001 From: maleo Date: Tue, 28 Nov 2023 16:52:45 +0000 Subject: [PATCH] Remove unmaintained validators --- .bazelci/presubmit.yml | 2 -- go/dependencies.rst | 5 ----- go/private/repositories.bzl | 16 ---------------- proto/BUILD.bazel | 12 ------------ proto/core.rst | 4 ---- tests/legacy/examples/proto/embed/BUILD.bazel | 1 - tests/legacy/examples/proto/proto_test.go | 6 ------ 7 files changed, 46 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index cd0a918e8b..687314af3a 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -125,7 +125,6 @@ tasks: - "-@io_bazel_rules_go//proto:go_grpc" - "-@io_bazel_rules_go//proto:go_proto" - "-@io_bazel_rules_go//proto:go_proto_bootstrap" - - "-@io_bazel_rules_go//proto:go_proto_validate" - "-@org_golang_x_crypto//ed25519:ed25519_test" - "-@org_golang_x_crypto//sha3:sha3_test" - "-@org_golang_x_sys//windows/registry:registry_test" @@ -149,7 +148,6 @@ tasks: - "-//proto:go_grpc" - "-//proto:go_proto" - "-//proto:go_proto_bootstrap" - - "-//proto:go_proto_validate" - "-//proto:gostring_grpc" - "-//proto:gostring_proto" - "-//proto/wkt:any_go_proto" diff --git a/go/dependencies.rst b/go/dependencies.rst index adaa39f9aa..efe2414ff8 100644 --- a/go/dependencies.rst +++ b/go/dependencies.rst @@ -90,11 +90,6 @@ It also declares some internal repositories not described here. | This is needed to support both pre-generated and dynamically generated | | proto libraries. | +-------------------------------------------------+-------------------------------------------+ -| :value:`com_github_mwitkow_go_proto_validators` | `github.com/mwitkow/go-proto-validators`_ | -+-------------------------------------------------+-------------------------------------------+ -| Legacy definition for proto plugin. Ideally ``go_rules_dependencies`` should | -| not provide this. | -+-------------------------------------------------+-------------------------------------------+ | :value:`com_github_gogo_protobuf` | `github.com/gogo/protobuf`_ | +-------------------------------------------------+-------------------------------------------+ | Legacy definition for proto plugins. Ideally ``go_rules_dependencies`` should | diff --git a/go/private/repositories.bzl b/go/private/repositories.bzl index a72465ae25..e52b882a18 100644 --- a/go/private/repositories.bzl +++ b/go/private/repositories.bzl @@ -196,22 +196,6 @@ def go_rules_dependencies(force = False): patch_args = ["-p1"], ) - # Extra protoc plugins and libraries. - # Doesn't belong here, but low maintenance. - # releaser:upgrade-dep mwitkow go-proto-validators - wrapper( - http_archive, - name = "com_github_mwitkow_go_proto_validators", - # v0.3.2, latest as of 2023-11-16 - urls = [ - "https://mirror.bazel.build/github.com/mwitkow/go-proto-validators/archive/refs/tags/v0.3.2.zip", - "https://github.com/mwitkow/go-proto-validators/archive/refs/tags/v0.3.2.zip", - ], - sha256 = "d8697f05a2f0eaeb65261b480e1e6035301892d9fc07ed945622f41b12a68142", - strip_prefix = "go-proto-validators-0.3.2", - # Bazel support added in v0.3.0, so no patches needed. - ) - # releaser:upgrade-dep gogo protobuf wrapper( http_archive, diff --git a/proto/BUILD.bazel b/proto/BUILD.bazel index 2125a938a0..908fa41841 100644 --- a/proto/BUILD.bazel +++ b/proto/BUILD.bazel @@ -39,18 +39,6 @@ go_proto_compiler( ], ) -go_proto_compiler( - name = "go_proto_validate", - plugin = "@com_github_mwitkow_go_proto_validators//protoc-gen-govalidators", - suffix = ".validator.pb.go", - valid_archive = False, - visibility = ["//visibility:public"], - deps = [ - "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_mwitkow_go_proto_validators//:validators_golang", - ], -) - GOGO_VARIANTS = [ "combo", "gogo", diff --git a/proto/core.rst b/proto/core.rst index 9c76572971..dc04ea3428 100644 --- a/proto/core.rst +++ b/proto/core.rst @@ -427,8 +427,6 @@ Several ``go_proto_compiler`` rules are predefined in * ``go_proto``: default plugin from github.com/golang/protobuf. * ``go_grpc``: default gRPC plugin. -* ``go_proto_validate``: validator plugin from - github.com/mwitkow/go-proto-validators. Generates ``Validate`` methods. * gogoprotobuf_ plugins for the variants ``combo``, ``gofast``, ``gogo``, ``gogofast``, ``gogofaster``, ``gogoslick``, ``gogotypes``, ``gostring``. For each variant, there is a regular version (e.g., ``gogo_proto``) and a @@ -488,8 +486,6 @@ will only be downloaded if proto rules are used. general proto support. * ``@com_github_golang_protobuf (github.com/golang/protobuf)``: standard Go proto plugin. -* ``@com_github_mwitkow_go_proto_validators - (github.com/mwitkow/go-proto-validators)``: validator plugin. * ``@com_github_gogo_protobuf (github.com/gogo/protobuf)``: gogoprotobuf plugins. * ``@org_golang_google_grpc (github.com/grpc/grpc-go``: gRPC support. diff --git a/tests/legacy/examples/proto/embed/BUILD.bazel b/tests/legacy/examples/proto/embed/BUILD.bazel index c273fa540d..6e7999421a 100644 --- a/tests/legacy/examples/proto/embed/BUILD.bazel +++ b/tests/legacy/examples/proto/embed/BUILD.bazel @@ -12,7 +12,6 @@ go_proto_library( name = "embed_go_proto", compilers = [ "@io_bazel_rules_go//proto:go_proto", - "@io_bazel_rules_go//proto:go_proto_validate", ], # Note that if you forget the importpath everything will break horribly. importpath = "github.com/bazelbuild/rules_go/examples/proto/embed", diff --git a/tests/legacy/examples/proto/proto_test.go b/tests/legacy/examples/proto/proto_test.go index 68ba8348c4..7848159d65 100644 --- a/tests/legacy/examples/proto/proto_test.go +++ b/tests/legacy/examples/proto/proto_test.go @@ -35,9 +35,3 @@ func TestEmbed(t *testing.T) { t.Errorf("Unable to call method from embedded go files") } } - -func TestValidate(t *testing.T) { - if err := embed.OtherThing().Validate(); err != nil { - t.Errorf("Proto did not pass validation") - } -}