Skip to content

CORE-15421: add protovalidate as well-known type#29404

Merged
michael-redpanda merged 1 commit intodevfrom
sr/core-15421-protovalidate
Jan 27, 2026
Merged

CORE-15421: add protovalidate as well-known type#29404
michael-redpanda merged 1 commit intodevfrom
sr/core-15421-protovalidate

Conversation

@michael-redpanda
Copy link
Copy Markdown
Contributor

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

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v25.3.x
  • v25.2.x
  • v25.1.x

Release Notes

Improvements

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>
@michael-redpanda michael-redpanda self-assigned this Jan 26, 2026
Copilot AI review requested due to automatic review settings January 26, 2026 20:01
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 adds native support for buf's protovalidate library to Redpanda's Schema Registry by treating it as a well-known type. This enables schemas that import protovalidate validation rules to be registered without explicitly providing references.

Changes:

  • Adds protovalidate as a Bazel dependency and includes it in the schema registry's known types
  • Updates unit and integration tests to verify protovalidate types can be used without explicit references
  • Adds comprehensive coverage of protovalidate message types in the well-known types test

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
MODULE.bazel Adds protovalidate v1.0.0 as a Bazel dependency
src/v/pandaproxy/schema_registry/BUILD Links protovalidate's validate_proto_cc library to schema_registry core
src/v/pandaproxy/schema_registry/protobuf.cc Includes validate.pb.h header and registers protovalidate file descriptor as a known type
src/v/pandaproxy/schema_registry/test/compatibility_protobuf.cc Extends well-known types test to include 9 protovalidate message types
tests/rptest/tests/schema_registry_test.py Adds integration test verifying protovalidate imports work without explicit references

@michael-redpanda
Copy link
Copy Markdown
Contributor Author

@rockwotj - added you to just cross check me on the bazel stuff I did... it appears to work so I don't think I did anything wrong, but wouldn't mind you just double checking the bazel stuff.... graci!

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

Retry command for Build#79643

please wait until all jobs are finished before running the slash command

/ci-repeat 1
skip-redpanda-build
skip-units
skip-rebase
tests/rptest/tests/write_caching_fi_e2e_test.py::WriteCachingFailureInjectionE2ETest.test_crash_all@{"use_transactions":false}

Comment on lines +297 to +303
message TestValidate {
buf.validate.FieldRules field_rules = 1;
buf.validate.StringRules string_rules = 2;
buf.validate.Int32Rules int32_rules = 3;
buf.validate.MessageRules message_rules = 4;
buf.validate.TimestampRules timestamp_rules = 5;
}"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a more realistic test if you use them as annotations like they are supposed to be :)


bazel_dep(name = "rules_shell", version = "0.4.1", dev_dependency = True)

bazel_dep(name = "protovalidate", version = "1.0.0")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is fine, but it's a fairly heavy dependency to only need the protos :)

I think it's fine tho don't bother changing it

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

vbotbuildovich commented Jan 26, 2026

CI test results

test results on build#79643
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
RedpandaNodeOperationsSmokeTest test_node_ops_smoke_test {"cloud_storage_type": 1, "mixed_versions": true} integration https://buildkite.com/redpanda/redpanda/builds/79643#019bfbfe-5809-4f75-a414-816eac5c7419 FLAKY 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0025, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=RedpandaNodeOperationsSmokeTest&test_method=test_node_ops_smoke_test
WriteCachingFailureInjectionE2ETest test_crash_all {"use_transactions": false} integration https://buildkite.com/redpanda/redpanda/builds/79643#019bfc02-aa9b-4446-869e-e49200713bf4 FLAKY 6/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.0897, p0=0.0087, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=WriteCachingFailureInjectionE2ETest&test_method=test_crash_all
test results on build#79654
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
WriteCachingFailureInjectionE2ETest test_crash_all {"use_transactions": false} integration https://buildkite.com/redpanda/redpanda/builds/79654#019bfcd2-85f5-43be-873b-bcbc3b4941eb FLAKY 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0933, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.2546, p1=0.0530, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=WriteCachingFailureInjectionE2ETest&test_method=test_crash_all

@michael-redpanda
Copy link
Copy Markdown
Contributor Author

/ci-repeat 1
skip-redpanda-build
skip-units
skip-rebase
tests/rptest/tests/write_caching_fi_e2e_test.py::WriteCachingFailureInjectionE2ETest.test_crash_all@{"use_transactions":false}

@michael-redpanda michael-redpanda merged commit c509801 into dev Jan 27, 2026
22 checks passed
@michael-redpanda michael-redpanda deleted the sr/core-15421-protovalidate branch January 27, 2026 12:32
@vbotbuildovich
Copy link
Copy Markdown
Collaborator

/backport v25.3.x

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

/backport v25.2.x

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

/backport v25.1.x

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

Failed to create a backport PR to v25.1.x branch. I tried:

git remote add upstream https://github.com/redpanda-data/redpanda.git
git fetch --all
git checkout -b backport-pr-29404-v25.1.x-473 remotes/upstream/v25.1.x
git cherry-pick -x 4cbe872295

Workflow run logs.

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

Failed to create a backport PR to v25.2.x branch. I tried:

git remote add upstream https://github.com/redpanda-data/redpanda.git
git fetch --all
git checkout -b backport-pr-29404-v25.2.x-644 remotes/upstream/v25.2.x
git cherry-pick -x 4cbe872295

Workflow run logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants