From 3b53e17f4902bc95deca1fa5fe8c73ba379ac382 Mon Sep 17 00:00:00 2001 From: Chris Roche Date: Fri, 16 Aug 2024 08:54:24 -0700 Subject: [PATCH 1/6] Upgrade to support Go 1.23 --- .github/workflows/buf.yaml | 25 +++++++++++++------------ .github/workflows/ci.yaml | 13 +++++++------ Makefile | 2 +- go.mod | 15 ++++++++------- go.sum | 20 ++++++++++++++++++++ 5 files changed, 49 insertions(+), 26 deletions(-) diff --git a/.github/workflows/buf.yaml b/.github/workflows/buf.yaml index 4c83cf2..a9bcb86 100644 --- a/.github/workflows/buf.yaml +++ b/.github/workflows/buf.yaml @@ -3,12 +3,15 @@ on: pull_request: paths: - 'proto/**' + - 'buf.*' push: paths: - 'proto/**' + - 'buf.*' delete: paths: - 'proto/**' + - 'buf.*' env: BUF_TOKEN: ${{ secrets.BUF_TOKEN }} @@ -22,17 +25,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 1 - - name: Install buf - uses: bufbuild/buf-setup-action@v1 + fetch-depth: 2 + - name: Buf CI + uses: bufbuild/buf-action@v1 with: github_token: ${{ github.token }} - - name: Buf format - run: buf format -d --exit-code - - name: Buf lint - uses: bufbuild/buf-lint-action@v1 - - name: Buf generate - run: | - mkdir -p .tmp/bin - cp $(which buf) .tmp/bin/buf - make checkgenerate + format: true + lint: true + breaking: true + push: false + archive: false + - name: Check Generate + run: make checkgenerate diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0a084fd..44b8f55 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [ 1.20.x, 1.21.x, 1.22.x ] + go-version: + - 1.20.x + - 1.21.x + - 1.22.x + - 1.23.x steps: - name: Checkout code uses: actions/checkout@v4 @@ -33,8 +37,5 @@ jobs: - name: Lint # Often, lint guidelines depend on the Go version. To prevent # conflicting guidance, run only on the most recent supported version. - if: matrix.go-version == '1.22.x' - run: make lint - - name: Check Generate - if: matrix.go-version == '1.22.x' - run: make checkgenerate \ No newline at end of file + if: matrix.go-version == '1.23.x' + run: make lint-go diff --git a/Makefile b/Makefile index cec72b5..afc47d1 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ LICENSE_IGNORE := -e internal/testdata/ # Set to use a different compiler. For example, `GO=go1.18rc1 make test`. GO ?= go ARGS ?= --strict --strict_message --strict_error -GOLANGCI_LINT_VERSION ?= v1.59.1 +GOLANGCI_LINT_VERSION ?= v1.60.1 # Set to use a different version of protovalidate-conformance. # Should be kept in sync with the version referenced in proto/buf.lock and # 'buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go' in go.mod. diff --git a/go.mod b/go.mod index fc78ed3..bb8d0b2 100644 --- a/go.mod +++ b/go.mod @@ -11,17 +11,18 @@ require ( ) require ( - github.com/antlr4-go/antlr/v4 v4.13.0 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/kr/pretty v0.1.0 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 44ee73d..8b86531 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-2024071716455 buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2/go.mod h1:ylS4c28ACSI59oJrOdW4pHS4n0Hw4TgSPHn8rpHl4Yw= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -14,12 +16,20 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -32,17 +42,27 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda h1:b6F6WIV4xHHD0FA4oIyzU6mHWg2WI2X1RBehwa5QN38= google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda/go.mod h1:AHcE/gZH76Bk/ROZhQphlRoWo5xKDEtz3eVEO1LfA8c= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 0d99b2747e08a30c2c5de4fc4888594704abb3a1 Mon Sep 17 00:00:00 2001 From: Chris Roche Date: Fri, 16 Aug 2024 09:01:53 -0700 Subject: [PATCH 2/6] checkpoint --- go.mod | 17 ++++++++--------- go.sum | 22 +--------------------- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index bb8d0b2..a08e2fa 100644 --- a/go.mod +++ b/go.mod @@ -11,18 +11,17 @@ require ( ) require ( - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/kr/pretty v0.3.1 // indirect + github.com/kr/pretty v0.1.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect - golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect -) +) \ No newline at end of file diff --git a/go.sum b/go.sum index 8b86531..9415885 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,6 @@ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-2024071716455 buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2/go.mod h1:ylS4c28ACSI59oJrOdW4pHS4n0Hw4TgSPHn8rpHl4Yw= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= -github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= -github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -16,20 +14,12 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -42,27 +32,17 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda h1:b6F6WIV4xHHD0FA4oIyzU6mHWg2WI2X1RBehwa5QN38= google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda/go.mod h1:AHcE/gZH76Bk/ROZhQphlRoWo5xKDEtz3eVEO1LfA8c= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= \ No newline at end of file From 1c29c72da26eeac7ae816140a6ad8d36263084a1 Mon Sep 17 00:00:00 2001 From: Chris Roche Date: Fri, 16 Aug 2024 09:04:14 -0700 Subject: [PATCH 3/6] checkpoint --- go.mod | 2 +- go.sum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a08e2fa..fc78ed3 100644 --- a/go.mod +++ b/go.mod @@ -24,4 +24,4 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect -) \ No newline at end of file +) diff --git a/go.sum b/go.sum index 9415885..44ee73d 100644 --- a/go.sum +++ b/go.sum @@ -45,4 +45,4 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= \ No newline at end of file +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 6211ac03ddf42a8108932dac5cc3aa7ed894325b Mon Sep 17 00:00:00 2001 From: Chris Roche Date: Fri, 16 Aug 2024 09:29:17 -0700 Subject: [PATCH 4/6] checkpoint --- .github/workflows/buf.yaml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/buf.yaml b/.github/workflows/buf.yaml index a9bcb86..92b08a4 100644 --- a/.github/workflows/buf.yaml +++ b/.github/workflows/buf.yaml @@ -1,20 +1,11 @@ name: Buf on: - pull_request: - paths: - - 'proto/**' - - 'buf.*' push: - paths: - - 'proto/**' - - 'buf.*' - delete: - paths: - - 'proto/**' - - 'buf.*' - -env: - BUF_TOKEN: ${{ secrets.BUF_TOKEN }} + branches: [ main ] + tags: [ 'v*' ] + pull_request: + branches: [ main ] + workflow_dispatch: { } # support manual runs jobs: validate-protos: From bd22c50bb5e446a9c50286701444ee21692543ff Mon Sep 17 00:00:00 2001 From: Chris Roche Date: Fri, 16 Aug 2024 09:32:21 -0700 Subject: [PATCH 5/6] checkpoint --- .github/workflows/buf.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/buf.yaml b/.github/workflows/buf.yaml index 92b08a4..eb068f6 100644 --- a/.github/workflows/buf.yaml +++ b/.github/workflows/buf.yaml @@ -7,6 +7,10 @@ on: branches: [ main ] workflow_dispatch: { } # support manual runs +permissions: + contents: read + pull-requests: write + jobs: validate-protos: name: Validate protos @@ -21,6 +25,7 @@ jobs: uses: bufbuild/buf-action@v1 with: github_token: ${{ github.token }} + token: ${{ secrets.BUF_TOKEN }} format: true lint: true breaking: true From 466faffe0e5f04d1586965a67223c535a66648b8 Mon Sep 17 00:00:00 2001 From: Chris Roche Date: Fri, 16 Aug 2024 09:32:59 -0700 Subject: [PATCH 6/6] checkpoint --- proto/tests/example/v1/example.proto | 8 +-- proto/tests/example/v1/legacy.proto | 2 +- proto/tests/example/v1/validations.proto | 68 ++++++++++++------------ 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/proto/tests/example/v1/example.proto b/proto/tests/example/v1/example.proto index 4ea069e..1dee77a 100644 --- a/proto/tests/example/v1/example.proto +++ b/proto/tests/example/v1/example.proto @@ -24,8 +24,8 @@ message Person { string email = 2 [(buf.validate.field).string.email = true]; string name = 3 [(buf.validate.field).string = { - pattern: "^[[:alpha:]]+( [[:alpha:]]+)*$", - max_bytes: 256, + pattern: "^[[:alpha:]]+( [[:alpha:]]+)*$" + max_bytes: 256 }]; Coordinates home = 4; @@ -33,11 +33,11 @@ message Person { message Coordinates { double lat = 1 [(buf.validate.field).double = { - gte: -90, + gte: -90 lte: 90 }]; double lng = 2 [(buf.validate.field).double = { - gte: -180, + gte: -180 lte: 180 }]; } diff --git a/proto/tests/example/v1/legacy.proto b/proto/tests/example/v1/legacy.proto index c065b21..d438a75 100644 --- a/proto/tests/example/v1/legacy.proto +++ b/proto/tests/example/v1/legacy.proto @@ -113,7 +113,7 @@ message LegacyMixedFields { message LegacyIgnoreEmpty { int32 x = 1 [(validate.rules).int32 = { - gt: 123, + gt: 123 ignore_empty: true }]; } diff --git a/proto/tests/example/v1/validations.proto b/proto/tests/example/v1/validations.proto index 8de169d..c258fbf 100644 --- a/proto/tests/example/v1/validations.proto +++ b/proto/tests/example/v1/validations.proto @@ -23,29 +23,29 @@ import "google/protobuf/field_mask.proto"; message HasMsgExprs { option (buf.validate.message).cel = { - id: "x_lt_y", - message: "x must be less than y", - expression: "this.x < this.y", + id: "x_lt_y" + message: "x must be less than y" + expression: "this.x < this.y" }; option (buf.validate.message).cel = { - id: "y_gt_42", + id: "y_gt_42" expression: "this.y > 42 ? ''" - ": 'y must be greater than 42'", + ": 'y must be greater than 42'" }; int32 x = 1 [ (buf.validate.field).cel = { - id: "x_even", - message: "x must be even", + id: "x_even" + message: "x must be even" expression: "this % 2 == 0" }, (buf.validate.field).cel = { - id: "x_coprime_3", + id: "x_coprime_3" expression: "this % 3 != 0 ? ''" - ": 'x must not be divisible by 3'", + ": 'x must not be divisible by 3'" } ]; int32 y = 2; @@ -53,16 +53,16 @@ message HasMsgExprs { message SelfRecursive { option (buf.validate.message).cel = { - id: "unique_turtles", - message: "adjacent turtles must be unique", - expression: "this.x != this.turtle.x", + id: "unique_turtles" + message: "adjacent turtles must be unique" + expression: "this.x != this.turtle.x" }; int32 x = 1; SelfRecursive turtle = 2 [(buf.validate.field).cel = { - id: "non_zero_baby_turtle", - message: "embedded turtle's x value must not be zero", - expression: "this.x > 0", + id: "non_zero_baby_turtle" + message: "embedded turtle's x value must not be zero" + expression: "this.x > 0" }]; } @@ -76,15 +76,15 @@ message LoopRecursiveB { message MsgHasOneof { option (buf.validate.message).cel = { - id: "test x", + id: "test x" expression: "this.x == '' ? '' : \n" - "!this.x.startsWith('foo') ? 'does not have prefix `foo`' : ''", + "!this.x.startsWith('foo') ? 'does not have prefix `foo`' : ''" }; option (buf.validate.message).cel = { - id: "text y", - expression: "this.y >= 0", + id: "text y" + expression: "this.y >= 0" }; oneof o { @@ -97,16 +97,16 @@ message MsgHasOneof { message MsgHasRepeated { repeated float x = 1 [(buf.validate.field).repeated = { - max_items: 3, - min_items: 1, + max_items: 3 + min_items: 1 items: { cel: { - expression: "true", + expression: "true" message: "intentional false" } float: {gt: 0} } - unique: true, + unique: true }]; repeated string y = 2 [(buf.validate.field).repeated.unique = true]; repeated HasMsgExprs z = 3 [(buf.validate.field).repeated = {max_items: 2}]; @@ -114,10 +114,10 @@ message MsgHasRepeated { message MsgHasMap { map int32map = 1 [(buf.validate.field).map = { - min_pairs: 3, + min_pairs: 3 keys: { int32: {gt: 0} - }, + } values: { int32: {lt: 0} } @@ -128,16 +128,16 @@ message MsgHasMap { message TransitiveFieldConstraint { google.protobuf.FieldMask mask = 1 [(buf.validate.field).cel = { - id: "mask.paths", - message: "mask.paths must not be empty", - expression: "has(this.paths)", + id: "mask.paths" + message: "mask.paths must not be empty" + expression: "has(this.paths)" }]; } message MultipleStepsTransitiveFieldConstraints { google.protobuf.Api api = 1 [(buf.validate.field).cel = { - id: "api.source_context.file_name", - message: "api's source context file name must not be empty", + id: "api.source_context.file_name" + message: "api's source context file name must not be empty" expression: "has(this.source_context.file_name)" }]; } @@ -148,8 +148,8 @@ message Simple { message FieldOfTypeAny { google.protobuf.Any any = 1 [(buf.validate.field).cel = { - id: "any_type", - message: "this should never fail", + id: "any_type" + message: "this should never fail" expression: "this == this" }]; } @@ -157,7 +157,7 @@ message FieldOfTypeAny { // https://github.com/bufbuild/protovalidate/issues/92 message CelMapOnARepeated { repeated Value values = 1 [(buf.validate.field).cel = { - id: "env.vars.unique", + id: "env.vars.unique" expression: "this.map(v, v.name).unique() ? '' : 'value names must be unique'" }]; @@ -168,7 +168,7 @@ message CelMapOnARepeated { message RepeatedItemCel { repeated string paths = 1 [(buf.validate.field).repeated.items.cel = { - id: "paths.no_space", + id: "paths.no_space" expression: "!this.startsWith(' ')" }]; }