Skip to content

Commit 153518a

Browse files
jckingcopybara-github
authored andcommitted
Fix the world
PiperOrigin-RevId: 689784464
1 parent 4d4a1a4 commit 153518a

43 files changed

Lines changed: 238 additions & 240 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bazel/deps.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ def cel_spec_deps():
142142
url = "https://github.com/bazelbuild/rules_python/releases/download/0.33.2/rules_python-0.33.2.tar.gz",
143143
)
144144

145-
CEL_SPEC_GIT_SHA = "f027a86d2e5bf18f796be0c4373f637a61041cde" # Aug 23, 2024
145+
CEL_SPEC_GIT_SHA = "373994d7e20e582fce56767b01ac5039524cddab" # Oct 23, 2024
146146
http_archive(
147147
name = "com_google_cel_spec",
148-
sha256 = "006594fa4f97819a4e4cd98404e4522f5f46ed5ac65402b354649bcc871b0cf2",
148+
sha256 = "b498a768140fc0ed0314eef8b2519a48287661d09ca15b17c8ca34088af6aac3",
149149
strip_prefix = "cel-spec-" + CEL_SPEC_GIT_SHA,
150150
urls = ["https://github.com/google/cel-spec/archive/" + CEL_SPEC_GIT_SHA + ".zip"],
151151
)

checker/internal/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ cc_test(
175175
"@com_google_absl//absl/status",
176176
"@com_google_absl//absl/status:status_matchers",
177177
"@com_google_absl//absl/strings",
178-
"@com_google_cel_spec//proto/test/v1/proto2:test_all_types_cc_proto",
179-
"@com_google_cel_spec//proto/test/v1/proto3:test_all_types_cc_proto",
178+
"@com_google_cel_spec//proto/cel/expr/conformance/proto2:test_all_types_cc_proto",
179+
"@com_google_cel_spec//proto/cel/expr/conformance/proto3:test_all_types_cc_proto",
180180
"@com_google_protobuf//:protobuf",
181181
],
182182
)

checker/internal/type_checker_impl_test.cc

Lines changed: 54 additions & 54 deletions
Large diffs are not rendered by default.

checker/optional_test.cc

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ TEST(OptionalTest, OptSelectDoesNotAnnotateFieldType) {
8181
CreateTypeCheckerBuilder(GetSharedTestingDescriptorPool()));
8282
ASSERT_THAT(builder.AddLibrary(StandardLibrary()), IsOk());
8383
ASSERT_THAT(builder.AddLibrary(OptionalCheckerLibrary()), IsOk());
84-
builder.set_container("google.api.expr.test.v1.proto3");
84+
builder.set_container("cel.expr.conformance.proto3");
8585
ASSERT_OK_AND_ASSIGN(std::unique_ptr<TypeChecker> checker,
8686
std::move(builder).Build());
8787

@@ -227,10 +227,10 @@ INSTANTIATE_TEST_SUITE_P(
227227
new AstType(ast_internal::PrimitiveType::kString)))))},
228228
TestCase{"['v1', ?'v2']", _,
229229
"expected type 'optional_type<string>' but found 'string'"},
230-
TestCase{"google.api.expr.test.v1.proto3.TestAllTypes{?single_int64: "
230+
TestCase{"cel.expr.conformance.proto3.TestAllTypes{?single_int64: "
231231
"optional.of(1)}",
232232
Eq(AstType(ast_internal::MessageType(
233-
"google.api.expr.test.v1.proto3.TestAllTypes")))},
233+
"cel.expr.conformance.proto3.TestAllTypes")))},
234234
TestCase{"[0][?1]",
235235
IsOptionalType(AstType(ast_internal::PrimitiveType::kInt64))},
236236
TestCase{"[[0]][?1][?1]",
@@ -250,19 +250,18 @@ INSTANTIATE_TEST_SUITE_P(
250250
TestCase{"optional.of('abc').optFlatMap(x, optional.of(x + 'def'))",
251251
IsOptionalType(AstType(ast_internal::PrimitiveType::kString))},
252252
// Legacy nullability behaviors.
253-
TestCase{"google.api.expr.test.v1.proto3.TestAllTypes{?null_value: "
253+
TestCase{"cel.expr.conformance.proto3.TestAllTypes{?null_value: "
254254
"optional.of(0)}",
255255
Eq(AstType(ast_internal::MessageType(
256-
"google.api.expr.test.v1.proto3.TestAllTypes")))},
257-
TestCase{
258-
"google.api.expr.test.v1.proto3.TestAllTypes{?null_value: null}",
259-
Eq(AstType(ast_internal::MessageType(
260-
"google.api.expr.test.v1.proto3.TestAllTypes")))},
261-
TestCase{"google.api.expr.test.v1.proto3.TestAllTypes{?null_value: "
256+
"cel.expr.conformance.proto3.TestAllTypes")))},
257+
TestCase{"cel.expr.conformance.proto3.TestAllTypes{?null_value: null}",
258+
Eq(AstType(ast_internal::MessageType(
259+
"cel.expr.conformance.proto3.TestAllTypes")))},
260+
TestCase{"cel.expr.conformance.proto3.TestAllTypes{?null_value: "
262261
"optional.of(null)}",
263262
Eq(AstType(ast_internal::MessageType(
264-
"google.api.expr.test.v1.proto3.TestAllTypes")))},
265-
TestCase{"google.api.expr.test.v1.proto3.TestAllTypes{}.?single_int64 "
263+
"cel.expr.conformance.proto3.TestAllTypes")))},
264+
TestCase{"cel.expr.conformance.proto3.TestAllTypes{}.?single_int64 "
266265
"== null",
267266
Eq(AstType(ast_internal::PrimitiveType::kBool))}));
268267

@@ -311,11 +310,10 @@ INSTANTIATE_TEST_SUITE_P(
311310
OptionalTests, OptionalStrictNullAssignmentTest,
312311
::testing::Values(
313312
TestCase{
314-
"google.api.expr.test.v1.proto3.TestAllTypes{?single_int64: null}",
315-
_,
313+
"cel.expr.conformance.proto3.TestAllTypes{?single_int64: null}", _,
316314
"expected type of field 'single_int64' is 'optional_type<int>' but "
317315
"provided type is 'null_type'"},
318-
TestCase{"google.api.expr.test.v1.proto3.TestAllTypes{}.?single_int64 "
316+
TestCase{"cel.expr.conformance.proto3.TestAllTypes{}.?single_int64 "
319317
"== null",
320318
_, "no matching overload for '_==_'"}));
321319

common/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ cc_test(
730730
"@com_google_absl//absl/strings:string_view",
731731
"@com_google_absl//absl/time",
732732
"@com_google_absl//absl/types:optional",
733-
"@com_google_cel_spec//proto/test/v1/proto3:test_all_types_cc_proto",
733+
"@com_google_cel_spec//proto/cel/expr/conformance/proto3:test_all_types_cc_proto",
734734
"@com_google_protobuf//:protobuf",
735735
],
736736
)

common/type_test.cc

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ TEST(Type, Enum) {
3939
EXPECT_EQ(
4040
Type::Enum(
4141
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
42-
"google.api.expr.test.v1.proto3.TestAllTypes.NestedEnum"))),
42+
"cel.expr.conformance.proto3.TestAllTypes.NestedEnum"))),
4343
EnumType(ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
44-
"google.api.expr.test.v1.proto3.TestAllTypes.NestedEnum"))));
44+
"cel.expr.conformance.proto3.TestAllTypes.NestedEnum"))));
4545
EXPECT_EQ(Type::Enum(
4646
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
4747
"google.protobuf.NullValue"))),
@@ -52,7 +52,7 @@ TEST(Type, Field) {
5252
google::protobuf::Arena arena;
5353
const auto* descriptor =
5454
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindMessageTypeByName(
55-
"google.api.expr.test.v1.proto3.TestAllTypes"));
55+
"cel.expr.conformance.proto3.TestAllTypes"));
5656
EXPECT_EQ(
5757
Type::Field(ABSL_DIE_IF_NULL(descriptor->FindFieldByName("single_bool"))),
5858
BoolType());
@@ -150,7 +150,7 @@ TEST(Type, Field) {
150150
Type::Field(
151151
ABSL_DIE_IF_NULL(descriptor->FindFieldByName("standalone_enum"))),
152152
EnumType(ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
153-
"google.api.expr.test.v1.proto3.TestAllTypes.NestedEnum"))));
153+
"cel.expr.conformance.proto3.TestAllTypes.NestedEnum"))));
154154
EXPECT_EQ(Type::Field(ABSL_DIE_IF_NULL(
155155
descriptor->FindFieldByName("repeated_int32"))),
156156
ListType(&arena, IntType()));
@@ -183,7 +183,7 @@ TEST(Type, Kind) {
183183
EXPECT_EQ(
184184
Type(EnumType(
185185
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
186-
"google.api.expr.test.v1.proto3.TestAllTypes.NestedEnum"))))
186+
"cel.expr.conformance.proto3.TestAllTypes.NestedEnum"))))
187187
.kind(),
188188
EnumType::kKind);
189189

@@ -202,12 +202,12 @@ TEST(Type, Kind) {
202202

203203
EXPECT_EQ(Type(MessageType(ABSL_DIE_IF_NULL(
204204
GetTestingDescriptorPool()->FindMessageTypeByName(
205-
"google.api.expr.test.v1.proto3.TestAllTypes"))))
205+
"cel.expr.conformance.proto3.TestAllTypes"))))
206206
.kind(),
207207
MessageType::kKind);
208208
EXPECT_EQ(Type(MessageType(ABSL_DIE_IF_NULL(
209209
GetTestingDescriptorPool()->FindMessageTypeByName(
210-
"google.api.expr.test.v1.proto3.TestAllTypes"))))
210+
"cel.expr.conformance.proto3.TestAllTypes"))))
211211
.kind(),
212212
MessageType::kKind);
213213

@@ -252,7 +252,7 @@ TEST(Type, GetParameters) {
252252
EXPECT_THAT(
253253
Type(EnumType(
254254
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
255-
"google.api.expr.test.v1.proto3.TestAllTypes.NestedEnum"))))
255+
"cel.expr.conformance.proto3.TestAllTypes.NestedEnum"))))
256256
.GetParameters(),
257257
IsEmpty());
258258

@@ -274,7 +274,7 @@ TEST(Type, GetParameters) {
274274

275275
EXPECT_THAT(Type(MessageType(ABSL_DIE_IF_NULL(
276276
GetTestingDescriptorPool()->FindMessageTypeByName(
277-
"google.api.expr.test.v1.proto3.TestAllTypes"))))
277+
"cel.expr.conformance.proto3.TestAllTypes"))))
278278
.GetParameters(),
279279
IsEmpty());
280280

@@ -322,7 +322,7 @@ TEST(Type, Is) {
322322
EXPECT_TRUE(
323323
Type(EnumType(
324324
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
325-
"google.api.expr.test.v1.proto3.TestAllTypes.NestedEnum"))))
325+
"cel.expr.conformance.proto3.TestAllTypes.NestedEnum"))))
326326
.Is<EnumType>());
327327

328328
EXPECT_TRUE(Type(ErrorType()).Is<ErrorType>());
@@ -340,11 +340,11 @@ TEST(Type, Is) {
340340

341341
EXPECT_TRUE(Type(MessageType(ABSL_DIE_IF_NULL(
342342
GetTestingDescriptorPool()->FindMessageTypeByName(
343-
"google.api.expr.test.v1.proto3.TestAllTypes"))))
343+
"cel.expr.conformance.proto3.TestAllTypes"))))
344344
.IsStruct());
345345
EXPECT_TRUE(Type(MessageType(ABSL_DIE_IF_NULL(
346346
GetTestingDescriptorPool()->FindMessageTypeByName(
347-
"google.api.expr.test.v1.proto3.TestAllTypes"))))
347+
"cel.expr.conformance.proto3.TestAllTypes"))))
348348
.IsMessage());
349349

350350
EXPECT_TRUE(Type(NullType()).Is<NullType>());
@@ -399,7 +399,7 @@ TEST(Type, As) {
399399
EXPECT_THAT(
400400
Type(EnumType(
401401
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
402-
"google.api.expr.test.v1.proto3.TestAllTypes.NestedEnum"))))
402+
"cel.expr.conformance.proto3.TestAllTypes.NestedEnum"))))
403403
.As<EnumType>(),
404404
Optional(An<EnumType>()));
405405

@@ -418,12 +418,12 @@ TEST(Type, As) {
418418

419419
EXPECT_THAT(Type(MessageType(ABSL_DIE_IF_NULL(
420420
GetTestingDescriptorPool()->FindMessageTypeByName(
421-
"google.api.expr.test.v1.proto3.TestAllTypes"))))
421+
"cel.expr.conformance.proto3.TestAllTypes"))))
422422
.As<StructType>(),
423423
Optional(An<StructType>()));
424424
EXPECT_THAT(Type(MessageType(ABSL_DIE_IF_NULL(
425425
GetTestingDescriptorPool()->FindMessageTypeByName(
426-
"google.api.expr.test.v1.proto3.TestAllTypes"))))
426+
"cel.expr.conformance.proto3.TestAllTypes"))))
427427
.As<MessageType>(),
428428
Optional(An<MessageType>()));
429429

@@ -494,7 +494,7 @@ TEST(Type, Get) {
494494
EXPECT_THAT(
495495
DoGet<EnumType>(Type(EnumType(
496496
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindEnumTypeByName(
497-
"google.api.expr.test.v1.proto3.TestAllTypes.NestedEnum"))))),
497+
"cel.expr.conformance.proto3.TestAllTypes.NestedEnum"))))),
498498
An<EnumType>());
499499

500500
EXPECT_THAT(DoGet<ErrorType>(Type(ErrorType())), An<ErrorType>());
@@ -515,11 +515,11 @@ TEST(Type, Get) {
515515

516516
EXPECT_THAT(DoGet<StructType>(Type(MessageType(ABSL_DIE_IF_NULL(
517517
GetTestingDescriptorPool()->FindMessageTypeByName(
518-
"google.api.expr.test.v1.proto3.TestAllTypes"))))),
518+
"cel.expr.conformance.proto3.TestAllTypes"))))),
519519
An<StructType>());
520520
EXPECT_THAT(DoGet<MessageType>(Type(MessageType(ABSL_DIE_IF_NULL(
521521
GetTestingDescriptorPool()->FindMessageTypeByName(
522-
"google.api.expr.test.v1.proto3.TestAllTypes"))))),
522+
"cel.expr.conformance.proto3.TestAllTypes"))))),
523523
An<MessageType>());
524524

525525
EXPECT_THAT(DoGet<NullType>(Type(NullType())), An<NullType>());
@@ -585,37 +585,37 @@ TEST(Type, VerifyTypeImplementsAbslHashCorrectly) {
585585
EXPECT_EQ(
586586
absl::HashOf(Type::Field(
587587
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindMessageTypeByName(
588-
"google.api.expr.test.v1.proto3.TestAllTypes"))
588+
"cel.expr.conformance.proto3.TestAllTypes"))
589589
->FindFieldByName("repeated_int64"))),
590590
absl::HashOf(Type(ListType(&arena, IntType()))));
591591
EXPECT_EQ(Type::Field(ABSL_DIE_IF_NULL(
592592
GetTestingDescriptorPool()->FindMessageTypeByName(
593-
"google.api.expr.test.v1.proto3.TestAllTypes"))
593+
"cel.expr.conformance.proto3.TestAllTypes"))
594594
->FindFieldByName("repeated_int64")),
595595
Type(ListType(&arena, IntType())));
596596

597597
EXPECT_EQ(
598598
absl::HashOf(Type::Field(
599599
ABSL_DIE_IF_NULL(GetTestingDescriptorPool()->FindMessageTypeByName(
600-
"google.api.expr.test.v1.proto3.TestAllTypes"))
600+
"cel.expr.conformance.proto3.TestAllTypes"))
601601
->FindFieldByName("map_int64_int64"))),
602602
absl::HashOf(Type(MapType(&arena, IntType(), IntType()))));
603603
EXPECT_EQ(Type::Field(ABSL_DIE_IF_NULL(
604604
GetTestingDescriptorPool()->FindMessageTypeByName(
605-
"google.api.expr.test.v1.proto3.TestAllTypes"))
605+
"cel.expr.conformance.proto3.TestAllTypes"))
606606
->FindFieldByName("map_int64_int64")),
607607
Type(MapType(&arena, IntType(), IntType())));
608608

609609
EXPECT_EQ(absl::HashOf(Type(MessageType(ABSL_DIE_IF_NULL(
610610
GetTestingDescriptorPool()->FindMessageTypeByName(
611-
"google.api.expr.test.v1.proto3.TestAllTypes"))))),
611+
"cel.expr.conformance.proto3.TestAllTypes"))))),
612612
absl::HashOf(Type(StructType(common_internal::MakeBasicStructType(
613-
"google.api.expr.test.v1.proto3.TestAllTypes")))));
613+
"cel.expr.conformance.proto3.TestAllTypes")))));
614614
EXPECT_EQ(Type(MessageType(ABSL_DIE_IF_NULL(
615615
GetTestingDescriptorPool()->FindMessageTypeByName(
616-
"google.api.expr.test.v1.proto3.TestAllTypes")))),
616+
"cel.expr.conformance.proto3.TestAllTypes")))),
617617
Type(StructType(common_internal::MakeBasicStructType(
618-
"google.api.expr.test.v1.proto3.TestAllTypes"))));
618+
"cel.expr.conformance.proto3.TestAllTypes"))));
619619
}
620620

621621
TEST(Type, Unwrap) {

common/types/type_pool_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ TEST(TypePool, MakeStructType) {
3131
EXPECT_EQ(type_pool.MakeStructType("foo.Bar"),
3232
MakeBasicStructType("foo.Bar"));
3333
EXPECT_TRUE(
34-
type_pool.MakeStructType("google.api.expr.test.v1.proto3.TestAllTypes")
34+
type_pool.MakeStructType("cel.expr.conformance.proto3.TestAllTypes")
3535
.IsMessage());
3636
EXPECT_DEBUG_DEATH(
3737
static_cast<void>(type_pool.MakeStructType("google.protobuf.BoolValue")),

common/value_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "internal/testing.h"
3131
#include "internal/testing_descriptor_pool.h"
3232
#include "internal/testing_message_factory.h"
33-
#include "proto/test/v1/proto3/test_all_types.pb.h"
33+
#include "proto/cel/expr/conformance/proto3/test_all_types.pb.h"
3434
#include "google/protobuf/arena.h"
3535
#include "google/protobuf/descriptor.h"
3636
#include "google/protobuf/generated_enum_reflection.h"
@@ -48,7 +48,7 @@ using ::testing::Eq;
4848
using ::testing::NotNull;
4949
using ::testing::Optional;
5050

51-
using TestAllTypesProto3 = ::google::api::expr::test::v1::proto3::TestAllTypes;
51+
using TestAllTypesProto3 = ::cel::expr::conformance::proto3::TestAllTypes;
5252

5353
TEST(Value, KindDebugDeath) {
5454
Value value;

common/values/message_value_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "internal/testing.h"
3232
#include "internal/testing_descriptor_pool.h"
3333
#include "internal/testing_message_factory.h"
34-
#include "proto/test/v1/proto3/test_all_types.pb.h"
34+
#include "proto/cel/expr/conformance/proto3/test_all_types.pb.h"
3535
#include "google/protobuf/arena.h"
3636
#include "google/protobuf/descriptor.h"
3737
#include "google/protobuf/message.h"
@@ -48,7 +48,7 @@ using ::testing::Optional;
4848
using ::testing::PrintToStringParamName;
4949
using ::testing::TestWithParam;
5050

51-
using TestAllTypesProto3 = ::google::api::expr::test::v1::proto3::TestAllTypes;
51+
using TestAllTypesProto3 = ::cel::expr::conformance::proto3::TestAllTypes;
5252

5353
class MessageValueTest : public TestWithParam<AllocatorKind> {
5454
public:
@@ -179,7 +179,7 @@ TEST_P(MessageValueTest, GetTypeName) {
179179
MessageValue value(
180180
ParsedMessageValue(DynamicParseTextProto<TestAllTypesProto3>(
181181
allocator(), R"pb()pb", descriptor_pool(), message_factory())));
182-
EXPECT_EQ(value.GetTypeName(), "google.api.expr.test.v1.proto3.TestAllTypes");
182+
EXPECT_EQ(value.GetTypeName(), "cel.expr.conformance.proto3.TestAllTypes");
183183
}
184184

185185
TEST_P(MessageValueTest, GetRuntimeType) {

common/values/parsed_json_list_value_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "internal/testing.h"
3737
#include "internal/testing_descriptor_pool.h"
3838
#include "internal/testing_message_factory.h"
39-
#include "proto/test/v1/proto3/test_all_types.pb.h"
39+
#include "proto/cel/expr/conformance/proto3/test_all_types.pb.h"
4040
#include "google/protobuf/arena.h"
4141
#include "google/protobuf/descriptor.h"
4242
#include "google/protobuf/message.h"
@@ -58,7 +58,7 @@ using ::testing::PrintToStringParamName;
5858
using ::testing::TestWithParam;
5959
using ::testing::VariantWith;
6060

61-
using TestAllTypesProto3 = ::google::api::expr::test::v1::proto3::TestAllTypes;
61+
using TestAllTypesProto3 = ::cel::expr::conformance::proto3::TestAllTypes;
6262

6363
class ParsedJsonListValueTest : public TestWithParam<AllocatorKind> {
6464
public:

0 commit comments

Comments
 (0)