[v25.2.x] CORE-15421: add protovalidate as well-known type#29418
Merged
michael-redpanda merged 1 commit intov25.2.xfrom Jan 27, 2026
Merged
[v25.2.x] CORE-15421: add protovalidate as well-known type#29418michael-redpanda merged 1 commit intov25.2.xfrom
michael-redpanda merged 1 commit intov25.2.xfrom
Conversation
Add buf/validate/validate.proto as a well-known type in schema registry so that schemas importing protovalidate validation rules can be registered without explicitly providing references. Changes: - Add protovalidate bazel dependency (version 1.0.0) - Add validate_proto_cc to schema_registry:core implementation_deps - Include buf/validate/validate.pb.h and add to known_types set - Add unit test coverage in test_protobuf_well_known - Add integration test in schema_registry_test.py Signed-off-by: Michael Boquard <michael@redpanda.com> (cherry picked from commit 4cbe872)
Contributor
Author
|
Merge conflict on |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR backports support for the protovalidate library as a well-known type in Redpanda's schema registry. Protovalidate provides validation rules for Protocol Buffer messages through the buf/validate package.
Changes:
- Added protovalidate as a Bazel dependency
- Updated the schema registry to recognize buf/validate types as well-known
- Extended test coverage to validate protovalidate type registration and retrieval
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| MODULE.bazel | Adds protovalidate v1.0.0 as a Bazel dependency |
| src/v/pandaproxy/schema_registry/BUILD | Includes protovalidate proto CC library in build dependencies |
| src/v/pandaproxy/schema_registry/protobuf.cc | Registers buf/validate types in the known_types_set |
| src/v/pandaproxy/schema_registry/test/compatibility_protobuf.cc | Adds buf/validate types to the well-known types compatibility test |
| tests/rptest/tests/schema_registry_test.py | Adds test case validating protovalidate schema registration and retrieval |
| google::protobuf::Timestamp::GetDescriptor()->file(), | ||
| google::protobuf::FieldDescriptorProto::GetDescriptor()->file()}; | ||
| google::protobuf::FieldDescriptorProto::GetDescriptor()->file(), | ||
| buf::validate::Rule::GetDescriptor()->file(), |
There was a problem hiding this comment.
Using Rule as the representative descriptor for the buf/validate package is ambiguous since the package contains multiple top-level types (FieldRules, StringRules, MessageRules, etc.). Consider using a more representative type like FieldRules or explicitly documenting why Rule was chosen.
Suggested change
| buf::validate::Rule::GetDescriptor()->file(), | |
| buf::validate::FieldRules::GetDescriptor()->file(), |
IoannisRP
approved these changes
Jan 27, 2026
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
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.
Backport of PR #29404