diff --git a/MODULE.bazel b/MODULE.bazel index 090309f2a..b013fb86e 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -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", diff --git a/conformance/BUILD b/conformance/BUILD index a5889f83b..b4ac3718f 100644 --- a/conformance/BUILD +++ b/conformance/BUILD @@ -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", @@ -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", @@ -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 = [ diff --git a/conformance/service.cc b/conformance/service.cc index 8a456a9f4..c826d4572 100644 --- a/conformance/service.cc +++ b/conformance/service.cc @@ -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" @@ -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())); @@ -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()) { @@ -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( @@ -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(); }