Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
4aef23a
Resolve checked identifiers directly
snazy Jul 16, 2026
63d2c2f
Specialize receiver varargs fallback
snazy Jul 16, 2026
442c693
Use Java 17 as the runtime baseline
snazy Jul 17, 2026
23a4e7d
Update googleapis submodule
snazy Jul 17, 2026
1bed1e5
Bump CEL-Spec from 0.15.0 to 0.25.2
snazy Jul 17, 2026
7ea613e
Pure-Java conformance tests
snazy Jul 17, 2026
4caecdc
Align CEL-Spec conformance behavior
snazy Jul 17, 2026
1ebfad0
Prune nulls from protobuf repeated and map fields
snazy Jul 17, 2026
be27b4b
Remove stale map Any null-retention skips
snazy Jul 17, 2026
d7a5267
Return CEL errors for invalid protobuf field values
snazy Jul 17, 2026
c36fe87
Add type deduction conformance coverage
snazy Jul 17, 2026
978b9e9
Enable passing float range conformance cases
snazy Jul 17, 2026
b74e068
Enable passing legacy enum range conformance cases
snazy Jul 17, 2026
2b697e4
Check 32-bit protobuf wrapper ranges
snazy Jul 17, 2026
add7ae1
Convert large uint values to JSON strings
snazy Jul 17, 2026
200d5ba
Support protobuf well-known JSON values
snazy Jul 17, 2026
65cfafc
Reject float keys in map literals
snazy Jul 17, 2026
2ab828b
Honor protobuf NaN equality semantics
snazy Jul 17, 2026
fd72135
Preserve nested Any conformance values
snazy Jul 17, 2026
41ca4cb
Reject non-string keys for protobuf Struct conversion
snazy Jul 17, 2026
0452439
Enable proto3 negative-zero float conformance case
snazy Jul 17, 2026
90d6d0b
Prefer wrapper types when unifying list elements
snazy Jul 17, 2026
104f121
Preserve nullable types when unifying with null
snazy Jul 17, 2026
0f736e9
Improve checker type parameter inference
snazy Jul 17, 2026
7b790dd
Preserve comprehension variable shadowing
snazy Jul 17, 2026
6338948
Support proto2 extension field access
snazy Jul 17, 2026
23ba6bf
Add proto extension helper library
snazy Jul 17, 2026
a0ea53c
Add supported string extension conformance
snazy Jul 17, 2026
2794f47
Complete string extension conformance
snazy Jul 17, 2026
4a1d281
Add optional type-check declarations
snazy Jul 17, 2026
c0fa1a0
Narrow strong enum conformance skips
snazy Jul 17, 2026
8bea7ab
Re-enable deep message literal conformance
snazy Jul 17, 2026
377db26
Add encoder extension conformance
snazy Jul 17, 2026
d1d0120
Add binding macro conformance
snazy Jul 17, 2026
4245976
Add math extension conformance
snazy Jul 17, 2026
719d9ef
Add network extension conformance
snazy Jul 17, 2026
4f5bf73
Add block extension conformance
snazy Jul 17, 2026
0dfa3d8
Add comprehension v2 conformance
snazy Jul 17, 2026
3355c19
Note about CEL strong-enums
snazy Jul 17, 2026
eeb1453
Replace ANTLR parser with CongoCC
snazy Jul 17, 2026
4e38edb
Implement CEL optional conformance support
snazy Jul 17, 2026
60567bc
END OT CEL-SPEC 0.25.2 WORK
snazy Jul 17, 2026
5b73c67
Replace `Arrays.asList()` with single element with `List.of()`
snazy Jul 17, 2026
0511f42
[style] Replace with enhanced switch expression
snazy Jul 17, 2026
aa764eb
[style] replace with pattern variable
snazy Jul 17, 2026
2b125ba
Use String.repeat()
snazy Jul 17, 2026
4dd51c9
Use `.isEmpty()`
snazy Jul 17, 2026
ea6dcc0
Fix AstPruner / struct-pruning
snazy Jul 17, 2026
4d36400
Remove unused `ParseError`
snazy Jul 17, 2026
7beb4eb
Remove unused function in TypeErrors
snazy Jul 17, 2026
8474c98
Remove duplicate `if`
snazy Jul 21, 2026
6a65eb3
Optimize protobuf map construction
snazy Jul 21, 2026
87059a4
Optimize Jackson 2 field access
snazy Jul 21, 2026
a5679b0
Optimize Jackson 3 field access
snazy Jul 21, 2026
45c2ccb
Optimize generated protobuf field access
snazy Jul 21, 2026
2c7399a
Centralize native value conversion
snazy Jul 21, 2026
f7ef158
Specialize ternary/quaternary/quinary overload evaluation
snazy Jul 21, 2026
26a3bd5
Optimize generated protobuf field access
snazy Jul 21, 2026
bc02316
Optimize CEL collection and map operations
snazy Jul 21, 2026
a7bb02b
Optimize native collection traversal
snazy Jul 21, 2026
de1d333
Cache common CEL scalar values
snazy Jul 21, 2026
bb6b3ae
Minor optimizations & style fixes
snazy Jul 21, 2026
8de2a69
Allocation-free activation lookup
snazy Jul 22, 2026
51c0d96
Benchmark evaluator boundaries and centralize numeric semantics
snazy Jul 22, 2026
57f38e8
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
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # 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