From b20e139ce99ce0eef9346b2c01c21e709a718d93 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Wed, 27 Mar 2024 10:57:31 -0400 Subject: [PATCH] Update proto files from upstream. The conformance tests seem to have gotten some proto changes. This skips all the files upstream converted to editions syntax. Using upstream 83ec410d3005e850d5a8ef79e389b71ab7eebce6 --- .../protobuf/test_messages_proto2.proto | 12 ++ .../google/protobuf/descriptor.proto | 2 + .../upstream/google/protobuf/descriptor.proto | 2 + .../protobuf/test_messages_proto2.proto | 12 ++ .../google/protobuf/unittest_features.proto | 131 +++++++----------- 5 files changed, 75 insertions(+), 84 deletions(-) diff --git a/Protos/Conformance/google/protobuf/test_messages_proto2.proto b/Protos/Conformance/google/protobuf/test_messages_proto2.proto index 45efa7ff1..73cba558c 100644 --- a/Protos/Conformance/google/protobuf/test_messages_proto2.proto +++ b/Protos/Conformance/google/protobuf/test_messages_proto2.proto @@ -173,6 +173,11 @@ message TestAllTypesProto2 { optional uint32 group_uint32 = 203; } + optional group MultiWordGroupField = 204 { + optional int32 group_int32 = 205; + optional uint32 group_uint32 = 206; + } + // default values optional int32 default_int32 = 241 [default = -123456789]; optional int64 default_int64 = 242 [default = -9123456789123456789]; @@ -250,6 +255,13 @@ extend TestAllTypesProto2 { optional int32 extension_int32 = 120; } +extend TestAllTypesProto2 { + optional group GroupField = 121 { + optional int32 group_int32 = 122; + optional uint32 group_uint32 = 123; + } +} + message UnknownToTestAllTypes { optional int32 optional_int32 = 1001; optional string optional_string = 1002; diff --git a/Protos/SwiftProtobuf/google/protobuf/descriptor.proto b/Protos/SwiftProtobuf/google/protobuf/descriptor.proto index 6805b9b4b..cfd2cd4eb 100644 --- a/Protos/SwiftProtobuf/google/protobuf/descriptor.proto +++ b/Protos/SwiftProtobuf/google/protobuf/descriptor.proto @@ -1020,6 +1020,8 @@ message FeatureSet { extensions 1001; // for Protobuf Java extensions 1002; // for Protobuf Go + extensions 9990; // for deprecated Java Proto1 + extensions 9995 to 9999; // For internal testing extensions 10000; // for https://github.com/bufbuild/protobuf-es } diff --git a/Protos/upstream/google/protobuf/descriptor.proto b/Protos/upstream/google/protobuf/descriptor.proto index 6805b9b4b..cfd2cd4eb 100644 --- a/Protos/upstream/google/protobuf/descriptor.proto +++ b/Protos/upstream/google/protobuf/descriptor.proto @@ -1020,6 +1020,8 @@ message FeatureSet { extensions 1001; // for Protobuf Java extensions 1002; // for Protobuf Go + extensions 9990; // for deprecated Java Proto1 + extensions 9995 to 9999; // For internal testing extensions 10000; // for https://github.com/bufbuild/protobuf-es } diff --git a/Protos/upstream/google/protobuf/test_messages_proto2.proto b/Protos/upstream/google/protobuf/test_messages_proto2.proto index 45efa7ff1..73cba558c 100644 --- a/Protos/upstream/google/protobuf/test_messages_proto2.proto +++ b/Protos/upstream/google/protobuf/test_messages_proto2.proto @@ -173,6 +173,11 @@ message TestAllTypesProto2 { optional uint32 group_uint32 = 203; } + optional group MultiWordGroupField = 204 { + optional int32 group_int32 = 205; + optional uint32 group_uint32 = 206; + } + // default values optional int32 default_int32 = 241 [default = -123456789]; optional int64 default_int64 = 242 [default = -9123456789123456789]; @@ -250,6 +255,13 @@ extend TestAllTypesProto2 { optional int32 extension_int32 = 120; } +extend TestAllTypesProto2 { + optional group GroupField = 121 { + optional int32 group_int32 = 122; + optional uint32 group_uint32 = 123; + } +} + message UnknownToTestAllTypes { optional int32 optional_int32 = 1001; optional string optional_string = 1002; diff --git a/Protos/upstream/google/protobuf/unittest_features.proto b/Protos/upstream/google/protobuf/unittest_features.proto index c5a36e4be..6814bcc53 100644 --- a/Protos/upstream/google/protobuf/unittest_features.proto +++ b/Protos/upstream/google/protobuf/unittest_features.proto @@ -26,57 +26,76 @@ message TestMessage { } } +enum EnumFeature { + TEST_ENUM_FEATURE_UNKNOWN = 0; + VALUE1 = 1; + VALUE2 = 2; + VALUE3 = 3; + VALUE4 = 4; + VALUE5 = 5; + VALUE6 = 6; + VALUE7 = 7; + VALUE8 = 8; + VALUE9 = 9; + VALUE10 = 10; + VALUE11 = 11; + VALUE12 = 12; + VALUE13 = 13; + VALUE14 = 14; + VALUE15 = 15; +} + message TestFeatures { - optional int32 int_file_feature = 1 [ + optional EnumFeature file_feature = 1 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "-2" }, - edition_defaults = { edition: EDITION_PROTO3, value: "-3" }, - edition_defaults = { edition: EDITION_2023, value: "1" }, - edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "2" }, - edition_defaults = { edition: EDITION_99998_TEST_ONLY, value: "3" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }, + edition_defaults = { edition: EDITION_PROTO3, value: "VALUE2" }, + edition_defaults = { edition: EDITION_2023, value: "VALUE3" }, + edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "VALUE4" }, + edition_defaults = { edition: EDITION_99998_TEST_ONLY, value: "VALUE5" } ]; - optional int32 int_extension_range_feature = 2 [ + optional EnumFeature extension_range_feature = 2 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_EXTENSION_RANGE, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional int32 int_message_feature = 3 [ + optional EnumFeature message_feature = 3 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional int32 int_field_feature = 4 [ + optional EnumFeature field_feature = 4 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional int32 int_oneof_feature = 5 [ + optional EnumFeature oneof_feature = 5 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ONEOF, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional int32 int_enum_feature = 6 [ + optional EnumFeature enum_feature = 6 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional int32 int_enum_entry_feature = 7 [ + optional EnumFeature enum_entry_feature = 7 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM_ENTRY, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional int32 int_service_feature = 8 [ + optional EnumFeature service_feature = 8 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_SERVICE, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional int32 int_method_feature = 9 [ + optional EnumFeature method_feature = 9 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_METHOD, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional int32 int_multiple_feature = 10 [ + optional EnumFeature multiple_feature = 10 [ retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_FIELD, @@ -87,7 +106,7 @@ message TestFeatures { targets = TARGET_TYPE_METHOD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_EXTENSION_RANGE, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; optional bool bool_field_feature = 11 [ @@ -96,64 +115,8 @@ message TestFeatures { edition_defaults = { edition: EDITION_PROTO2, value: "false" }, edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "true" } ]; - optional float float_field_feature = 12 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - edition_defaults = { edition: EDITION_PROTO2, value: "1.1" }, - edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "1.2" } - ]; - - message MessageFeature { - optional bool bool_field = 1; - optional int32 int_field = 2; - optional float float_field = 3; - optional string string_field = 4; - } - optional MessageFeature message_field_feature = 13 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - edition_defaults = { - edition: EDITION_99997_TEST_ONLY, - value: "int_field: 2" - }, - edition_defaults = { - edition: EDITION_99998_TEST_ONLY, - value: "string_field: '2024'" - }, - edition_defaults = { - edition: EDITION_2023, - value: "bool_field: true int_field: 1 float_field: 1.5 string_field: '2023'" - }, - edition_defaults = { edition: EDITION_PROTO2, value: "" } - ]; - - enum EnumFeature { - TEST_ENUM_FEATURE_UNKNOWN = 0; - ENUM_VALUE1 = 1; - ENUM_VALUE2 = 2; - ENUM_VALUE3 = 3; - ENUM_VALUE4 = 4; - ENUM_VALUE5 = 5; - } - optional EnumFeature enum_field_feature = 14 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - edition_defaults = { - edition: EDITION_PROTO2, - value: "TEST_ENUM_FEATURE_UNKNOWN" - }, - edition_defaults = { edition: EDITION_2023, value: "ENUM_VALUE1" }, - edition_defaults = { - edition: EDITION_99997_TEST_ONLY, - value: "ENUM_VALUE2" - }, - edition_defaults = { - edition: EDITION_99998_TEST_ONLY, - value: "ENUM_VALUE3" - } - ]; - optional int32 int_source_feature = 15 [ + optional EnumFeature source_feature = 15 [ retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_FIELD, @@ -164,10 +127,10 @@ message TestFeatures { targets = TARGET_TYPE_METHOD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_EXTENSION_RANGE, - edition_defaults = { edition: EDITION_PROTO2, value: "1" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; - optional string string_source_feature = 16 [ + optional EnumFeature source_feature2 = 16 [ retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_FIELD, @@ -178,6 +141,6 @@ message TestFeatures { targets = TARGET_TYPE_METHOD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_EXTENSION_RANGE, - edition_defaults = { edition: EDITION_PROTO2, value: "'2023'" } + edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" } ]; }