Releases: google/cel-java
v0.10.1
This release features the following:
- New Android-Optimized Runtime (Beta): Introducing a lightweight runtime with native support for Protobuf Lite, significantly reducing footprint for Android applications.
- Expanded Extension Libraries: New Regular Expression extension library is now available, alongside enhanced Math extensions including floor, ceil, round, and bitwise operators.
- CEL Unit test runner framework: Allows exercising tests for CEL expressions and policies via Bazel macros.
- YAML Environment Serialization: Support for a bi-directional CEL environment serialization in YAML for improved configuration management.
Breaking Changes
The following PRs change the fully qualified class name for function binding:
Before: dev.cel.runtime.CelRuntime.CelFunctionBinding
After: dev.cel.runtime.CelFunctionBinding
- Rename dev.cel.runtime.CelRuntime.CelFunctionBinding to dev.cel.runtime.CelFunctionBinding in #627
- Remove deprecated dev.cel.runtime.CelRuntime.CelFunctionBinding in #628
Various utility methods for spawning protobuf-based CEL types have been moved out of CelTypes
into CelProtoTypes
or CelProtoMessageTypes
:
- Migrate from CelProtoTypes#createMessage(descriptor) to CelProtoMessageTypes#createMessage(descriptor) in #568
- Remove deprecated CelProtoTypes#createMessage in #573
- Create CelProtoMessageTypes for handling proto based types that require a full protobuf dependency in #567
CelPolicyConfig
and its sibling classes have been removed. These classes are superseded by CelEnvironment
, which are functionally equivalent and provides functionality for environment setup beyond policy use cases.
- Remove deprecated CelPolicyConfig and its parser in #618
Bug Fixes
- Include CEL Policy Compiler in next release's jar #678
- Fix an issue with the error message not including the source location and position during function dispatch in #569
- Fix JSON conversions involving FieldMask and Empty in #644
- Fix a fuzzer issue involving nested comprehensions in #655
- Fixing lastIndexOf incosistent behaviour in #681
- Fix bytes to string conversion to explicitly error on invalid code points in #717
- Fix optional or/orValue to propagate errors and unknowns in #718
- add string(bool) overload by @maorwayn in #728
- Enable updated accumulator variable for CEL-Java parser by default. in #537
What's Changed
Extension libraries
- Implement math extension functions for floor, ceil, etc in #650
- Porting lists.range() to Java Stack in #685
- Adding the CEL regex extensions in #708
- Updating Regex ext to align with Google SQL and Adding Regex documentation in #722
- Aligning replace function in Regex ext with Google SQL in #724
YAML serialization
Lite Runtime (Android)
- Add rules_android to WORKSPACE, add cel_android_library bzl macro in #583
- Bring in android artifacts for guava and protobuf in WORKSPACE in #584
- Implement interfaces for CelLiteRuntime. Add Android runtime tests in #615
- Assert allowed CelOptions during CelLiteRuntime environment construction in #619
- Split ProtoAdapter into ProtoLiteAdapter to adapt lite messages in #636
- Bring in WORKSPACE dependencies for supporting CelLiteDescriptor codegen in #647
- Add interpreter test for protolite messages in #656
- Implement codegen for CelLiteDescriptor in #659
- Add CelLiteDescriptorPool and DefaultLiteDescriptorPool in #664
- Add ProtoMessageLiteValue and ProtoLiteCelValueConverter in #666
- Perform field selections on lite messages by reading from the wire format in #668
- Add ProtoMessageLiteValueProvider in #669
- Rename CelLiteRuntimeTest to CelLiteRuntimeAndroidTest in #671
- Add an interface for accepting CelValueProvider in lite runtime in #672
- Add protolite tests for Android in #673
- Add BaseProtoMessageValueProvider to decouple full/lite protobuf value providers in #674
- Handle unknown fields in messagelite in #683
- Rename CelFieldValueType to EncodingType in #684
- Derive the java class name for CelLiteDescriptor in #687
- Handle dependent protos when generating CelLiteDescriptor in #692
- Add late bound function resolver to lite runtime's program interface in #693
- Expose Late function bindings target for Android. in #698
- Allow resolution of proto messages from dyn-typed functions in lite runtime in #700
- Add
@Generated
annotation to codegened CelLiteDescriptor. Fix package location error prone warning for generated sources within srcjar. in #704 - Separately generate lite descriptors per message in #705
- Decouple CelTypeResolver from full protobuf implementation in #590
- Add DefaultInstanceMessageLiteFactory in #630
- Decouple ProtoCelValueConverter into BaseProtoCelValueConverter in #660
- Partition CEL standard functions per function definition in #707
- Remove extraneous protoTypeName argument from RuntimeTypeProvider interface in #706
- Add an additional messageName argument to MessageProvider interface in #662
- Add toRuntimeBuilder to CelLiteRuntime in #620
Test runner framework
Miscellaneous
- Split CelEvaluationException from runtime build target in #555
- Remove deprecated ExprFeatures in #557
- Allow AsyncProgram to accept an async resolver for an attribute in #711
- Create a builder for CelEvaluationException in #561
- Replace InterpreterExceptions with CelEvaluationException in the runtime path in #564
- Remove InterpreterException in #565
- Update CelUnparser and open up visibility so that inheriting class can use it in #556
- Upgrade to Bazel 8, upgrade protobuf-java to 4.29.3 in #582
- Explicitly set locale for String.format calls in #577
- Enable conformance tests in #596
- Add CelCompilerTool java binary and compile_cel bzl library in #594
- Add empty binder to GlobalResolver in #586
- fixed typo in README.md by @tobiKaboom in #599
- Add capability to accept a CEL environment in CelCompilerTool in #611
- Surface ExprId in CelIssue in #604
- Add test coverage for overlapping overloads and invalid struct creation in #608
- Decouple Activation from full protobuf implementation in #614
- Change default java toolchain and build from 8 to 11. Add separate CI for Java 8 builds in #616
- Augment runtime's toBuilder method to reinstantiate a builder from stored artifacts in #623
- Change WellKnownProto to lookup a descriptor by its type name. Add google.protobuf.Empty and google.protobuf.FieldMask to WKP in #626
- Drop support for java.lang.long uint support in CelValue in #663
- Make UnspecifiedType abstract in #676
- Fork timestamp/duration protobuf u...
v0.9.1
Note
If you encounter any compatibility issues with protobuf-java 4.x, use CEL-Java version 0.9.1-proto3
as a workaround. This is the same version as CEL-Java 0.9.1 with protobuf dependency pinned to 3.25.5.
What's Changed
- Add support for quoted field selectors in java. in #544
- Add CelOptions for designating Regex program size in #550
Miscellaneous
- Retain the original identifier during parse when quoted identifier is disabled in #547
- Create a separate maven artifact for adapting canonical CEL protos (CelProtoAbstractSyntaxTree,
dev.cel:protobuf
maven coordinate) in #551 - Isolate CelAbstractSyntaxTree and CelSource from common build target in #552
Full Changelog: v0.9.0...v0.9.1
v0.9.0
Note
If you encounter any compatibility issues with protobuf-java 4.x, use CEL-Java version 0.9.0-proto3
as a workaround. This is the same version as CEL-Java 0.9.0 with protobuf dependency pinned to 3.25.5.
Breaking Changes
In an effort to make protobuf an optional dependency in CEL-Java, the following PR changes the resolution of type(expr)
from proto based cel.expr type value into native equivalent dev.cel.common.types.CelType:
- Expose CelType as a native representation for runtime type value. in #505
The following PR changes the resolution of unknown values from cel.expr unknown expr value into native equivalent dev.cel.runtime.CelUnknownSet:
- Enable adaptUnknownValueSetToNativeType by default in CelOptions in #490
- Remove adaptUnknownValueSetToNativeType flag from CEL in #496
The following PR removes previously deprecated methods that deal with canonical CEL expr values from CelTypes
and CelAbstractSyntaxTree
classes. The removed methods have been moved to CelProtoAbstractSyntaxTree and CelProtoTypes:
- Create CelProtoTypes utility class to handle CelExpr in proto format in #524
- Remove deprecated methods in CelTypes in #531
- Remove deprecated CelAbstractSyntaxTree#getProtoResultType in #533
What's Changed
- Add CelStandardDeclaration to allow environment subsetting for type-checker in #448
- Add CelStandardFunctions to allow environment subsetting for the runtime in #461
- Introduce late-bound functions into CEL-Java in #494
- Add option to enable updated accumulator variable. in #538
- Add CelOptions to disable string conversion and list/string concatenation in #506
- Add CelOptions to disable comprehension in #507
Fixes
- Enforce strictness of type function #474
- Fix macro parsing with receiver style args by @oridag in #481
- Use an immutable copy of
DefaultDispatcher
to avoid synchronization in #477
Miscellaneous
-
Remove unused test_java_proto package in #526
-
Remove reference to CheckedExpr proto in DefaultMetadata in #521
-
Migrate CelAttributeParser away from proto based expr to canonical cel expr in #522
-
Add expr ID set as a field to CelUnknownSet. in #471
-
Add a policy example that compiles then evaluates late bound functions in #497
-
Migrate dev/cel/common/ tests to use proto3 canonical conformance protos follow up will address proto2. in #512
-
Migrate dev/cel/extensions tests to use canonical conformance protos. in #513
-
Remove unnecessary unknown value adaptation in ProtoAdapter in #499
-
Migrate away from deprecated CelTypes methods in #525
-
Remove the legacy createInterpretable(CheckedExpr) in #487
-
Update runtime tests to refer to canonical cel conformance protos. in #510
-
Correctly suppress AutoValueMutable warnings in #475
-
Deprecate enableUnsignedLong option. Remove associated base interpreter tests. in #515
-
Cleanup of unused methods and build targets in #469
-
Move evaluateExpr utility methods to validator and optimizer in #470
-
Update WORKSPACE dependencies in #530
-
Remove references to deprecated type resolvers in the runtime. in #520
-
Remove retainComprehensionStructure flag in SubexpressionOptimizer in #493
New Contributors
Full Changelog: v0.8.0...v0.9.0
v0.8.0
Fixes
- Fix CEL-Java to be fully protobuf v4 compatible in #466
- Ensure empty YAML inputs yield checked exceptions #463
Features
- Add optional.unwrap in #438
Miscellaneous
- Expose CelPolicyValidationException constructors in #450
- Make CelAbstractSyntaxTree and its dependents an AutoValue class to allow for equality checks in #458
- Additional test case and error message refinement in #464
Full Changelog: v0.7.1...v0.8.0
v0.7.1
Important
enableUnsignedLongs in CelOptions is now enabled by default as of #410. Unsigned integer literals (uint) in CEL expressions will now be represented as com.google.common.primitives.UnsignedLong instead of java.lang.Long when evaluated. If your expressions expose these unsigned integer literals directly or you have custom functions that work with unsigned integers, you may need to explicitly disable this flag and make adjustments to avoid errors.
Features
- Add ListsExtension with flatten function #427, #434
- Introduce ProtoUnsetFieldOptions to support unset handling like C++ in #403
- Include identity functions in the standard definitions in #405
- Add string to boolean conversion function in the standard definition in #407
- Provide an overload to hide all fields on a message with ProtoTypeMask in #415
- Parse explanations in match blocks in #420
- Improved support for nested rules in #422
- Add a validator for enforcing AST depth limit in #421
- Enforce composed AST stays below the configured depth limit in #424
- Improve CSE for comprehensions by taking into their nesting level and types into account in #430
- Add an option to prevent breaking apart a comprehension in CSE in #432
- Enable retainComprehensionStructure by default in #436
- Add unreachable checks in policies in #423
Fixes
- Do not override the container if it's missing from policy config in #401
- Add option to specify folding designated custom functions only in #402
- Fix conditionally nested rules to include its condition in #404
- Fix runtime equality behavior for sets extension in #416
- Reduce count of errors joined together during parsing error in #417 #418
Miscellaneous Changes
- Upgrade protobuf version to 4.28.0 in #439
- Remove unused list/map conversion functions from standard definitions in #406
- Open source Java conformance tests in #413
- Change cel_spec repo url to 0.16.0 in WORKSPACE in #419
- Migrate test_all_types proto over to the cel-spec variant in #433
Full Changelog: v0.6.0...v0.7.1
v0.6.0
This release features CEL-based policy compilers with YAML support (example), adds a new extension library for handling set operations and includes minor bug fixes along with performance improvements.
Fixes
- Copy the suppress warning annotations to autovalue gened celexpr in #359
- Check for presence of optional indices to prevent autoboxing in #366
- Adapt the function dispatch result to allow for automatic Any unpacking in #376
What's Changed
- Implement CEL Set Extension in #360
- Remove PartialMessage and IncompleteData in #365
- Compute line offsets once when constructing CelCodePointArray #368
- Remove celVarToDecl method in #371
- Add an interface for encapsulating Source properties in #369
- Add PolicySource in #370
- Flag guard the function dispatch result adaptation change in #383
- Implement YAML parser for policy configs in #372
- Create a separate interface for validating required fields in a builder in #373
- Add the capability to extend CEL environment from parsed config in #374
- Add YAML policy test cases in #375
- Implement YAML parser for policies in #377
- Move computing offset location into CelSourceHelper for reuse in #379
- Add AstMutator methods to construct cel.bind macro with varInit containing macros in #380
- Add AstMutator methods to construct function calls in #381
- Add Policy Compiler in #378
- Add factories for policy parser and policy compiler in #382
- Add capability to visit custom tags in #384
- Pull getIssueString logic into CelIssue in #385
- Introduce protobuf message testing to policies in #386
- Validate required fields for policy variables in #387
- Compute absolute source location correctly for multiline YAML strings in #395
- Make iteration limit configurable for rule composer in #393
- Decompose policy compile API into rule compilation and composition in #397
- Surface type-mismatch errors in a readable fashion during rule composition in #399
Full Changelog: v0.5.2...v0.6.0
v0.5.2
What's Changed
- Support evaluation of dynamic messages constructed via dynamic descriptors in #355
- Remove deprecated create methods in #325
- Mark CelDescriptorUtil as internal. Remove unused method in #352
Fixes
- Retain source description post AST optimization in #342
- Clear the source position for only the dangling macro expr ID instead of all exprs in #348
Miscellaneous
- Fix extensions README.md formatting in #345
- Variable name cleanups from removing create modifier in #322
- Add documentation for codelab exercises 5 through 9 in #349
- Add code for Exercise 8 Codelabs in #343
- Add code for Exercise 9 Codelabs in #344
Full Changelog: v0.5.1...v0.5.2
v0.5.1
v0.5.0
Note: Use 0.5.1 if you're using Maven Central
This release introduces mutable expressions to improve the performance of augmenting an AST via CEL optimizers. Roughly, the speed improvement ranges from 3x to 10x depending on the complexity of an AST.
Breaking Changes
Classes CelCreateList
, CelCreateMap
and CelCreateStruct
have been renamed to CelList
, CelMap
and CelStruct
respectively to be consistent across other canonical CEL implementations. There are no functional changes.
- Remove modifier create from CelCreateList, CelCreateMap and CelCreateStruct in #318
- Remove modifier create from mutable variants of list, map and struct in #323
- Remove create modifiers from list,struct,map methods in #321
What's Changed
- Accept a list as an argument to setParameterTypes in function overload decl in #278
- Add a SubexpressionOptimizer baseline test case for fully extractable presence tests in #287
- Implement CelMutableExpr in #289
- Add CelMutableIdent in #291
- Add CelMutableCreateList #292
- Add CelMutableSelect in #297
- Add CelMutableCreateStruct in #293
- Add CelMutableCreateMap in #294
- Add CelMutableComprehension in #295
- Add CelMutableCall #298
- Add copy constructor to deep copy mutable expressions in #296
- Introduce a common expression tree interface between CelExpr and CelMutableExpr in #300
- Compute Max IDs per subtree in NavigableExpr in #302
- Add CelMutableAst in #303
- Change MutableExprVisitor to visit using CelMutableExpr in #304
- Change AST Mutator to accept mutable ASTs in #305
- Change ConstantFoldingOptimizer to leverage mutable exprs in #308
- Fully perform CSE on presence tests where possible in #311
- Change AstMutator to augment macro source using mutable expr in #314
- Drop expr suffix from CelExpr static constructors in #317
- Specify better error message and code for invalid field selections in #316
- Improve canEliminate logic by excluding nodes from ineligible comprehension branches in #312
- Remove appending create modifier in ExprFormatter in #320
- Remove modifier create from the common expression interface in #319
- Change CelAstOptimizer interface signature. Cleanup unused methods in #310
- Change SubexpressionOptimizer to leverage mutable exprs in #309
- Add Mutable versions of NavigableExpr and AST in #307
- Remove cached hashcode from MutableExpr in #306
- Create a base navigable class that accepts a bound generic type of an expression in #301
- Add a converter for adapting between CelExpr and CelMutableExpr #299
- Rename MutableAst to AstMutator in #290
- Use simple for loop instead of stream in CEL runtime equality #280
Fixes
- Fix timestamp and duration conversion for JSON in #332
- Change comprehension variable mangling logic to always generate a unique index per comprehension expr in #330
- Fix optional type resolution in #283
- Fix optional field selection behavior on structs in #286
- Clean up dangling source information from macro expansion in #337
- Do not re-use ID twice in exists_one macro in #338
- Dedupe enum types by enum descriptor's fully qualified name in ProtoMessageTypeProvider in #324
Miscellaneous
- Remove main AutoValue dependency from the published jar in #315
- Add
load()
statements for the builtin Bazel java rules in #284 - Update bazel WORKSPACE dependencies #331
- Remove maven artifacts for optimizer, validator and extensions in #327
- Add capability to regenerate baseline tests into a file in #329
Full Changelog: v0.4.1...v0.5.0