Skip to content

Commit 45e582f

Browse files
authored
Make upgrade (#3803)
1 parent ca3b7f7 commit 45e582f

File tree

13 files changed

+989
-658
lines changed

13 files changed

+989
-658
lines changed

go.mod

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
module github.com/bufbuild/buf
22

3-
go 1.23.4
3+
go 1.23.0
44

55
toolchain go1.24.2
66

77
require (
88
buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.6-20250121211742-6d880cc6cc8d.1
9-
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250307204501-0409229c3780.1
10-
buf.build/gen/go/bufbuild/registry/connectrpc/go v1.18.1-20250423175228-7edf8b09cc2c.1
11-
buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.6-20250423175228-7edf8b09cc2c.1
9+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250425153114-8976f5be98c1.1
10+
buf.build/gen/go/bufbuild/registry/connectrpc/go v1.18.1-20250424215339-a457693b5db4.1
11+
buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.6-20250424215339-a457693b5db4.1
1212
buf.build/go/bufplugin v0.8.0
13-
buf.build/go/protoyaml v0.3.2
13+
buf.build/go/protoyaml v0.5.0
1414
buf.build/go/spdx v0.2.0
1515
connectrpc.com/connect v1.18.1
1616
connectrpc.com/otelconnect v0.7.2
1717
github.com/bufbuild/protocompile v0.14.1
1818
github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1
19-
github.com/bufbuild/protovalidate-go v0.9.3
19+
github.com/bufbuild/protovalidate-go v0.10.0
2020
github.com/docker/docker v28.1.1+incompatible
2121
github.com/go-chi/chi/v5 v5.2.1
2222
github.com/gofrs/flock v0.12.1
23-
github.com/google/cel-go v0.24.1
23+
github.com/google/cel-go v0.25.0
2424
github.com/google/go-cmp v0.7.0
2525
github.com/google/go-containerregistry v0.20.3
2626
github.com/google/uuid v1.6.0
@@ -62,7 +62,7 @@ require (
6262
github.com/containerd/continuity v0.4.5 // indirect
6363
github.com/containerd/log v0.1.0 // indirect
6464
github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
65-
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
65+
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
6666
github.com/davecgh/go-spew v1.1.1 // indirect
6767
github.com/distribution/reference v0.6.0 // indirect
6868
github.com/docker/cli v28.1.1+incompatible // indirect
@@ -76,7 +76,7 @@ require (
7676
github.com/go-logr/stdr v1.2.2 // indirect
7777
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
7878
github.com/gogo/protobuf v1.3.2 // indirect
79-
github.com/google/pprof v0.0.0-20250418163039-24c5476c6587 // indirect
79+
github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4 // indirect
8080
github.com/inconshreveable/mousetrap v1.1.0 // indirect
8181
github.com/mattn/go-isatty v0.0.20 // indirect
8282
github.com/mitchellh/go-homedir v1.1.0 // indirect
@@ -120,6 +120,6 @@ require (
120120
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
121121
golang.org/x/sys v0.32.0 // indirect
122122
golang.org/x/text v0.24.0 // indirect
123-
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e // indirect
124-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
123+
google.golang.org/genproto/googleapis/api v0.0.0-20250425173222-7b384671a197 // indirect
124+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250425173222-7b384671a197 // indirect
125125
)

go.sum

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.6-20250121211742-6d880cc6cc8d.1 h1:f6miF8tK6H+Ktad24WpnNfpHO75GRGk0rhJ1mxPXqgA=
22
buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.6-20250121211742-6d880cc6cc8d.1/go.mod h1:rvbyamNtvJ4o3ExeCmaG5/6iHnu0vy0E+UQ+Ph0om8s=
3-
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250307204501-0409229c3780.1 h1:zgJPqo17m28+Lf5BW4xv3PvU20BnrmTcGYrog22lLIU=
4-
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250307204501-0409229c3780.1/go.mod h1:avRlCjnFzl98VPaeCtJ24RrV/wwHFzB8sWXhj26+n/U=
5-
buf.build/gen/go/bufbuild/registry/connectrpc/go v1.18.1-20250423175228-7edf8b09cc2c.1 h1:fK/q98JITrtqTKbhgE3vkpyyyncSbVo6H6NjFRvYM/4=
6-
buf.build/gen/go/bufbuild/registry/connectrpc/go v1.18.1-20250423175228-7edf8b09cc2c.1/go.mod h1:ChttLy3zSV2LCc5NkxHbz3uMQsWFSo8qrzCKw0Z3ktg=
7-
buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.6-20250423175228-7edf8b09cc2c.1 h1:fCVeN7ikFLE/pt0hjdr4D0MOmguIevtCQxbhWjoAqDE=
8-
buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.6-20250423175228-7edf8b09cc2c.1/go.mod h1:ee69ieBAzwc/oY/Vde0K4r6JWvrk093q4Z/FXexPMmA=
3+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250425153114-8976f5be98c1.1 h1:YhMSc48s25kr7kv31Z8vf7sPUIq5YJva9z1mn/hAt0M=
4+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250425153114-8976f5be98c1.1/go.mod h1:avRlCjnFzl98VPaeCtJ24RrV/wwHFzB8sWXhj26+n/U=
5+
buf.build/gen/go/bufbuild/registry/connectrpc/go v1.18.1-20250424215339-a457693b5db4.1 h1:/xe4ZIu8EIUaWoGeqTVQYzJ/bNMgkWUi706Puwo8A5Q=
6+
buf.build/gen/go/bufbuild/registry/connectrpc/go v1.18.1-20250424215339-a457693b5db4.1/go.mod h1:9bOYLdeGZQKUUP21CviSP1G3U5qpgZ0k5Kn7i9Q9GfY=
7+
buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.6-20250424215339-a457693b5db4.1 h1:/CrSdYpZi1tRhnkUNTY00LE8ro++bHwSBjLcW+dywM8=
8+
buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.6-20250424215339-a457693b5db4.1/go.mod h1:bUPpZtzAkcnTA7OLfKCvkvkxEAC6dG/ZIlbnbUJicL4=
99
buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.6-20241007202033-cf42259fcbfc.1 h1:trcsXBDm8exui7mvndZnvworCyBq1xuMnod2N0j79K8=
1010
buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.6-20241007202033-cf42259fcbfc.1/go.mod h1:OUbhXurY+VHFGn9FBxcRy8UB7HXk9NvJ2qCgifOMypQ=
1111
buf.build/go/bufplugin v0.8.0 h1:YgR1+CNGmzR69jt85oRWTa5FioZoX/tOrHV+JxfNnnk=
1212
buf.build/go/bufplugin v0.8.0/go.mod h1:rcm0Esd3P/GM2rtYTvz3+9Gf8w9zdo7rG8dKSxYHHIE=
13-
buf.build/go/protoyaml v0.3.2 h1:QJF3k7btMameIadLLcK3Rry81OK3gYA5nZMXirV1Bs4=
14-
buf.build/go/protoyaml v0.3.2/go.mod h1:rUlMqwfZeONS/BAt00wB6jV5ay/eHXUzxgiKSIyrvyc=
13+
buf.build/go/protoyaml v0.5.0 h1:RSRm3q3xfnvXF1kWrOo8gFx4jhTH5gG89mvQdWv26hQ=
14+
buf.build/go/protoyaml v0.5.0/go.mod h1:V87bQDLx2+PbaFLFBpBOgEeO7EqejCyi/2wgsGMPp/U=
1515
buf.build/go/spdx v0.2.0 h1:IItqM0/cMxvFJJumcBuP8NrsIzMs/UYjp/6WSpq8LTw=
1616
buf.build/go/spdx v0.2.0/go.mod h1:bXdwQFem9Si3nsbNy8aJKGPoaPi5DKwdeEp5/ArZ6w8=
1717
cel.dev/expr v0.23.1 h1:K4KOtPCJQjVggkARsjG9RWXP6O4R73aHeJMa/dmCQQg=
@@ -32,8 +32,8 @@ github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/
3232
github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c=
3333
github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1 h1:V1xulAoqLqVg44rY97xOR+mQpD2N+GzhMHVwJ030WEU=
3434
github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1/go.mod h1:c5D8gWRIZ2HLWO3gXYTtUfw/hbJyD8xikv2ooPxnklQ=
35-
github.com/bufbuild/protovalidate-go v0.9.3 h1:XvdtwQuppS3wjzGfpOirsqwN5ExH2+PiIuA/XZd3MTM=
36-
github.com/bufbuild/protovalidate-go v0.9.3/go.mod h1:2lUDP6fNd3wxznRNH3Nj64VB07+PySeslamkerwP6tE=
35+
github.com/bufbuild/protovalidate-go v0.10.0 h1:QdaKhfk3/Dnb2soL9mKmuLPstq+ogAwSWCE3sQ1NBEE=
36+
github.com/bufbuild/protovalidate-go v0.10.0/go.mod h1:nIggbFjqS4DxJgSFBhOzH97Pb8SPNceFc5nygg1pOA8=
3737
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
3838
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
3939
github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
@@ -51,8 +51,9 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
5151
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
5252
github.com/containerd/stargz-snapshotter/estargz v0.16.3 h1:7evrXtoh1mSbGj/pfRccTampEyKpjpOnS3CyiV1Ebr8=
5353
github.com/containerd/stargz-snapshotter/estargz v0.16.3/go.mod h1:uyr4BfYfOj3G9WBVE8cOlQmXAbPN9VEQpBBeJIuOipU=
54-
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
5554
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
55+
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
56+
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
5657
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
5758
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
5859
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -95,17 +96,17 @@ github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E=
9596
github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0=
9697
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
9798
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
98-
github.com/google/cel-go v0.24.1 h1:jsBCtxG8mM5wiUJDSGUqU0K7Mtr3w7Eyv00rw4DiZxI=
99-
github.com/google/cel-go v0.24.1/go.mod h1:Hdf9TqOaTNSFQA1ybQaRqATVoK7m/zcf7IMhGXP5zI8=
99+
github.com/google/cel-go v0.25.0 h1:jsFw9Fhn+3y2kBbltZR4VEz5xKkcIFRPDnuEzAGv5GY=
100+
github.com/google/cel-go v0.25.0/go.mod h1:hjEb6r5SuOSlhCHmFoLzu8HGCERvIsDAbxDAyNU/MmI=
100101
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
101102
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
102103
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
103104
github.com/google/go-containerregistry v0.20.3 h1:oNx7IdTI936V8CQRveCjaxOiegWwvM7kqkbXTpyiovI=
104105
github.com/google/go-containerregistry v0.20.3/go.mod h1:w00pIgBRDVUDFM6bq+Qx8lwNWK+cxgCuX1vd3PIBDNI=
105106
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
106107
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
107-
github.com/google/pprof v0.0.0-20250418163039-24c5476c6587 h1:b/8HpQhvKLSNzH5oTXN2WkNcMl6YB5K3FRbb+i+Ml34=
108-
github.com/google/pprof v0.0.0-20250418163039-24c5476c6587/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
108+
github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4 h1:gD0vax+4I+mAj+jEChEf25Ia07Jq7kYOFO5PPhAxFl4=
109+
github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
109110
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
110111
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
111112
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg=
@@ -310,10 +311,10 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
310311
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
311312
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
312313
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
313-
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e h1:UdXH7Kzbj+Vzastr5nVfccbmFsmYNygVLSPk1pEfDoY=
314-
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e/go.mod h1:085qFyf2+XaZlRdCgKNCIZ3afY2p4HHZdoIRpId8F4A=
315-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e h1:ztQaXfzEXTmCBvbtWYRhJxW+0iJcz2qXfd38/e9l7bA=
316-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
314+
google.golang.org/genproto/googleapis/api v0.0.0-20250425173222-7b384671a197 h1:9DuBh3k1jUho2DHdxH+kbJwthIAq02vGvZNrD2ggF+Y=
315+
google.golang.org/genproto/googleapis/api v0.0.0-20250425173222-7b384671a197/go.mod h1:Cd8IzgPo5Akum2c9R6FsXNaZbH3Jpa2gpHlW89FqlyQ=
316+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250425173222-7b384671a197 h1:29cjnHVylHwTzH66WfFZqgSQgnxzvWE+jvBwpZCLRxY=
317+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250425173222-7b384671a197/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
317318
google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
318319
google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
319320
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=

make/buf/all.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ LICENSE_HEADER_LICENSE_TYPE := apache
4444
LICENSE_HEADER_COPYRIGHT_HOLDER := Buf Technologies, Inc.
4545
LICENSE_HEADER_YEAR_RANGE := 2020-2025
4646
LICENSE_HEADER_IGNORES := \/testdata enterprise
47-
PROTOVALIDATE_VERSION := v0.8.1
47+
PROTOVALIDATE_VERSION := v0.11.1
4848
# Comment out to use released buf
4949
#BUF_GO_INSTALL_PATH := ./cmd/buf
5050

private/buf/cmd/buf/buf_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,7 +2893,7 @@ testdata/check_plugins/current/proto/api/v1/service.proto:17:14:RPC request type
28932893
testdata/check_plugins/current/proto/api/v1/service.proto:17:42:RPC response type "GetFooTestResponse" should be named "GetFooResponse" or "FooServiceTestGetFooResponse".
28942894
testdata/check_plugins/current/proto/api/v1/service.proto:26:1:"ListFooResponse" is a pagination response without a page token field named "page_token" (buf-plugin-rpc-ext)
28952895
testdata/check_plugins/current/proto/common/v1alpha1/messages.proto:16:5:field "common.v1alpha1.Four.FourTwo.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
2896-
testdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:94:3:field "buf.validate.Constraint.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
2896+
testdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:94:3:field "buf.validate.Rule.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
28972897
`),
28982898
"lint",
28992899
filepath.Join("testdata", "check_plugins", "current"),
@@ -2919,7 +2919,7 @@ testdata/check_plugins/current/proto/api/v1/service.proto:17:14:RPC request type
29192919
testdata/check_plugins/current/proto/api/v1/service.proto:17:42:RPC response type "GetFooTestResponse" should be named "GetFooResponse" or "FooServiceTestGetFooResponse".
29202920
testdata/check_plugins/current/proto/api/v1/service.proto:26:1:"ListFooResponse" is a pagination response without a page token field named "page_token" (buf-plugin-rpc-ext)
29212921
testdata/check_plugins/current/proto/common/v1alpha1/messages.proto:16:5:field "common.v1alpha1.Four.FourTwo.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
2922-
testdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:94:3:field "buf.validate.Constraint.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
2922+
testdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:94:3:field "buf.validate.Rule.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
29232923
`),
29242924
"lint",
29252925
filepath.Join("testdata", "check_plugins", "current"),
@@ -2969,7 +2969,7 @@ testdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:
29692969
filepath.FromSlash(`
29702970
testdata/check_plugins/current/proto/api/v1/service.proto:11:1:Service name "api.v1.FooServiceMock" has banned suffix "Mock". (buf-plugin-suffix)
29712971
testdata/check_plugins/current/proto/common/v1alpha1/messages.proto:16:5:field "common.v1alpha1.Four.FourTwo.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
2972-
testdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:94:3:field "buf.validate.Constraint.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
2972+
testdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:94:3:field "buf.validate.Rule.id" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)
29732973
`),
29742974
"lint",
29752975
filepath.Join("testdata", "check_plugins", "current"),

private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/adder.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ import (
2121
)
2222

2323
// The typical use of adder is calling adder.addForPathf([]int32{int64RulesFieldNumber, someFieldNumber}, "message")
24-
// from checkConstraintsForField (or a function that it calls). Notice that checkConstraintsForField
24+
// from checkRulesForField (or a function that it calls). Notice that checkRulesForField
2525
// is recursive, because it can call checkMapRules and checkRepeatedRules, both of which can
26-
// call checkConstraintsForField.
26+
// call checkRulesForField.
2727
//
28-
// If checkConstraintsForField is called by checkMapRules, when we add a file annotation, the
28+
// If checkRulesForField is called by checkMapRules, when we add a file annotation, the
2929
// location should be for something like `repeated.items.string.max_len`. We need to search for the
3030
// location by a path like [mapRulesFieldNumber, keysFieldNumber, StringRulesFieldNumber, ...].
3131
//
32-
// If checkConstraintsForField is not in a recursive call, when we add a file annotation, the
32+
// If checkRulesForField is not in a recursive call, when we add a file annotation, the
3333
// location should be for something like `string.max_len`. We need to search for the location by
3434
// a path like [int64RulesFieldNumber, ...].
3535
//
36-
// However, from checkConstraintsForField's perspective, it doesn't know whether it's in a recursive
36+
// However, from checkRulesForField's perspective, it doesn't know whether it's in a recursive
3737
// call. It always treats the path like [int64RulesFieldNumber, ...], as opposed to [mapRulesFieldNumber, keysFieldNumber, StringRulesFieldNumber, ...].
3838
// To preserve the first part of the path, [mapRulesFieldNumber, keysFieldNumber], we create a new adder
39-
// with a base path when we recursively call checkConstraintsForField. The new adder will automatically
39+
// with a base path when we recursively call checkRulesForField. The new adder will automatically
4040
// prepend the base path whenever it searches for a location. This is manageable because the recursion
41-
// depth is at most 2 -- if checkMapRules or checkRepeatedRules calls checkConstraintsForField,
42-
// this call of checkConstraintsForField won't call checkMapRules or checkRepeatedRules.
41+
// depth is at most 2 -- if checkMapRules or checkRepeatedRules calls checkRulesForField,
42+
// this call of checkRulesForField won't call checkMapRules or checkRepeatedRules.
4343
type adder struct {
4444
field bufprotosource.Field
4545
fieldPrettyTypeName string
@@ -96,7 +96,7 @@ func (a *adder) fieldName() string {
9696

9797
func (a *adder) getFieldRuleName(path ...int32) string {
9898
name := "(buf.validate.field)"
99-
fields := fieldConstraintsDescriptor.Fields()
99+
fields := fieldRulesDescriptor.Fields()
100100
combinedPath := path
101101
if len(a.basePath) > 0 {
102102
combinedPath = make([]int32, len(a.basePath), len(a.basePath)+len(path))

private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/buflintvalidate.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"github.com/bufbuild/protovalidate-go/resolve"
2222
)
2323

24-
// https://buf.build/bufbuild/protovalidate/docs/v0.5.1:buf.validate#buf.validate.MessageConstraints
25-
const disabledFieldNumberInMessageConstraints = 1
24+
// https://buf.build/bufbuild/protovalidate/docs/v0.5.1:buf.validate#buf.validate.MessageRules
25+
const disabledFieldNumberInMessageRules = 1
2626

2727
// CheckMessage validates that all rules on the message are valid, and any CEL expressions compile.
2828
// It also checks all predefined rule extensions on the messages.
@@ -35,19 +35,19 @@ func CheckMessage(
3535
if err != nil {
3636
return err
3737
}
38-
messageConstraints := resolve.MessageConstraints(messageDescriptor)
39-
if messageConstraints.GetDisabled() && len(messageConstraints.GetCel()) > 0 {
38+
messageRules := resolve.MessageRules(messageDescriptor)
39+
if messageRules.GetDisabled() && len(messageRules.GetCel()) > 0 {
4040
addAnnotationFunc(
4141
message,
42-
message.OptionExtensionLocation(validate.E_Message, disabledFieldNumberInMessageConstraints),
42+
message.OptionExtensionLocation(validate.E_Message, disabledFieldNumberInMessageRules),
4343
nil,
4444
"Message %q has (buf.validate.message).disabled, therefore other rules in (buf.validate.message) are not applied and should be removed.",
4545
message.Name(),
4646
)
4747
}
4848
return checkCELForMessage(
4949
addAnnotationFunc,
50-
messageConstraints,
50+
messageRules,
5151
messageDescriptor,
5252
message,
5353
)

0 commit comments

Comments
 (0)