Skip to content

Releases: google/cel-java

v0.7.1

30 Aug 18:27
Compare
Choose a tag to compare

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

16 Jul 04:47
Compare
Choose a tag to compare

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

28 May 20:12
Compare
Choose a tag to compare

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

02 May 21:54
Compare
Choose a tag to compare

No actual changes from v0.5.0. The version was bumped to address an issue with pom.xml missing in Maven Central Repository.

v0.5.0

02 May 03:05
Compare
Choose a tag to compare

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

21 Mar 19:56
Compare
Choose a tag to compare

What's Changed

  • Optimize scoped variable access using an unmodifiable map in #274
  • Fix an issue with incorrect boolean evaluation when short-circuiting is disabled in #275

Full Changelog: v0.4.0...v0.4.1

v0.4.0

06 Mar 23:37
Compare
Choose a tag to compare

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 .toBuilder methods 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.assertThat to equivalent usages of Truth.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

Full Changelog: v0.3.1...v0.4.0

v0.3.1

28 Feb 19:29
b8c661f
Compare
Choose a tag to compare

What's Changed

  • Don't include protos (and some other dependencies) in jars by @smparkes in #251
  • Prepare 0.3.1 release by @l46kok in #259

New Contributors

Full Changelog: v0.3.0...v0.3.1

v0.3.0

20 Dec 01:26
Compare
Choose a tag to compare

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

Full Changelog: v0.2.0...v0.3.0

v0.2.0

08 Aug 22:12
Compare
Choose a tag to compare

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