Skip to content

[v25.2.x] CORE-15421: add protovalidate as well-known type#29418

Merged
michael-redpanda merged 1 commit intov25.2.xfrom
manual-backport-29404-v25.2.x-851
Jan 27, 2026
Merged

[v25.2.x] CORE-15421: add protovalidate as well-known type#29418
michael-redpanda merged 1 commit intov25.2.xfrom
manual-backport-29404-v25.2.x-851

Conversation

@michael-redpanda
Copy link
Copy Markdown
Contributor

Backport of PR #29404

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)
@michael-redpanda michael-redpanda added this to the v25.2.x-next milestone Jan 27, 2026
@michael-redpanda michael-redpanda added the kind/backport PRs targeting a stable branch label Jan 27, 2026
@michael-redpanda michael-redpanda marked this pull request as ready for review January 27, 2026 12:49
@michael-redpanda
Copy link
Copy Markdown
Contributor Author

Merge conflict on MODULE.bazel.lock

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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(),
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

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(),

Copilot uses AI. Check for mistakes.
@michael-redpanda michael-redpanda merged commit 55b75a3 into v25.2.x Jan 27, 2026
20 checks passed
@michael-redpanda michael-redpanda deleted the manual-backport-29404-v25.2.x-851 branch January 27, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build area/redpanda kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v25.2.x] CORE-15421: add protovalidate as well-known type

3 participants