Releases: google/cel-java
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
v0.4.1
v0.4.0
This release introduces a new static optimizer that performs Common Subexpression Elimination to improve upon evaluation efficiency.
Breaking Changes
ConstantFoldingOptimizer.INSTANCE is made inaccessible with the following PR. Callers must use getInstance or newInstance methods instead.
- Add ConstantFoldingOptions by @copybara-service in #214
What's Changed
- Implement Optimizer for Common Subexpression Elimination by @copybara-service in #208
- Allow MutableAst to insert a new bind macro by @copybara-service in #203
- Perform CSE on comprehension loop step by mangling identifier names by @copybara-service in #210
- Perform CSE on presence tests by @copybara-service in #212
- Allow configuration of MutableAst by making it instantiable by @copybara-service in #213
- Properly set subtree height for navigable expr's children by @copybara-service in #242
- Augment CSE to produce optimized ASTs using cel.block by @copybara-service in #236
- Tag AST containing cel.block call by @copybara-service in #237
- Add mangled comprehension variables as identifier declaration to the environment by @copybara-service in #244
- Assign unique indices for mangled comprehension identifiers with different types by @copybara-service in #243
- Add
.toBuildermethods to constructed CEL environments by @copybara-service in #233 - Allow cel.bind to be lazily evaluated by @copybara-service in #221
- Enable lazy comprehension eval by default by @copybara-service in #222
- Remove enableComprehensionLazyEval flag by @copybara-service in #225
- Add serialization capability for tagged AST extensions by @copybara-service in #229
- Add capability to evaluate cel.block calls in the runtime by @copybara-service in #226
- Add height property to CelNavigableExpr by @copybara-service in #239
- Mangle identifier name for comprehension result by @copybara-service in #245
- Create an enum for functions used in CelOptionalLibrary by @copybara-service in #246
- Allow setting nesting limit for extractable subexpressions. by @copybara-service in #240
- Create baseline tests for SubexpressionOptimizer by @copybara-service in #249
- Move cel.bind memoization into ScopedResolver by @copybara-service in #230
- Remove redundant indices when optimizing with recursion depth by @copybara-service in #258
- Add baseline tests for constant folding applied before subexpression optimization by @copybara-service in #264
- Allow mutation of AST containing expanded macro that does not exist in macro_call map by @copybara-service in #266
- Assert correctness on AST ran through SubexpressionOptimizer by @copybara-service in #252
- Retain tagged extension when it exists in both original and new ASTs by @copybara-service in #267
- Add an option for controlling short-circuiting behavior for logical operators #269
Fixes
- Fix constant folding to work with list provided as an identifier by @l46kok in #199
- Fix standard function 'type' to accept a parameter type of TypeParamType instead of Dyn by @copybara-service in #207
- Fix constant folding when ternary arg is replaced with a comprehension by @copybara-service in #268
- Fix constant folding with in operator involving comprehension identifiers by @copybara-service in #263
- Prevent string.format injection when interpreter exception is being built by @copybara-service in #218
- Fix optional list/map indexing with unknowns. Fix optional map indexing via field selection. by @copybara-service in #262
- Fix replacing namespaced identifiers for accu_init by @copybara-service in #261
- Optimize parsing a large string literal by avoiding making substring copies #270
Miscellaneous
- Include optimizer and validator in publish script by @copybara-service in #197
- Update to Truth 1.4.0. by @copybara-service in #234
- Migrate usages of
Truth8.assertThatto equivalent usages ofTruth.assertThat. by @copybara-service in #235 - Add link to Protocol Buffers tutorials in codelab README.md by @modhanami in #254
- Add an enum for Standard functions that are non-operators by @copybara-service in #209
- Prepare 0.4.0 release by @copybara-service in #272
New Contributors
- @modhanami made their first contribution in #254
Full Changelog: v0.3.1...v0.4.0
v0.3.1
v0.3.0
This release brings the following changes to improve safety, ease of use and evaluation performance:
- Static AST validators have been added. Canonical literal validators are available for timestamp, durations, regex and homogeneous aggregate literals (for lists and maps).
- Static AST optimizers. Used for optimizing type-checked ASTs for improved evaluation efficiency. Constant Folding is available for use.
- Introduction of CelValue and CelValueProviders. CelValue is a native value representation leveraged in the runtime. This can be used to bind non-protobuf structs for evaluation (ex: POJOs).
What's Changed
- Internal Changes by @copybara-service in #126
- Add HomogeneousLiteral Validator by @copybara-service in #136
- Add evaluation listener by @copybara-service in #149
- Internal Changes by @copybara-service in #151
- Decouple DynamicProto by extracting logic for descriptor pool and message factory. by @copybara-service in #152
- Fix unpacking any messages containing extension fields by @copybara-service in #155
- Internal Changes by @copybara-service in #156
- Externalize Codelabs Code by @copybara-service in #161
- Update map and filter macros to use unique ids for references to accumulator variables. by @copybara-service in #188
- Add an interface for selectable values by @copybara-service in #186
- Fix external bazel builds by @copybara-service in #190
- Add an adapter for legacy runtime to consume CelValueProvider. Add interpreter test for CelValues. by @copybara-service in #172
- Add an example demonstrating how to bind a POJO in the runtime by @copybara-service in #187
- Make builders return the interface type instead of concrete implementation by @copybara-service in #192
- Add a string formatter for CelExpr by @copybara-service in #189
- move antlr generated CEL parser to it's own package by @mikedanese in #194
- Release 0.3.0 by @copybara-service in #196
New Contributors
- @mikedanese made their first contribution in #194
Full Changelog: v0.2.0...v0.3.0
v0.2.0
This represents the release of CEL-Java in its entirety, including the parser, type-checker and runtime.
Full Changelog: v0.1.0...v0.2.0
v0.1.0
Initial release of CEL-Java
Features:
- Evaluation of a type-checked expression
- Adapters for CEL protobuf messages (
dev.cel.exprandcom.google.api.expr.v1alpha1)
Note: Compilation (Parsing + Type-Checking) is not yet supported but will be made available in the future. Please consider using CEL-Go implementation to produce a type-checked expression for time being.