Skip to content

Commit

Permalink
Merge pull request #2663 from square/bquenaudon.2023-10-05.protobufbump
Browse files Browse the repository at this point in the history
Update google protobuf files
  • Loading branch information
oldergod authored Oct 5, 2023
2 parents b819c3e + 5c0b251 commit fc7e563
Showing 1 changed file with 41 additions and 45 deletions.
86 changes: 41 additions & 45 deletions wire-schema/src/jvmMain/resources/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ enum Edition {
// A placeholder for an unknown edition value.
EDITION_UNKNOWN = 0;

// Legacy syntax "editions". These pre-date editions, but behave much like
// distinct editions. These can't be used to specify the edition of proto
// files, but feature definitions must supply proto2/proto3 defaults for
// backwards compatibility.
EDITION_PROTO2 = 998;
EDITION_PROTO3 = 999;

// Editions that have been released. The specific values are arbitrary and
// should not be depended on, but they will always be time-ordered for easy
// comparison.
Expand Down Expand Up @@ -109,9 +116,8 @@ message FileDescriptorProto {
// If `edition` is present, this value must be "editions".
optional string syntax = 12;

// The edition of the proto file, which is an opaque string.
// TODO(b/297898292) Deprecate and remove this field in favor of enums.
optional string edition = 13;
// The edition of the proto file.
optional Edition edition = 14;
}

// Describes a message type.
Expand Down Expand Up @@ -194,7 +200,7 @@ message ExtensionRangeOptions {
}

// The verification state of the range.
// TODO(b/278783756): flip the default to DECLARATION once all empty ranges
// TODO: flip the default to DECLARATION once all empty ranges
// are marked as UNVERIFIED.
optional VerificationState verification = 3 [default = UNVERIFIED];

Expand Down Expand Up @@ -594,7 +600,7 @@ message MessageOptions {
// This should only be used as a temporary measure against broken builds due
// to the change in behavior for JSON field name conflicts.
//
// TODO(b/261750190) This is legacy behavior we plan to remove once downstream
// TODO This is legacy behavior we plan to remove once downstream
// teams have had time to migrate.
optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];

Expand Down Expand Up @@ -741,9 +747,7 @@ message FieldOptions {
repeated OptionTargetType targets = 19;

message EditionDefault {
// TODO(b/297898292) Deprecate and remove this field in favor of enums.
optional string edition = 1;
optional Edition edition_enum = 3;
optional Edition edition = 3;
optional string value = 2; // Textproto value.
}
repeated EditionDefault edition_defaults = 20;
Expand Down Expand Up @@ -790,7 +794,7 @@ message EnumOptions {
// and strips underscored from the fields before comparison in proto3 only.
// The new behavior takes `json_name` into account and applies to proto2 as
// well.
// TODO(b/261750190) Remove this legacy behavior once downstream teams have
// TODO Remove this legacy behavior once downstream teams have
// had time to migrate.
optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];

Expand Down Expand Up @@ -914,7 +918,7 @@ message UninterpretedOption {
// ===================================================================
// Features

// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are
// TODO Enums in C++ gencode (and potentially other languages) are
// not well scoped. This means that each of the feature enums below can clash
// with each other. The short names we've chosen maximize call-site
// readability, but leave us very open to this scenario. A future feature will
Expand All @@ -931,11 +935,9 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "EXPLICIT"
}
edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" },
edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" },
edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" }
];

enum EnumType {
Expand All @@ -947,11 +949,8 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "OPEN"
}
edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" },
edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" }
];

enum RepeatedFieldEncoding {
Expand All @@ -963,11 +962,21 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "PACKED"
}
edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" },
edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" }
];

enum Utf8Validation {
UTF8_VALIDATION_UNKNOWN = 0;
UNVERIFIED = 1;
VERIFY = 2;
}
optional Utf8Validation utf8_validation = 4 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = { edition: EDITION_PROTO2, value: "UNVERIFIED" },
edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" }
];

enum MessageEncoding {
Expand All @@ -979,11 +988,7 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "LENGTH_PREFIXED"
}
edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" }
];

enum JsonFormat {
Expand All @@ -996,14 +1001,11 @@ message FeatureSet {
targets = TARGET_TYPE_MESSAGE,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "ALLOW"
}
edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" },
edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" }
];

reserved 4, 999;
reserved 999;

extensions 1000; // for Protobuf C++
extensions 1001; // for Protobuf Java
Expand All @@ -1021,24 +1023,18 @@ message FeatureSetDefaults {
// the defaults at the closest matching edition ordered at or before it should
// be used. This field must be in strict ascending order by edition.
message FeatureSetEditionDefault {
// TODO(b/297898292) Deprecate and remove this field in favor of enums.
optional string edition = 1;
optional Edition edition_enum = 3;
optional Edition edition = 3;
optional FeatureSet features = 2;
}
repeated FeatureSetEditionDefault defaults = 1;

// TODO(b/297898292) Deprecate and remove these fields in favor of enums.
optional string minimum_edition = 2;
optional string maximum_edition = 3;

// The minimum supported edition (inclusive) when this was constructed.
// Editions before this will not have defaults.
optional Edition minimum_edition_enum = 4;
optional Edition minimum_edition = 4;

// The maximum known edition (inclusive) when this was constructed. Editions
// after this will not have reliable defaults.
optional Edition maximum_edition_enum = 5;
optional Edition maximum_edition = 5;
}

// ===================================================================
Expand Down

0 comments on commit fc7e563

Please sign in to comment.