Skip to content

cel: add raw string expression support#118

Merged
adisuissa merged 2 commits into
cncf:mainfrom
wbpcode:dev-cel-string
Mar 26, 2025
Merged

cel: add raw string expression support#118
adisuissa merged 2 commits into
cncf:mainfrom
wbpcode:dev-cel-string

Conversation

@wbpcode

@wbpcode wbpcode commented Mar 26, 2025

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: wangbaiping(wbpcode) <[email protected]>
Comment thread xds/type/v3/cel.proto

// Unparsed expression in string form.
//
// If set, takes precedence over ``cel_expr_parsed`` and ``cel_expr_checked``.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please add a description or link to what is a valid string value that is expected here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

An example and the spec link is added.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks!
I'm going to approve this for now, but it's not clear to me where is "request.headers" defined? Is there a "response.body"?
I would assume this is all written somewhere (doc), and there should be a link here to that doc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Most CEL attributes are host-dependent. That's say, the example requires the host to support request.headers attributes. And you can see all attributes supported by envoy at here: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/attributes

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So I guess that's the link that could've been added here, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No sure because xds repo is also be used by other projects. So, I only put an example and spec link here.

Signed-off-by: wangbaiping(wbpcode) <[email protected]>
Comment thread xds/type/v3/cel.proto

// Unparsed expression in string form.
//
// If set, takes precedence over ``cel_expr_parsed`` and ``cel_expr_checked``.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks!
I'm going to approve this for now, but it's not clear to me where is "request.headers" defined? Is there a "response.body"?
I would assume this is all written somewhere (doc), and there should be a link here to that doc.

@adisuissa
adisuissa merged commit ae57f3c into cncf:main Mar 26, 2025
@markdroth

Copy link
Copy Markdown
Contributor

What's the motivation for this?

In general, I don't think we want to support sending raw CEL expressions to the data plane. It makes more sense for the control plane to pre-compile the expression before sending it to the data plane, for both performance and validation reasons.

Also, note that gRPC C++ will basically never be able to support this, because CEL C++ depends on protobuf, and gRPC can't take a dependency on protobuf internally.

@adisuissa

Copy link
Copy Markdown

What's the motivation for this?

Here's the context:
#115 (comment)

In general, I don't think we want to support sending raw CEL expressions to the data plane. It makes more sense for the control plane to pre-compile the expression before sending it to the data plane, for both performance and validation reasons.

I think this should be called out in the field's comments, highlighting the benefits of using the other fields.

@wbpcode
wbpcode deleted the dev-cel-string branch March 27, 2025 01:31
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