Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ bazel_dep(
)
bazel_dep(
name = "cel-spec",
version = "0.25.1",
version = "0.25.2",
repo_name = "com_google_cel_spec",
)
git_override(
module_name = "cel-spec",
commit = "ba58ae5007845f3a1279b488cdeb79645ce958bb",
remote = "https://github.com/cel-expr/cel-spec",
)

bazel_dep(
name = "platforms",
version = "1.1.0",
Expand Down
5 changes: 5 additions & 0 deletions conformance/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ cc_library(
"//extensions:comprehensions_v2_functions",
"//extensions:comprehensions_v2_macros",
"//extensions:encoders",
"//extensions:lists_functions",
"//extensions:math_ext",
"//extensions:math_ext_decls",
"//extensions:math_ext_macros",
Expand Down Expand Up @@ -143,6 +144,7 @@ _ALL_TESTS = [
"@com_google_cel_spec//tests/simple:testdata/fp_math.textproto",
"@com_google_cel_spec//tests/simple:testdata/integer_math.textproto",
"@com_google_cel_spec//tests/simple:testdata/lists.textproto",
"@com_google_cel_spec//tests/simple:testdata/lists_ext.textproto",
"@com_google_cel_spec//tests/simple:testdata/logic.textproto",
"@com_google_cel_spec//tests/simple:testdata/macros.textproto",
"@com_google_cel_spec//tests/simple:testdata/macros2.textproto",
Expand Down Expand Up @@ -228,6 +230,9 @@ _TESTS_TO_SKIP_LEGACY = _TESTS_TO_SKIP + [
"block_ext/basic/optional_map",
"block_ext/basic/optional_map_chained",
"block_ext/basic/optional_message",

# lists_ext not implemented for legacy evaluator
"lists_ext",
]

_TESTS_TO_SKIP_LEGACY_DASHBOARD = [
Expand Down
8 changes: 7 additions & 1 deletion conformance/service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include "extensions/comprehensions_v2_functions.h"
#include "extensions/comprehensions_v2_macros.h"
#include "extensions/encoders.h"
#include "extensions/lists_functions.h"
#include "extensions/math_ext.h"
#include "extensions/math_ext_decls.h"
#include "extensions/math_ext_macros.h"
Expand Down Expand Up @@ -147,6 +148,7 @@ absl::Status LegacyParse(const conformance::v1alpha1::ParseRequest& request,
CEL_RETURN_IF_ERROR(cel::extensions::RegisterBindingsMacros(macros, options));
CEL_RETURN_IF_ERROR(cel::extensions::RegisterMathMacros(macros, options));
CEL_RETURN_IF_ERROR(cel::extensions::RegisterProtoMacros(macros, options));
CEL_RETURN_IF_ERROR(cel::extensions::RegisterListsMacros(macros, options));
CEL_RETURN_IF_ERROR(cel::test::RegisterTestMacros(macros));
CEL_ASSIGN_OR_RETURN(auto source, cel::NewSource(request.cel_source(),
request.source_location()));
Expand Down Expand Up @@ -192,6 +194,8 @@ absl::Status CheckImpl(google::protobuf::Arena* arena,
builder->AddLibrary(cel::extensions::EncodersCheckerLibrary()));
CEL_RETURN_IF_ERROR(
builder->AddLibrary(cel::extensions::ComprehensionsV2CheckerLibrary()));
CEL_RETURN_IF_ERROR(
builder->AddLibrary(cel::extensions::ListsCheckerLibrary()));
}

for (const auto& decl : request.type_env()) {
Expand All @@ -201,7 +205,7 @@ absl::Status CheckImpl(google::protobuf::Arena* arena,
auto fn_decl, cel::FunctionDeclFromV1Alpha1Proto(
name, decl.function(),
google::protobuf::DescriptorPool::generated_pool(), arena));
CEL_RETURN_IF_ERROR(builder->AddFunction(std::move(fn_decl)));
CEL_RETURN_IF_ERROR(builder->MergeFunction(std::move(fn_decl)));
} else if (decl.has_ident()) {
CEL_ASSIGN_OR_RETURN(
auto var_decl, cel::VariableDeclFromV1Alpha1Proto(
Expand Down Expand Up @@ -536,6 +540,8 @@ class ModernConformanceServiceImpl : public ConformanceServiceInterface {
builder.function_registry(), options));
CEL_RETURN_IF_ERROR(cel::extensions::RegisterMathExtensionFunctions(
builder.function_registry(), options));
CEL_RETURN_IF_ERROR(cel::extensions::RegisterListsFunctions(
builder.function_registry(), options));

return std::move(builder).Build();
}
Expand Down
Loading