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
78da904
Update googleapis submodule
snazy Jul 17, 2026
5bd04cf
Bump CEL-Spec from 0.15.0 to 0.25.2
snazy Jul 17, 2026
9c48d6b
Pure-Java conformance tests
snazy Jul 17, 2026
ae14b1a
Align CEL-Spec conformance behavior
snazy Jul 17, 2026
466e0e3
Prune nulls from protobuf repeated and map fields
snazy Jul 17, 2026
762a0b4
Remove stale map Any null-retention skips
snazy Jul 17, 2026
d099796
Return CEL errors for invalid protobuf field values
snazy Jul 17, 2026
4de0b70
Add type deduction conformance coverage
snazy Jul 17, 2026
c5d277b
Enable passing float range conformance cases
snazy Jul 17, 2026
25347ff
Enable passing legacy enum range conformance cases
snazy Jul 17, 2026
df397f7
Check 32-bit protobuf wrapper ranges
snazy Jul 17, 2026
cc3b322
Convert large uint values to JSON strings
snazy Jul 17, 2026
0573719
Support protobuf well-known JSON values
snazy Jul 17, 2026
ce76024
Reject float keys in map literals
snazy Jul 17, 2026
a551f37
Honor protobuf NaN equality semantics
snazy Jul 17, 2026
8ba999a
Preserve nested Any conformance values
snazy Jul 17, 2026
206bee3
Reject non-string keys for protobuf Struct conversion
snazy Jul 17, 2026
1eb5fd9
Enable proto3 negative-zero float conformance case
snazy Jul 17, 2026
57a4444
Prefer wrapper types when unifying list elements
snazy Jul 17, 2026
952ebc9
Preserve nullable types when unifying with null
snazy Jul 17, 2026
eda0c4e
Improve checker type parameter inference
snazy Jul 17, 2026
2fd81b9
Preserve comprehension variable shadowing
snazy Jul 17, 2026
3b04bbd
Support proto2 extension field access
snazy Jul 17, 2026
a1cf99c
Add proto extension helper library
snazy Jul 17, 2026
0fc6ac1
Add supported string extension conformance
snazy Jul 17, 2026
92844c2
Complete string extension conformance
snazy Jul 17, 2026
eb10c7c
Add optional type-check declarations
snazy Jul 17, 2026
9f25163
Narrow strong enum conformance skips
snazy Jul 17, 2026
cfeed78
Re-enable deep message literal conformance
snazy Jul 17, 2026
13e395b
Add encoder extension conformance
snazy Jul 17, 2026
87f1953
Add binding macro conformance
snazy Jul 17, 2026
29e974c
Add math extension conformance
snazy Jul 17, 2026
73a782f
Add network extension conformance
snazy Jul 17, 2026
148bcb8
Add block extension conformance
snazy Jul 17, 2026
3c33fa1
Add comprehension v2 conformance
snazy Jul 17, 2026
d771df9
Note about CEL strong-enums
snazy Jul 17, 2026
cda68fe
Replace ANTLR parser with CongoCC
snazy Jul 17, 2026
f64d2b2
Implement CEL optional conformance support
snazy Jul 17, 2026
f3b3e59
END OT CEL-SPEC 0.25.2 WORK
snazy Jul 17, 2026
17c327c
Replace `Arrays.asList()` with single element with `List.of()`
snazy Jul 17, 2026
680d9b4
[style] Replace with enhanced switch expression
snazy Jul 17, 2026
41f021e
[style] replace with pattern variable
snazy Jul 17, 2026
f90befa
Use String.repeat()
snazy Jul 17, 2026
678678c
Use `.isEmpty()`
snazy Jul 17, 2026
eabeab0
Fix AstPruner / struct-pruning
snazy Jul 17, 2026
84c5ca5
Remove unused `ParseError`
snazy Jul 17, 2026
ee1d38b
Remove unused function in TypeErrors
snazy Jul 17, 2026
0444636
Remove duplicate `if`
snazy Jul 21, 2026
7e1f04f
Optimize protobuf map construction
snazy Jul 21, 2026
14a9a03
Optimize Jackson 2 field access
snazy Jul 21, 2026
be36947
Optimize Jackson 3 field access
snazy Jul 21, 2026
f16ea2f
Optimize generated protobuf field access
snazy Jul 21, 2026
603aca7
Centralize native value conversion
snazy Jul 21, 2026
dba2b27
Specialize ternary/quaternary/quinary overload evaluation
snazy Jul 21, 2026
32f804f
Optimize generated protobuf field access
snazy Jul 21, 2026
60d3a3f
Optimize CEL collection and map operations
snazy Jul 21, 2026
aab913a
Optimize native collection traversal
snazy Jul 21, 2026
0e156e8
Cache common CEL scalar values
snazy Jul 21, 2026
d8d9185
Minor optimizations & style fixes
snazy Jul 21, 2026
ef50aaa
Allocation-free activation lookup
snazy Jul 22, 2026
7a6ea12
Benchmark evaluator boundaries and centralize numeric semantics
snazy Jul 22, 2026
379364e
Add native-value planned evaluation
snazy Jul 22, 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
13 changes: 0 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
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
44 changes: 34 additions & 10 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 @@ -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
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