Skip to content

Commit

Permalink
Bump github.com/jhump/protoreflect from 1.14.1 to 1.15.0 (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Feb 27, 2023
1 parent 52c2655 commit 7ccff88
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 131 deletions.
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ go 1.19

require (
github.com/bufbuild/connect-go v1.5.2
github.com/bufbuild/protocompile v0.2.0
github.com/bufbuild/protocompile v0.2.1-0.20230123224550-da57cd758c2f
github.com/docker/docker v23.0.1+incompatible
github.com/go-chi/chi/v5 v5.0.8
github.com/gofrs/flock v0.8.1
github.com/gofrs/uuid v4.4.0+incompatible
github.com/google/go-cmp v0.5.9
github.com/google/go-containerregistry v0.13.0
github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84
github.com/jhump/protoreflect v1.14.1
github.com/jhump/protoreflect v1.15.0
github.com/klauspost/compress v1.16.0
github.com/klauspost/pgzip v1.2.5
github.com/oklog/ulid/v2 v2.1.0
Expand Down Expand Up @@ -57,6 +57,7 @@ require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/morikuni/aec v1.0.0 // indirect
Expand Down
94 changes: 12 additions & 82 deletions go.sum

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion private/bufpkg/bufimage/bufimageutil/bufimageutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild"
"github.com/bufbuild/buf/private/bufpkg/bufmodule"
"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref"
"github.com/bufbuild/buf/private/pkg/protoencoding"
"github.com/bufbuild/buf/private/pkg/storage"
"github.com/bufbuild/buf/private/pkg/storage/storagemem"
"github.com/bufbuild/buf/private/pkg/storage/storageos"
Expand Down Expand Up @@ -231,7 +232,20 @@ func runDiffTest(t *testing.T, testdataDir string, typenames []string, expectedF
assert.NotNil(t, image)
assert.True(t, imageIsDependencyOrdered(filteredImage), "image files not in dependency order")

reflectDescriptors, err := desc.CreateFileDescriptorsFromSet(bufimage.ImageToFileDescriptorSet(filteredImage))
// We may have filtered out custom options from the set in the step above. However, the options messages
// still contain extension fields that refer to the custom options, as a result of building the image.
// So we serialize and then de-serialize, and use only the filtered results to parse extensions. That
// way, the result will omit custom options that aren't present in the filtered set (as they will be
// considered unrecognized fields).
resolver, err := protoencoding.NewResolver(bufimage.ImageToFileDescriptors(filteredImage)...)
require.NoError(t, err)
data, err := proto.Marshal(bufimage.ImageToFileDescriptorSet(filteredImage))
require.NoError(t, err)
fileDescriptorSet := &descriptorpb.FileDescriptorSet{}
err = proto.UnmarshalOptions{Resolver: resolver}.Unmarshal(data, fileDescriptorSet)
require.NoError(t, err)

reflectDescriptors, err := desc.CreateFileDescriptorsFromSet(fileDescriptorSet)
require.NoError(t, err)
archive := &txtar.Archive{}
printer := protoprint.Printer{
Expand Down
3 changes: 1 addition & 2 deletions private/bufpkg/bufimage/bufimageutil/testdata/any/c1.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import "a.proto";
import "b.proto";
message ExtendedAnySyntax {
option (extra) = {
type_url: "type.googleapis.com/foo.bar.baz.Foo"
value: "\n\nBob Loblaw\020*"
[type.googleapis.com/foo.bar.baz.Foo]: { name: "Bob Loblaw", id: 42 }
};
}
-- google/protobuf/any.proto --
Expand Down
4 changes: 3 additions & 1 deletion private/bufpkg/bufimage/bufimageutil/testdata/any/c2.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import "a.proto";
import "b.proto";
message ExtendedAnySyntax_InField {
option (extra_in_field) = {
any:<type_url:"type.googleapis.com/foo.bar.baz.Foo" value:"\n\nBob Loblaw\020*" >
any: {
[type.googleapis.com/foo.bar.baz.Foo]: { name: "Bob Loblaw", id: 42 }
}
};
}
-- google/protobuf/any.proto --
Expand Down
9 changes: 8 additions & 1 deletion private/bufpkg/bufimage/bufimageutil/testdata/any/c3.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ import "a.proto";
import "b.proto";
message ExtendedAnySyntax_InList {
option (extra_in_list) = {
list_any:<type_url:"type.googleapis.com/ExtendedAnySyntax_InList" > list_any:<type_url:"type.googleapis.com/foo.bar.baz.Foo" value:"\n\nBob Loblaw\020*" >
list_any: [
{
[type.googleapis.com/ExtendedAnySyntax_InList]: { }
},
{
[type.googleapis.com/foo.bar.baz.Foo]: { name: "Bob Loblaw", id: 42 }
}
]
};
}
-- google/protobuf/any.proto --
Expand Down
19 changes: 18 additions & 1 deletion private/bufpkg/bufimage/bufimageutil/testdata/any/c4.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,24 @@ import "a.proto";
import "b.proto";
message ExtendedAnySyntax_InMap {
option (extra_in_map) = {
map:<key:"bar" value:<any:<type_url:"type.googleapis.com/foo.bar.baz.Foo" value:"\n\nBob Loblaw\020*" >>> map:<key:"foo" value:<any:<type_url:"type.googleapis.com/ExtendedAnySyntax_InMap" >>>
map: [
{
key: "bar",
value: {
any: {
[type.googleapis.com/foo.bar.baz.Foo]: { name: "Bob Loblaw", id: 42 }
}
}
},
{
key: "foo",
value: {
any: {
[type.googleapis.com/ExtendedAnySyntax_InMap]: { }
}
}
}
]
};
}
-- google/protobuf/any.proto --
Expand Down
3 changes: 1 addition & 2 deletions private/bufpkg/bufimage/bufimageutil/testdata/any/d.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import "a.proto";
import "b.proto";
message NormalMessageSyntaxValidType {
option (extra) = {
type_url: "type.googleapis.com/foo.bar.baz.Foo"
value: "\n\nBob Loblaw\020*"
[type.googleapis.com/foo.bar.baz.Foo]: { name: "Bob Loblaw", id: 42 }
};
}
-- google/protobuf/any.proto --
Expand Down
5 changes: 1 addition & 4 deletions private/bufpkg/bufimage/bufimageutil/testdata/any/e.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ extend google.protobuf.MessageOptions {
syntax = "proto3";
import "a.proto";
message NormalMessageSyntaxInvalidType {
option (extra) = {
type_url: "type.googleapis.com/blah.blah.Blah"
value: "\001\002\003\004"
};
option (extra) = { type_url: "type.googleapis.com/blah.blah.Blah", value: "\001\002\003\004" };
}
-- google/protobuf/any.proto --
syntax = "proto3";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ syntax = "proto2";
package pkg;
import "options.proto";
option (UsedOption.file_baz) = "str";
option (UsedOption.file_foo) = { foo:"str" };
option (UsedOption.file_foo) = { foo: "str" };
message Empty {
}
message Foo {
option (message_baz) = "str";
option (message_foo) = { foo:"str" };
option (message_foo) = { foo: "str" };
optional string foo = 1 [
jstype = JS_STRING,
(field_baz) = "str",
(field_foo) = { foo:"str" }
(field_foo) = { foo: "str" }
];
oneof testOneof {
option (oneof_baz) = "str";
option (oneof_foo) = { foo:"str" };
option (oneof_foo) = { foo: "str" };
string bar = 2;
bytes baz = 3;
}
Expand All @@ -25,27 +25,27 @@ message Foo {
enum FooEnum {
option deprecated = true;
option (enum_baz) = "str";
option (enum_foo) = { foo:"str" };
option (enum_foo) = { foo: "str" };
FOO_ENUM_X = 0;
FOO_ENUM_Y = 1 [
(enum_value_baz) = "str",
(enum_value_foo) = { foo:"str" }
(enum_value_foo) = { foo: "str" }
];
}
service FooService {
option (service_baz) = "str";
option (service_foo) = { foo:"str" };
option (service_foo) = { foo: "str" };
rpc Do ( Empty ) returns ( Empty ) {
option (method_baz) = "str";
option (method_foo) = { foo:"str" };
option (method_foo) = { foo: "str" };
}
rpc DoNot ( Empty ) returns ( Empty ) {
option (method_baz) = "str";
option (method_foo) = { foo:"str" };
option (method_foo) = { foo: "str" };
}
}
extend Foo {
optional string extension = 11 [(field_baz) = "str", (field_foo) = { foo:"str" }];
optional string extension = 11 [(field_baz) = "str", (field_foo) = { foo: "str" }];
}
-- google/protobuf/descriptor.proto --
syntax = "proto2";
Expand Down
20 changes: 10 additions & 10 deletions private/bufpkg/bufimage/bufimageutil/testdata/options/all.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ syntax = "proto2";
package pkg;
import "options.proto";
option (UsedOption.file_baz) = "str";
option (UsedOption.file_foo) = { foo:"str" };
option (UsedOption.file_foo) = { foo: "str" };
message Empty {
}
message Foo {
option (message_baz) = "str";
option (message_foo) = { foo:"str" };
option (message_foo) = { foo: "str" };
optional string foo = 1 [
jstype = JS_STRING,
(field_baz) = "str",
(field_foo) = { foo:"str" }
(field_foo) = { foo: "str" }
];
oneof testOneof {
option (oneof_baz) = "str";
option (oneof_foo) = { foo:"str" };
option (oneof_foo) = { foo: "str" };
string bar = 2;
bytes baz = 3;
}
Expand All @@ -25,27 +25,27 @@ message Foo {
enum FooEnum {
option deprecated = true;
option (enum_baz) = "str";
option (enum_foo) = { foo:"str" };
option (enum_foo) = { foo: "str" };
FOO_ENUM_X = 0;
FOO_ENUM_Y = 1 [
(enum_value_baz) = "str",
(enum_value_foo) = { foo:"str" }
(enum_value_foo) = { foo: "str" }
];
}
service FooService {
option (service_baz) = "str";
option (service_foo) = { foo:"str" };
option (service_foo) = { foo: "str" };
rpc Do ( Empty ) returns ( Empty ) {
option (method_baz) = "str";
option (method_foo) = { foo:"str" };
option (method_foo) = { foo: "str" };
}
rpc DoNot ( Empty ) returns ( Empty ) {
option (method_baz) = "str";
option (method_foo) = { foo:"str" };
option (method_foo) = { foo: "str" };
}
}
extend Foo {
optional string extension = 11 [(field_baz) = "str", (field_foo) = { foo:"str" }];
optional string extension = 11 [(field_baz) = "str", (field_foo) = { foo: "str" }];
}
-- google/protobuf/descriptor.proto --
syntax = "proto2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ syntax = "proto2";
package pkg;
import "options.proto";
option (UsedOption.file_baz) = "str";
option (UsedOption.file_foo) = { foo:"str" };
option (UsedOption.file_foo) = { foo: "str" };
message Foo {
option (message_baz) = "str";
option (message_foo) = { foo:"str" };
option (message_foo) = { foo: "str" };
optional string foo = 1 [
jstype = JS_STRING,
(field_baz) = "str",
(field_foo) = { foo:"str" }
(field_foo) = { foo: "str" }
];
oneof testOneof {
option (oneof_baz) = "str";
option (oneof_foo) = { foo:"str" };
option (oneof_foo) = { foo: "str" };
string bar = 2;
bytes baz = 3;
}
extensions 10 to max;
}
extend Foo {
optional string extension = 11 [(field_baz) = "str", (field_foo) = { foo:"str" }];
optional string extension = 11 [(field_baz) = "str", (field_foo) = { foo: "str" }];
}
-- google/protobuf/descriptor.proto --
syntax = "proto2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ syntax = "proto2";
package pkg;
import "options.proto";
option (UsedOption.file_baz) = "str";
option (UsedOption.file_foo) = { foo:"str" };
option (UsedOption.file_foo) = { foo: "str" };
enum FooEnum {
option deprecated = true;
option (enum_baz) = "str";
option (enum_foo) = { foo:"str" };
option (enum_foo) = { foo: "str" };
FOO_ENUM_X = 0;
FOO_ENUM_Y = 1 [
(enum_value_baz) = "str",
(enum_value_foo) = { foo:"str" }
(enum_value_foo) = { foo: "str" }
];
}
-- google/protobuf/descriptor.proto --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ syntax = "proto2";
package pkg;
import "options.proto";
option (UsedOption.file_baz) = "str";
option (UsedOption.file_foo) = { foo:"str" };
option (UsedOption.file_foo) = { foo: "str" };
message Empty {
}
service FooService {
option (service_baz) = "str";
option (service_foo) = { foo:"str" };
option (service_foo) = { foo: "str" };
rpc Do ( Empty ) returns ( Empty ) {
option (method_baz) = "str";
option (method_foo) = { foo:"str" };
option (method_foo) = { foo: "str" };
}
}
-- google/protobuf/descriptor.proto --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ syntax = "proto2";
package pkg;
import "options.proto";
option (UsedOption.file_baz) = "str";
option (UsedOption.file_foo) = { foo:"str" };
option (UsedOption.file_foo) = { foo: "str" };
message Empty {
}
service FooService {
option (service_baz) = "str";
option (service_foo) = { foo:"str" };
option (service_foo) = { foo: "str" };
rpc Do ( Empty ) returns ( Empty ) {
option (method_baz) = "str";
option (method_foo) = { foo:"str" };
option (method_foo) = { foo: "str" };
}
rpc DoNot ( Empty ) returns ( Empty ) {
option (method_baz) = "str";
option (method_foo) = { foo:"str" };
option (method_foo) = { foo: "str" };
}
}
-- google/protobuf/descriptor.proto --
Expand Down

0 comments on commit 7ccff88

Please sign in to comment.