forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/api: support fully-qualified type names in
*.proto
files (env…
…oyproxy#10774) tools/api should support fully-qualified type names in *.proto files Risk Level: Low Testing: manual Docs Changes: N/A Release Notes: N/A Fixes: envoyproxy#10755 Signed-off-by: Yaroslav Skopets <[email protected]>
- Loading branch information
Showing
9 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tools/testdata/protoxform/envoy/v2/fully_qualified_names.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.v2; | ||
|
||
import "envoy/api/v2/core/base.proto"; | ||
|
||
import "tools/testdata/protoxform/external/root_type.proto"; | ||
import "tools/testdata/protoxform/external/package_type.proto"; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
import "udpa/annotations/migrate.proto"; | ||
import "udpa/annotations/status.proto"; | ||
|
||
option (udpa.annotations.file_migrate).move_to_package = "envoy.external.v3"; | ||
option (udpa.annotations.file_status).package_version_status = ACTIVE; | ||
|
||
// Verifies normalization of fully-qualified type names. | ||
message UsesFullyQualifiedTypeNames { | ||
|
||
envoy.api.v2.core.Locality another_envoy_type = 1; | ||
.envoy.api.v2.core.Locality another_envoy_type_fqn = 2; | ||
|
||
google.protobuf.Any google_protobuf_any = 3; | ||
.google.protobuf.Any google_protobuf_any_fqn = 4; | ||
|
||
external.PackageLevelType external_package_level_type = 5; | ||
.external.PackageLevelType external_package_level_type_fqn = 6; | ||
|
||
.RootLevelType external_root_level_type_fqn = 7; | ||
} |
37 changes: 37 additions & 0 deletions
37
tools/testdata/protoxform/envoy/v2/fully_qualified_names.proto.active_or_frozen.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.v2; | ||
|
||
import "envoy/api/v2/core/base.proto"; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
import "tools/testdata/protoxform/external/package_type.proto"; | ||
import "tools/testdata/protoxform/external/root_type.proto"; | ||
|
||
import "udpa/annotations/migrate.proto"; | ||
import "udpa/annotations/status.proto"; | ||
|
||
option java_package = "io.envoyproxy.envoy.v2"; | ||
option java_outer_classname = "FullyQualifiedNamesProto"; | ||
option java_multiple_files = true; | ||
option (udpa.annotations.file_migrate).move_to_package = "envoy.external.v3"; | ||
option (udpa.annotations.file_status).package_version_status = ACTIVE; | ||
|
||
// Verifies normalization of fully-qualified type names. | ||
// [#next-free-field: 8] | ||
message UsesFullyQualifiedTypeNames { | ||
api.v2.core.Locality another_envoy_type = 1; | ||
|
||
api.v2.core.Locality another_envoy_type_fqn = 2; | ||
|
||
google.protobuf.Any google_protobuf_any = 3; | ||
|
||
google.protobuf.Any google_protobuf_any_fqn = 4; | ||
|
||
external.PackageLevelType external_package_level_type = 5; | ||
|
||
external.PackageLevelType external_package_level_type_fqn = 6; | ||
|
||
.RootLevelType external_root_level_type_fqn = 7; | ||
} |
39 changes: 39 additions & 0 deletions
39
...orm/envoy/v2/fully_qualified_names.proto.next_major_version_candidate.envoy_internal.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.external.v3; | ||
|
||
import "envoy/api/v2/core/base.proto"; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
import "tools/testdata/protoxform/external/package_type.proto"; | ||
import "tools/testdata/protoxform/external/root_type.proto"; | ||
|
||
import "udpa/annotations/status.proto"; | ||
import "udpa/annotations/versioning.proto"; | ||
|
||
option java_package = "io.envoyproxy.envoy.external.v3"; | ||
option java_outer_classname = "FullyQualifiedNamesProto"; | ||
option java_multiple_files = true; | ||
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; | ||
|
||
// Verifies normalization of fully-qualified type names. | ||
// [#next-free-field: 8] | ||
message UsesFullyQualifiedTypeNames { | ||
option (udpa.annotations.versioning).previous_message_type = | ||
"envoy.v2.UsesFullyQualifiedTypeNames"; | ||
|
||
api.v2.core.Locality another_envoy_type = 1; | ||
|
||
api.v2.core.Locality another_envoy_type_fqn = 2; | ||
|
||
google.protobuf.Any google_protobuf_any = 3; | ||
|
||
google.protobuf.Any google_protobuf_any_fqn = 4; | ||
|
||
.external.PackageLevelType external_package_level_type = 5; | ||
|
||
.external.PackageLevelType external_package_level_type_fqn = 6; | ||
|
||
.RootLevelType external_root_level_type_fqn = 7; | ||
} |
39 changes: 39 additions & 0 deletions
39
...estdata/protoxform/envoy/v2/fully_qualified_names.proto.next_major_version_candidate.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.external.v3; | ||
|
||
import "envoy/api/v2/core/base.proto"; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
import "tools/testdata/protoxform/external/package_type.proto"; | ||
import "tools/testdata/protoxform/external/root_type.proto"; | ||
|
||
import "udpa/annotations/status.proto"; | ||
import "udpa/annotations/versioning.proto"; | ||
|
||
option java_package = "io.envoyproxy.envoy.external.v3"; | ||
option java_outer_classname = "FullyQualifiedNamesProto"; | ||
option java_multiple_files = true; | ||
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; | ||
|
||
// Verifies normalization of fully-qualified type names. | ||
// [#next-free-field: 8] | ||
message UsesFullyQualifiedTypeNames { | ||
option (udpa.annotations.versioning).previous_message_type = | ||
"envoy.v2.UsesFullyQualifiedTypeNames"; | ||
|
||
api.v2.core.Locality another_envoy_type = 1; | ||
|
||
api.v2.core.Locality another_envoy_type_fqn = 2; | ||
|
||
google.protobuf.Any google_protobuf_any = 3; | ||
|
||
google.protobuf.Any google_protobuf_any_fqn = 4; | ||
|
||
.external.PackageLevelType external_package_level_type = 5; | ||
|
||
.external.PackageLevelType external_package_level_type_fqn = 6; | ||
|
||
.RootLevelType external_root_level_type_fqn = 7; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
proto_library( | ||
name = "external_protos", | ||
srcs = [ | ||
"package_type.proto", | ||
"root_type.proto", | ||
], | ||
visibility = ["//visibility:public"], | ||
deps = [], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
syntax = "proto3"; | ||
|
||
package external; | ||
|
||
// Type that belongs to a non-envoy package. | ||
// | ||
// Part of a test suite that verifies normalization of | ||
// fully-qualified type names. | ||
message PackageLevelType { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
syntax = "proto3"; | ||
|
||
// Type that doesn't belong to any package. | ||
// | ||
// Part of a test suite that verifies normalization of | ||
// fully-qualified type names. | ||
message RootLevelType { | ||
} |