Skip to content

chore: use protovalidate interceptor instead of protoc-gen-validate interceptor#2863

Merged
tstirrat15 merged 1 commit intomainfrom
use-protovalidate-interceptor
Mar 3, 2026
Merged

chore: use protovalidate interceptor instead of protoc-gen-validate interceptor#2863
tstirrat15 merged 1 commit intomainfrom
use-protovalidate-interceptor

Conversation

@tstirrat15
Copy link
Contributor

Description

Development on protoc-gen-validate has basically stopped in favor of protovalidate. It's intended to be a more consistent and flexible validation framework.

This does mean that it will be slightly slower, but not slower enough to be meaningful: https://bufbuild.slack.com/archives/CRZ680FUH/p1760037391133719?thread_ts=1759933966.935909&cid=CRZ680FUH

Changes

  • Use protovalidate middleware

Testing

Review. See that validation still happens as expected.

@tstirrat15 tstirrat15 requested a review from a team as a code owner January 29, 2026 17:05
@tstirrat15 tstirrat15 marked this pull request as draft January 29, 2026 17:05
@github-actions github-actions bot added area/api v1 Affects the v1 API area/dependencies Affects dependencies labels Jan 29, 2026
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.92%. Comparing base (15ae719) to head (5cffb98).

Files with missing lines Patch % Lines
pkg/genutil/protovalidate.go 50.00% 2 Missing and 1 partial ⚠️

❌ Your project check has failed because the head coverage (32.92%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (15ae719) and HEAD (5cffb98). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (15ae719) HEAD (5cffb98)
24 20
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2863       +/-   ##
===========================================
- Coverage   74.51%   32.92%   -41.59%     
===========================================
  Files         489      423       -66     
  Lines       60361    54306     -6055     
===========================================
- Hits        44973    17875    -27098     
- Misses      12235    34598    +22363     
+ Partials     3153     1833     -1320     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tstirrat15 tstirrat15 force-pushed the use-protovalidate-interceptor branch 2 times, most recently from e0dba55 to 3f09a6e Compare January 29, 2026 17:50
@github-actions github-actions bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Jan 29, 2026
@tstirrat15 tstirrat15 force-pushed the use-protovalidate-interceptor branch from 3f09a6e to 3c6ea4b Compare February 4, 2026 15:37
@tstirrat15 tstirrat15 force-pushed the use-protovalidate-interceptor branch 2 times, most recently from 1106050 to 06b999e Compare March 3, 2026 15:32
@tstirrat15 tstirrat15 marked this pull request as ready for review March 3, 2026 15:32
@tstirrat15 tstirrat15 force-pushed the use-protovalidate-interceptor branch 3 times, most recently from 2df9a6c to 155af98 Compare March 3, 2026 17:52
WithServiceSpecificInterceptors: shared.WithServiceSpecificInterceptors{
Unary: middleware.ChainUnaryServer(
grpcvalidate.UnaryServerInterceptor(),
grpcvalidate.UnaryServerInterceptor(validator),
Copy link
Contributor

@miparnisari miparnisari Mar 3, 2026

Choose a reason for hiding this comment

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

please run a couple of manual tests to ensure that the validation still works as expected (docker-compose up --build for example). Try both HTTP and gRPC endpoints

i'm also wary of the handwrittenvalidation below. i don't know what it does but i'd want to make sure we didn't accidentally break it

@tstirrat15 tstirrat15 force-pushed the use-protovalidate-interceptor branch from 155af98 to 14881db Compare March 3, 2026 18:54
@tstirrat15 tstirrat15 force-pushed the use-protovalidate-interceptor branch from 14881db to 5cffb98 Compare March 3, 2026 20:23
@tstirrat15 tstirrat15 enabled auto-merge (squash) March 3, 2026 20:49
@tstirrat15 tstirrat15 merged commit 2166493 into main Mar 3, 2026
75 of 78 checks passed
@tstirrat15 tstirrat15 deleted the use-protovalidate-interceptor branch March 3, 2026 20:57
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/api v1 Affects the v1 API area/dependencies Affects dependencies area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) Skip-Changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants