Skip to content

feat: add DISABLE_PROTO_VALIDATE config#70

Merged
ankurs merged 2 commits intomainfrom
feat/protovalidate-config
Apr 6, 2026
Merged

feat: add DISABLE_PROTO_VALIDATE config#70
ankurs merged 2 commits intomainfrom
feat/protovalidate-config

Conversation

@ankurs
Copy link
Copy Markdown
Member

@ankurs ankurs commented Apr 6, 2026

Summary

  • Add DisableProtoValidate config field (DISABLE_PROTO_VALIDATE env var, default: false)
  • Wire to interceptors.SetDisableProtoValidate() during processConfig

Depends on: go-coldbrew/interceptors#35

Test plan

  • go test -race ./... passes (with local replace directive)
  • Config field registered with envconfig

Summary by CodeRabbit

Release Notes

  • New Features

    • Added DISABLE_PROTO_VALIDATE configuration option to disable protocol buffer validation in the interceptor chain.
    • Added workers package with background lifecycle management, panic recovery, and restart capabilities.
  • Chores

    • Updated dependencies to support new functionality.

- Add DisableProtoValidate bool field to config (default: false)
- Call interceptors.SetDisableProtoValidate() during processConfig
- go.mod has replace directive removed — depends on interceptors#35
  being merged first
Copilot AI review requested due to automatic review settings April 6, 2026 03:08
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e9426a4e-1b0e-444e-b737-d3f6d39d3035

📥 Commits

Reviewing files that changed from the base of the PR and between 92a10cc and e6f1e32.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (6)
  • Makefile
  • README.md
  • config/README.md
  • config/config.go
  • core.go
  • go.mod

📝 Walkthrough

Walkthrough

This change introduces a new configuration option DisableProtoValidate that allows users to disable the protovalidate interceptor in the default gRPC interceptor chain. The implementation spans configuration definitions, core initialization logic, dependency updates, and documentation additions to reflect the workers package and new setting.

Changes

Cohort / File(s) Summary
Configuration & Core Logic
config/config.go, core.go
Added new DisableProtoValidate boolean field to Config struct with environment variable binding; integrated conditional logic in processConfig() to call interceptors.SetDisableProtoValidate() when enabled.
Documentation
README.md, config/README.md
Added workers package entry to Packages table; updated API reference anchors in core.go; documented new DisableProtoValidate field in config README.
Build & Dependencies
Makefile, go.mod
Modified doc target to use explicit output template and limited package scope (. and ./config); upgraded github.com/go-coldbrew/interceptors to v0.1.20 and added new protovalidate-related indirect dependencies.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A toggle for validation's call,
The proto rules now bend to thrall,
When disabled with a simple flag,
No strict enforcement shall we drag,
Workers march and interceptors flow—
Configuration steals the show! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/protovalidate-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Adds a new runtime configuration flag to optionally disable proto validation (protovalidate) in the default gRPC interceptor chain, wiring it through core startup config processing.

Changes:

  • Add DisableProtoValidate to config.Config with env var DISABLE_PROTO_VALIDATE (default false).
  • Wire the flag into startup via interceptors.SetDisableProtoValidate(true) in processConfig.
  • Update Go module metadata (go.mod/go.sum) with new transitive dependencies (protovalidate/CEL-related).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
config/config.go Introduces the new config field and envconfig tag for DISABLE_PROTO_VALIDATE.
core.go Applies the new config flag to the interceptors package during config processing.
go.mod Adds new indirect dependencies (protovalidate/CEL-related).
go.sum Updates module checksums; notably drops interceptors checksums.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core.go
Comment thread go.mod
Comment thread core.go
Comment on lines +139 to +141
if c.config.DisableProtoValidate {
interceptors.SetDisableProtoValidate(true)
}
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

The new DisableProtoValidate branch in processConfig is currently uncovered by tests. There are already non-parallel branch-coverage tests for processConfig in core_coverage_test.go; adding a small test that sets DisableProtoValidate=true and calls processConfig() would prevent regressions (especially given interceptors configuration is global state).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will add a test case in the follow-up commit.

Comment thread config/config.go
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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go.mod
Comment on lines 33 to +38
require (
4d63.com/gocheckcompilerdirectives v1.3.0 // indirect
4d63.com/gochecknoglobals v0.2.2 // indirect
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260209202127-80ab13bee0bf.1 // indirect
buf.build/go/protovalidate v1.1.3 // indirect
cel.dev/expr v0.25.1 // indirect
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

go.mod still requires github.com/go-coldbrew/interceptors v0.1.19, but this PR adds protovalidate/CEL-related indirect dependencies that appear to come from a newer interceptors version (per PR description dependency on interceptors#35). Bump interceptors to a version that includes the new protovalidate toggle API, then re-run go mod tidy so indirect requirements reflect the actual dependency graph.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Expected — interceptors version will be bumped after interceptors#35 is merged and tagged. The indirect deps were pulled in during local testing with a replace directive (now removed).

… doc

- Bump interceptors to v0.1.20 (protovalidate support)
- Add DisableProtoValidate config field
- Wire to interceptors.SetDisableProtoValidate in processConfig
- Fix make doc: use explicit package list instead of ./... to skip
  benchmarks dir (separate Go module with only test files)
@ankurs ankurs merged commit f01ff86 into main Apr 6, 2026
6 of 7 checks passed
@ankurs ankurs deleted the feat/protovalidate-config branch April 6, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants