Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
f79d3fd
Specialize macro list folds
snazy Jul 16, 2026
4fed851
Resolve checked identifiers directly
snazy Jul 16, 2026
57c0178
Specialize receiver varargs fallback
snazy Jul 16, 2026
8e34036
Use Java 17 as the runtime baseline
snazy Jul 17, 2026
2fa1dd4
Update googleapis submodule
snazy Jul 17, 2026
941e6eb
Bump CEL-Spec from 0.15.0 to 0.25.2
snazy Jul 17, 2026
c40328d
Pure-Java conformance tests
snazy Jul 17, 2026
eea27f4
Align CEL-Spec conformance behavior
snazy Jul 17, 2026
1a660ad
Prune nulls from protobuf repeated and map fields
snazy Jul 17, 2026
5b40d76
Remove stale map Any null-retention skips
snazy Jul 17, 2026
c752029
Return CEL errors for invalid protobuf field values
snazy Jul 17, 2026
760ba3f
Add type deduction conformance coverage
snazy Jul 17, 2026
19736a9
Enable passing float range conformance cases
snazy Jul 17, 2026
8b41931
Enable passing legacy enum range conformance cases
snazy Jul 17, 2026
ceac046
Check 32-bit protobuf wrapper ranges
snazy Jul 17, 2026
2722126
Convert large uint values to JSON strings
snazy Jul 17, 2026
9ead5e1
Support protobuf well-known JSON values
snazy Jul 17, 2026
18a77de
Reject float keys in map literals
snazy Jul 17, 2026
89c4590
Honor protobuf NaN equality semantics
snazy Jul 17, 2026
05b996a
Preserve nested Any conformance values
snazy Jul 17, 2026
a84129b
Reject non-string keys for protobuf Struct conversion
snazy Jul 17, 2026
382ea91
Enable proto3 negative-zero float conformance case
snazy Jul 17, 2026
335bc89
Prefer wrapper types when unifying list elements
snazy Jul 17, 2026
cacab82
Preserve nullable types when unifying with null
snazy Jul 17, 2026
07903db
Improve checker type parameter inference
snazy Jul 17, 2026
2f86abb
Preserve comprehension variable shadowing
snazy Jul 17, 2026
1329f0c
Support proto2 extension field access
snazy Jul 17, 2026
1e5a15d
Add proto extension helper library
snazy Jul 17, 2026
eae1a46
Add supported string extension conformance
snazy Jul 17, 2026
534ac65
Complete string extension conformance
snazy Jul 17, 2026
7c907e8
Add optional type-check declarations
snazy Jul 17, 2026
ef94455
Narrow strong enum conformance skips
snazy Jul 17, 2026
c0e4368
Re-enable deep message literal conformance
snazy Jul 17, 2026
05c04dd
Add encoder extension conformance
snazy Jul 17, 2026
a0f8895
Add binding macro conformance
snazy Jul 17, 2026
7d964f8
Add math extension conformance
snazy Jul 17, 2026
b3ee082
Add network extension conformance
snazy Jul 17, 2026
e59b839
Add block extension conformance
snazy Jul 17, 2026
7f1e544
Add comprehension v2 conformance
snazy Jul 17, 2026
7d13d56
Note about CEL strong-enums
snazy Jul 17, 2026
1bd378b
Replace ANTLR parser with CongoCC
snazy Jul 17, 2026
ff00d88
Implement CEL optional conformance support
snazy Jul 17, 2026
17be4d0
END OT CEL-SPEC 0.25.2 WORK
snazy Jul 17, 2026
781f294
Replace `Arrays.asList()` with single element with `List.of()`
snazy Jul 17, 2026
a1cc8fa
[style] Replace with enhanced switch expression
snazy Jul 17, 2026
dfd0898
[style] replace with pattern variable
snazy Jul 17, 2026
71210ad
Use String.repeat()
snazy Jul 17, 2026
43ba093
Use `.isEmpty()`
snazy Jul 17, 2026
e9e5188
Fix AstPruner / struct-pruning
snazy Jul 17, 2026
de8a2f4
Remove unused `ParseError`
snazy Jul 17, 2026
2ace88b
Remove unused function in TypeErrors
snazy Jul 17, 2026
d6cb8f3
Remove duplicate `if`
snazy Jul 21, 2026
1ee3c6c
Optimize protobuf map construction
snazy Jul 21, 2026
8ddda1a
Optimize Jackson 2 field access
snazy Jul 21, 2026
1145f07
Optimize Jackson 3 field access
snazy Jul 21, 2026
8c3cbff
Optimize generated protobuf field access
snazy Jul 21, 2026
12a915c
Centralize native value conversion
snazy Jul 21, 2026
6f4900b
Specialize ternary/quaternary/quinary overload evaluation
snazy Jul 21, 2026
7550065
Optimize generated protobuf field access
snazy Jul 21, 2026
8d3d8cd
Optimize CEL collection and map operations
snazy Jul 21, 2026
5021852
Optimize native collection traversal
snazy Jul 21, 2026
51a575c
Cache common CEL scalar values
snazy Jul 21, 2026
dc2b52f
Minor optimizations & style fixes
snazy Jul 21, 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