Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
9f13b9a
Support nullable optionals and generic collections
snazy Jul 16, 2026
f01c45b
Add standalone production smoke coverage
snazy Jul 16, 2026
a958f25
Reduce CEL collection adaptation allocation
snazy Jul 16, 2026
7acf312
Add performance-focused JMH benchmark
snazy Jul 16, 2026
dc8d678
Improve interpreter lookup paths
snazy Jul 16, 2026
cd94b8a
Make Jackson registry caches concurrent
snazy Jul 16, 2026
b946a9f
Adapt terminal field qualifiers directly
snazy Jul 16, 2026
69be282
Plan checked ASTs without wrapper conversion
snazy Jul 16, 2026
6f48b71
Index protobuf map lookups lazily
snazy Jul 16, 2026
c431717
Return CEL values without native conversion
snazy Jul 16, 2026
ee0f649
Specialize macro list folds
snazy Jul 16, 2026
d1178cd
Skip impossible overload candidates
snazy Jul 16, 2026
603502e
Resolve checked identifiers directly
snazy Jul 16, 2026
821f56f
Specialize receiver varargs fallback
snazy Jul 16, 2026
39137cf
Use Java 17 as the runtime baseline
snazy Jul 17, 2026
286bf7c
Update googleapis submodule
snazy Jul 17, 2026
60b758e
Bump CEL-Spec from 0.15.0 to 0.25.2
snazy Jul 17, 2026
b793fbe
Pure-Java conformance tests
snazy Jul 17, 2026
9ac53e6
Align CEL-Spec conformance behavior
snazy Jul 17, 2026
2e64eba
Prune nulls from protobuf repeated and map fields
snazy Jul 17, 2026
bb4a4d5
Remove stale map Any null-retention skips
snazy Jul 17, 2026
9df6a93
Return CEL errors for invalid protobuf field values
snazy Jul 17, 2026
68c970e
Add type deduction conformance coverage
snazy Jul 17, 2026
053baf8
Enable passing float range conformance cases
snazy Jul 17, 2026
306d899
Enable passing legacy enum range conformance cases
snazy Jul 17, 2026
259b7e2
Check 32-bit protobuf wrapper ranges
snazy Jul 17, 2026
15e57de
Convert large uint values to JSON strings
snazy Jul 17, 2026
cba65b4
Support protobuf well-known JSON values
snazy Jul 17, 2026
029484d
Reject float keys in map literals
snazy Jul 17, 2026
4af0398
Honor protobuf NaN equality semantics
snazy Jul 17, 2026
c986f93
Preserve nested Any conformance values
snazy Jul 17, 2026
c87e2e7
Reject non-string keys for protobuf Struct conversion
snazy Jul 17, 2026
0baf1ea
Enable proto3 negative-zero float conformance case
snazy Jul 17, 2026
dd7e444
Prefer wrapper types when unifying list elements
snazy Jul 17, 2026
61604ad
Preserve nullable types when unifying with null
snazy Jul 17, 2026
c1b9457
Improve checker type parameter inference
snazy Jul 17, 2026
24064c2
Preserve comprehension variable shadowing
snazy Jul 17, 2026
0eda646
Support proto2 extension field access
snazy Jul 17, 2026
e5c460b
Add proto extension helper library
snazy Jul 17, 2026
7ff07df
Add supported string extension conformance
snazy Jul 17, 2026
d034ca2
Complete string extension conformance
snazy Jul 17, 2026
2c03e6b
Add optional type-check declarations
snazy Jul 17, 2026
fed2ed7
Narrow strong enum conformance skips
snazy Jul 17, 2026
966d3d5
Re-enable deep message literal conformance
snazy Jul 17, 2026
05870ed
Add encoder extension conformance
snazy Jul 17, 2026
51d1943
Add binding macro conformance
snazy Jul 17, 2026
25eda95
Add math extension conformance
snazy Jul 17, 2026
02143f5
Add network extension conformance
snazy Jul 17, 2026
dd7e939
Add block extension conformance
snazy Jul 17, 2026
ce0b0a4
Add comprehension v2 conformance
snazy Jul 17, 2026
5f98cf5
Note about CEL strong-enums
snazy Jul 17, 2026
a2f27d2
Replace ANTLR parser with CongoCC
snazy Jul 17, 2026
8237378
Implement CEL optional conformance support
snazy Jul 17, 2026
41092f0
END OT CEL-SPEC 0.25.2 WORK
snazy Jul 17, 2026
9e5563f
Replace `Arrays.asList()` with single element with `List.of()`
snazy Jul 17, 2026
8f8863a
[style] Replace with enhanced switch expression
snazy Jul 17, 2026
43d7dc6
[style] replace with pattern variable
snazy Jul 17, 2026
37287c9
Use String.repeat()
snazy Jul 17, 2026
e5238a5
Use `.isEmpty()`
snazy Jul 17, 2026
c1c3a29
Fix AstPruner / struct-pruning
snazy Jul 17, 2026
83614dd
Remove unused `ParseError`
snazy Jul 17, 2026
577c9b5
Remove unused function in TypeErrors
snazy Jul 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
java-version: [21, 24]
java-version: [21, 25]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
Expand Down Expand Up @@ -68,19 +68,6 @@ jobs:
- name: Microbenchmarks
run: ./gradlew jmh

- name: Cache Bazel stuff
if: ${{ matrix.java-version == '21' }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: |
~/.cache/bazel
key: bazel-${{ hashFiles('**/.gitmodules') }}
restore-keys: bazel-

- name: Conformance tests
if: ${{ matrix.java-version == '21' }}
run: conformance/run-conformance-tests.sh

- name: Capture test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: failure()
Expand Down
46 changes: 35 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The CEL specification can be found [here](https://github.com/google/cel-spec).
- [Motivation](#motivation)
- [Arbitrary Java classes](#arbitrary-java-classes)
- [Unsigned 64-bit `uint`](#unsigned-64-bit-uint)
- [Protobuf enum semantics](#protobuf-enum-semantics)
- [Native image and package verification](#native-image-and-package-verification)
- [Not yet implemented](#not-yet-implemented)
- [Unclear double-to-int rounding behavior](#unclear-double-to-int-rounding-behavior)
Expand Down Expand Up @@ -394,14 +395,32 @@ but `123u == 123u` and `123 == 123` are.
If you have a `uint32` or `uint64` in protobuf objects, or use `uint`s in CEL expressions, wrap those
values with `org.projectnessie.cel.common.ULong`.

### Protobuf enum semantics

CEL-Java follows the CEL-Spec v0.25.2 language definition for protobuf enum values: protobuf enum
constants and enum fields are represented as CEL `int` values.

The upstream CEL-Spec conformance testdata also contains strong-enum cases where enum values
preserve their enum type. CEL-Java does not currently enable those strong-enum conformance cases.
They are not part of the v0.25.2 language-definition baseline and are mutually incompatible with the
legacy enum-as-int conformance sections in a single-mode runtime.

Use numeric enum values directly, or use `int(...)` when writing expressions that should remain clear
if strong enum support is added in the future:

```cel
TestAllTypes.NestedEnum.BAR == 1
int(TestAllTypes.NestedEnum.BAR) == 1
```

### Native image and package verification

Native-image and package behavior must be verified in the consuming application's exact build.
`cel-standalone` can reduce dependency conflicts by relocating protobuf dependencies, but it does not
prove Quarkus native-image or package compatibility for every application.

Before using CEL conditions in release-critical authorization paths, run JVM condition tests, the
consuming project's normal build, dependency tree review for protobuf/ANTLR/Jackson conflicts, and
consuming project's normal build, dependency tree review for protobuf/Jackson conflicts, and
package/native-image verification if native execution is part of the release path.

### Not yet implemented
Expand Down Expand Up @@ -433,17 +452,17 @@ The CEL-Go implementation does not pass these CEL-spec conformance tests:

```text
--- FAIL: TestSimpleFile/conversions/int/double_truncate (0.01s)
simple_test.go:219: double_truncate: Eval got [int64_value:2], want [int64_value:1]
double_truncate: Eval got [int64_value:2], want [int64_value:1]
--- FAIL: TestSimpleFile/conversions/int/double_truncate_neg (0.01s)
simple_test.go:219: double_truncate_neg: Eval got [int64_value:-8], want [int64_value:-7]
double_truncate_neg: Eval got [int64_value:-8], want [int64_value:-7]
--- FAIL: TestSimpleFile/conversions/int/double_half_pos (0.01s)
simple_test.go:219: double_half_pos: Eval got [int64_value:12], want [int64_value:11]
double_half_pos: Eval got [int64_value:12], want [int64_value:11]
--- FAIL: TestSimpleFile/conversions/int/double_half_neg (0.01s)
simple_test.go:219: double_half_neg: Eval got [int64_value:-4], want [int64_value:-3]
double_half_neg: Eval got [int64_value:-4], want [int64_value:-3]
--- FAIL: TestSimpleFile/conversions/uint/double_truncate (0.01s)
simple_test.go:219: double_truncate: Eval got [uint64_value:2], want [uint64_value:1]
double_truncate: Eval got [uint64_value:2], want [uint64_value:1]
--- FAIL: TestSimpleFile/conversions/uint/double_half (0.01s)
simple_test.go:219: double_half: Eval got [uint64_value:26], want [uint64_value:25]
double_half: Eval got [uint64_value:26], want [uint64_value:25]
```

## Building and testing CEL-Java
Expand All @@ -460,7 +479,7 @@ Build requirements:

Runtime requirements:

- Java 8 or newer
- Java 17 or newer

`./gradlew publishToMavenLocal` deploys the current development version to the local Maven
repository, in case you want to use CEL-Java snapshot artifacts from another project.
Expand All @@ -470,6 +489,11 @@ repository, in case you want to use CEL-Java snapshot artifacts from another pro
The project uses Google Java style and the Spotless plugin. Run `./gradlew spotlessApply` to fix
formatting issues.

To run the CEL-spec conformance tests, Go, Bazel, and their toolchains are required. From the
CEL-Java repo, run `conformance/run-conformance-tests.sh`. That script performs the necessary Gradle
and Bazel builds.
To run the CEL-Spec conformance tests, use the JUnit-based conformance suite:

```shell
./gradlew :cel-conformance:test
```

The conformance suite reads upstream CEL-Spec textproto testdata from the `submodules/cel-spec`
submodule. It does not require Bazel, Go, or a separate conformance server.
1 change: 0 additions & 1 deletion bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ plugins {
dependencies {
constraints {
api(project(":cel-core"))
api(project(":cel-generated-antlr"))
api(project(":cel-generated-pb"))
api(project(":cel-generated-pb3"))
api(project(":cel-conformance"))
Expand Down
6 changes: 3 additions & 3 deletions build-logic/src/main/kotlin/Java.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fun Project.nessieConfigureJava() {

tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(8)
options.release.set(17)
}

tasks.withType<Javadoc>().configureEach {
Expand All @@ -59,8 +59,8 @@ fun Project.nessieConfigureJava() {
configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
modularity.inferModulePath.set(true)
}
}
Expand Down
3 changes: 1 addition & 2 deletions build-logic/src/main/kotlin/cel-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ nessieConfigureJava()

val nonPublishedProjects =
setOf(
"conformance",
"jacoco",
"cel-conformance",
"cel-quarkus-smoke-standalone",
"cel-quarkus-smoke-core-pb3-jackson3",
)
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ idea.project.settings {
afterSync(
":cel-generated-pb:jar",
":cel-generated-pb:testJar",
":cel-generated-antlr:shadowJar",
)
}
}
Expand Down
67 changes: 25 additions & 42 deletions conformance/README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,40 @@
# Running CEL-spec conformance tests against CEL-Java
# Running CEL-Spec conformance tests against CEL-Java

If your environment is already setup, just run the shell script
```shell
./run-conformance-tests.sh
```

## Requirements & Setup
The CEL-Java conformance suite is a JUnit test suite that reads upstream CEL-Spec
simple testdata from the `submodules/cel-spec` Git submodule.

The CEL-spec conformance test suite is written in Go and uses the bazel build tool.
Run it with:

Required tools:
* [Bazel build tool](https://bazel.build/) (see [bazelisk](https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#installation))

See [Bazel web site](https://bazel.build/install) for installation instructions.
Do **not** use the `bazel-bootstrap` package on Ubuntu, because it comes with
pre-compiled classes that are built with Java 17 or newer, preventing it from
running bazel using older Java versions.
* gcc

On Ubuntu run `apt-get install gcc`
```shell
./gradlew :cel-conformance:test
```

Other required dependencies like "Go" will be managed by bazel.
The suite does not require Bazel, Go, a separate conformance server, or the old
upstream `simple_test` binary.

## FAQ
## Test selection

### Bazel build hangs
The curated conformance file list and skip list live in:

If the bazel build does not start, i.e. it gets stuck with messages like
```
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
... still trying to connect to local Bazel server after 20 seconds ...
... still trying to connect to local Bazel server after 30 seconds ...
```text
conformance/src/test/java/org/projectnessie/cel/conformance/SimpleConformanceTest.java
```
then kill all bazel processes make sure that Java 11 is the current one. It seems, that the
above *may* happen when with Java 8.

### Bazel build fails from `./run-conformance-tests.sh`
Each skip uses the upstream conformance path:

If the bazel build fails with an error like this (note the `Failed to create temporary file`),
run the bazel build once from the console:

```shell
cd submodules/cel-spec

bazel build ...
```text
file/section/test
```

If the build still fails, try the following options:
or a whole-section path:

```shell
bazel build ... --sandbox_writable_path="${HOME}/.ccache" --strategy=CppCompile=standalone
```text
file/section
```

After the build succeeds once from that directory, you can use the `./run-conformance-tests.sh`
script.
Unmatched skips fail the test suite, so stale skips are visible when upstream
testdata changes.

Optional CEL-Spec files such as extension libraries, optionals, and type
deduction are intentionally not enabled by default. Add those separately with
explicit skip reasoning.
33 changes: 9 additions & 24 deletions conformance/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import org.gradle.api.tasks.compile.JavaCompile

plugins {
`java-library`
id("com.gradleup.shadow")
id("cel-conventions")
}

Expand All @@ -33,22 +32,20 @@ val mainProtoResourcesDir = layout.buildDirectory.dir("generated/proto-resources
val syncMainProtoSources =
tasks.register<Sync>("syncMainProtoSources") {
into(syncedMainProtoDir)
from(layout.settingsDirectory.dir("submodules/googleapis/google/rpc")) { into("google/rpc") }
from(layout.settingsDirectory.dir("submodules/googleapis/google/api/expr/conformance")) {
into("google/api/expr/conformance")
from(layout.settingsDirectory.dir("submodules/cel-spec/proto/cel/expr")) {
include("checked.proto", "eval.proto", "syntax.proto", "value.proto")
into("cel/expr")
}
from(layout.settingsDirectory.dir("submodules/cel-spec/proto/cel/expr/conformance/test")) {
include("simple.proto")
into("cel/expr/conformance/test")
}
}

val emptyTestProtoDir = layout.buildDirectory.dir("pb-src/test/proto")

sourceSets.main {
java.setSrcDirs(
listOf(
layout.projectDirectory.dir("src/main/java"),
layout.buildDirectory.dir("generated/sources/proto/main/java"),
layout.buildDirectory.dir("generated/sources/proto/main/grpc"),
)
)
java.setSrcDirs(listOf(layout.buildDirectory.dir("generated/sources/proto/main/java")))
resources.setSrcDirs(listOf(mainProtoResourcesDir))
extensions.configure<SourceDirectorySet>("proto") {
setSrcDirs(listOf(syncedMainProtoDir))
Expand All @@ -68,37 +65,25 @@ configurations.all { exclude(group = "org.projectnessie.cel", module = "cel-gene
dependencies {
implementation(project(":cel-core"))
implementation(project(":cel-generated-pb3"))
implementation(testFixtures(project(":cel-core")))
implementation(testFixtures(project(":cel-generated-pb3")))

implementation(libs.protobuf.java) { version { strictly(libs.versions.protobuf3.get()) } }

implementation(libs.grpc.protobuf)
implementation(libs.grpc.stub)
runtimeOnly(libs.grpc.netty.shaded)
compileOnly(libs.tomcat.annotations.api)
testImplementation(testFixtures(project(":cel-core")))

testImplementation(platform(libs.junit.bom))
testImplementation(libs.bundles.junit.testing)
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.named<Jar>("shadowJar") {
manifest { attributes("Main-Class" to "org.projectnessie.cel.server.ConformanceServer") }
}

// *.proto files taken from https://github.com/google/cel-spec/ repo, available as a git submodule
configure<ProtobufExtension> {
// Configure the protoc executable
protoc {
// Download from repositories
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf3.get()}"
}
plugins {
this.create("grpc") { artifact = "io.grpc:protoc-gen-grpc-java:${libs.versions.grpc.get()}" }
}
generateProtoTasks { all().configureEach { this.plugins.create("grpc") {} } }
}

tasks.named("generateProto") { dependsOn(syncMainProtoSources) }
Expand Down
33 changes: 0 additions & 33 deletions conformance/conformance-server.sh

This file was deleted.

Loading
Loading