-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR exports the `lib` type (now `Lib`) so that the Buf CLI can call ``` cel.NewEnv( cel.Lib(celext.Lib{ useUTC: useUTC, }), ) ``` without having to include the `cel.TypeDescs(protoregistry.GlobalFiles)` option (which `celext.DefaultEnv` always include). The Buf CLI does not want this option, here's an example to illustrate this: If I am working on `registry-proto` and I'm adding a field to `buf.registry.module.v1.Module`, call it `foo` string, and I am also adding a CEL rule on the message level, `this.foo != ''`. Now I run `buf lint` and the CLI fails to compile this expression: The linter tries to compile the expression in an env with `cel.TypeDescs(protoregistry.GlobalFiles)`. Among these type descriptors there already is a `buf.registry.module.v1.Module`, but this comes from the generated Go type that the CLI depend on, not the `registry-proto` I'm working on.
- Loading branch information
1 parent
365d730
commit f204e44
Showing
2 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters