Skip to content

Conversation

@srikrsna-buf
Copy link
Member

No description provided.

Signed-off-by: Sri Krishna <[email protected]>
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

The latest Buf updates on your PR. Results from workflow Buf / validate-protos (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed⏩ skippedDec 9, 2025, 6:16 PM

@srikrsna-buf srikrsna-buf changed the title Support cel_expression Update protovalidate Dec 4, 2025
@srikrsna-buf srikrsna-buf requested a review from hudlow December 9, 2025 18:04
@srikrsna-buf srikrsna-buf marked this pull request as ready for review December 9, 2025 18:04
Signed-off-by: Sri Krishna <[email protected]>
Comment on lines -126 to -132
out[i].Env, err = out[i].Env.Extend(
cel.Constant(
"rule",
pvcel.ProtoFieldToType(ruleDescriptor, true, false),
pvcel.ProtoFieldToValue(ruleDescriptor, ruleValue, false),
),
)
Copy link
Member Author

@srikrsna-buf srikrsna-buf Dec 9, 2025

Choose a reason for hiding this comment

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

This never worked for message fields. The ProtoFieldToValue is using the default adapter of cel-go that doesn't handle protobuf messages except for wrappers. This always returned an error value.

Because we try to reduce the AST ahead of time and the rule variable was always being optimized away, we never hit a problem.

Signed-off-by: Sri Krishna <[email protected]>
@srikrsna-buf srikrsna-buf merged commit 05e4c36 into main Dec 9, 2025
7 checks passed
@srikrsna-buf srikrsna-buf deleted the cel-expression branch December 9, 2025 18:18
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.

3 participants