From 31a9c2cde30e4dbefc2f3ef71494a11782097b58 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:43:36 +0200 Subject: [PATCH] feat: improve buf rate limit (backport #4133) (#4206) --- changelog.md | 1 + docs/docs/02-guide/06-ibc.md | 6 - docs/docs/02-guide/07-interchange/02-init.md | 6 - docs/docs/06-migration/v28.0.0.md | 6 +- docs/docs/08-references/02-config.md | 11 - .../version-v28/02-guide/06-ibc.md | 6 - .../02-guide/07-interchange/02-init.md | 6 - .../version-v28/08-references/02-config.md | 11 - go.mod | 65 ++-- go.sum | 135 ++++---- ignite/cmd/cmd.go | 4 + ignite/config/chain/base/config.go | 7 +- ignite/config/chain/v1/config_test.go | 3 +- ignite/config/chain/v1/testdata/config.yaml | 3 - ignite/config/chain/v1/testdata/config2.yaml | 3 - ignite/internal/analytics/analytics.go | 9 +- ignite/pkg/cosmosanalysis/app/app.go | 1 - ignite/pkg/cosmosanalysis/cosmosanalysis.go | 2 - ignite/pkg/cosmosbuf/buf.go | 314 ++++++++++-------- ignite/pkg/cosmosbuf/buf_test.go | 48 --- ignite/pkg/cosmosgen/cosmosgen.go | 19 +- ignite/pkg/cosmosgen/generate.go | 28 +- ignite/pkg/cosmosgen/generate_go.go | 58 ++-- ignite/pkg/cosmosgen/generate_openapi.go | 92 +++-- ignite/pkg/cosmosgen/generate_openapi_test.go | 57 ++++ ignite/pkg/cosmosgen/generate_typescript.go | 2 +- ignite/pkg/cosmosgen/generate_vuex.go | 2 - ignite/pkg/dircache/cache.go | 111 +++++++ ignite/pkg/dircache/cache_test.go | 87 +++++ ignite/pkg/dircache/testdata/subdata/subfile | 1 + ignite/pkg/dircache/testdata/testfile | 1 + .../swagger-combine/swagger-combine.go | 12 +- ignite/pkg/repoversion/repoversion.go | 2 - ignite/pkg/xos/files.go | 16 +- ignite/pkg/xos/files_test.go | 12 +- ignite/services/chain/chain.go | 1 - ignite/services/chain/generate.go | 5 +- ignite/services/chain/init.go | 2 +- ignite/services/scaffolder/scaffolder.go | 1 - ignite/templates/app/files/go.mod.plush | 16 +- ignite/templates/app/files/proto/buf.lock | 18 +- integration/app/proto_test.go | 3 +- .../doctor/testdata/config-need-migrate.txt | 3 - .../doctor/testdata/missing-tools.go.txt | 2 +- integration/relayer/cmd_relayer_test.go | 6 +- 45 files changed, 717 insertions(+), 487 deletions(-) delete mode 100644 ignite/pkg/cosmosbuf/buf_test.go create mode 100644 ignite/pkg/cosmosgen/generate_openapi_test.go create mode 100644 ignite/pkg/dircache/cache.go create mode 100644 ignite/pkg/dircache/cache_test.go create mode 100644 ignite/pkg/dircache/testdata/subdata/subfile create mode 100644 ignite/pkg/dircache/testdata/testfile diff --git a/changelog.md b/changelog.md index 23f22f9161..9186182a43 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ ### Features - [#4183](https://github.com/ignite/cli/pull/4183) Set `chain-id` in the client.toml +- [#4133](https://github.com/ignite/cli/pull/4133) Improve buf rate limit ### Changes diff --git a/docs/docs/02-guide/06-ibc.md b/docs/docs/02-guide/06-ibc.md index faa01a1cae..abddcd9c14 100644 --- a/docs/docs/02-guide/06-ibc.md +++ b/docs/docs/02-guide/06-ibc.md @@ -432,9 +432,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: @@ -463,9 +460,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: diff --git a/docs/docs/02-guide/07-interchange/02-init.md b/docs/docs/02-guide/07-interchange/02-init.md index a8c96755f2..2f19beee72 100644 --- a/docs/docs/02-guide/07-interchange/02-init.md +++ b/docs/docs/02-guide/07-interchange/02-init.md @@ -129,9 +129,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: @@ -164,9 +161,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: diff --git a/docs/docs/06-migration/v28.0.0.md b/docs/docs/06-migration/v28.0.0.md index 9c618fefd8..7ece1836f6 100644 --- a/docs/docs/06-migration/v28.0.0.md +++ b/docs/docs/06-migration/v28.0.0.md @@ -81,15 +81,15 @@ This guide provides a step-by-step process for developers to upgrade their appli - **Old Code**: ```go - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PostKey)) + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PostKey)) ``` - **New Code**: ```go - storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.PostKey)) + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.PostKey)) ``` diff --git a/docs/docs/08-references/02-config.md b/docs/docs/08-references/02-config.md index 34347b9565..d0228a4a18 100644 --- a/docs/docs/08-references/02-config.md +++ b/docs/docs/08-references/02-config.md @@ -203,17 +203,6 @@ build: path: "myproto" ``` -Ignite comes with required third-party proto out of the box. Ignite also looks -into `third_party/proto` and `proto_vendor` directories for extra proto files. -If your project keeps third-party proto files in a different directory, you -should tell Ignite about this: - -```yml -build: - proto: - third_party_paths: ["my_third_party/proto"] -``` - ## Faucet The faucet service sends tokens to addresses. diff --git a/docs/versioned_docs/version-v28/02-guide/06-ibc.md b/docs/versioned_docs/version-v28/02-guide/06-ibc.md index faa01a1cae..abddcd9c14 100644 --- a/docs/versioned_docs/version-v28/02-guide/06-ibc.md +++ b/docs/versioned_docs/version-v28/02-guide/06-ibc.md @@ -432,9 +432,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: @@ -463,9 +460,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: diff --git a/docs/versioned_docs/version-v28/02-guide/07-interchange/02-init.md b/docs/versioned_docs/version-v28/02-guide/07-interchange/02-init.md index a8c96755f2..2f19beee72 100644 --- a/docs/versioned_docs/version-v28/02-guide/07-interchange/02-init.md +++ b/docs/versioned_docs/version-v28/02-guide/07-interchange/02-init.md @@ -129,9 +129,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: @@ -164,9 +161,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: diff --git a/docs/versioned_docs/version-v28/08-references/02-config.md b/docs/versioned_docs/version-v28/08-references/02-config.md index 1eb4aa7f8f..a266d870af 100644 --- a/docs/versioned_docs/version-v28/08-references/02-config.md +++ b/docs/versioned_docs/version-v28/08-references/02-config.md @@ -183,17 +183,6 @@ build: path: "myproto" ``` -Ignite comes with required third-party proto out of the box. Ignite also looks -into `third_party/proto` and `proto_vendor` directories for extra proto files. -If your project keeps third-party proto files in a different directory, you -should tell Ignite about this: - -```yml -build: - proto: - third_party_paths: ["my_third_party/proto"] -``` - ## Faucet The faucet service sends tokens to addresses. diff --git a/go.mod b/go.mod index 620fe3116f..c235b48b25 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/blang/semver/v4 v4.0.0 github.com/briandowns/spinner v1.23.0 - github.com/bufbuild/buf v1.30.1 + github.com/bufbuild/buf v1.34.0 github.com/buger/jsonparser v1.1.1 github.com/cenkalti/backoff v2.2.1+incompatible github.com/charmbracelet/bubbles v0.7.6 @@ -41,6 +41,7 @@ require ( github.com/gobuffalo/logger v1.0.7 github.com/gobuffalo/packd v1.0.2 github.com/gobuffalo/plush/v4 v4.1.19 + github.com/gobwas/glob v0.2.3 github.com/goccy/go-yaml v1.11.3 github.com/golangci/golangci-lint v1.57.2 github.com/google/go-github/v48 v48.2.0 @@ -66,22 +67,22 @@ require ( github.com/pelletier/go-toml v1.9.5 github.com/radovskyb/watcher v1.0.7 github.com/rogpeppe/go-internal v1.12.0 - github.com/rs/cors v1.10.1 - github.com/spf13/cobra v1.8.0 + github.com/rs/cors v1.11.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 github.com/tbruyelle/mdgofmt v0.1.3 github.com/vektra/mockery/v2 v2.40.1 go.etcd.io/bbolt v1.3.9 - golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 - golang.org/x/mod v0.17.0 + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 + golang.org/x/mod v0.18.0 golang.org/x/sync v0.7.0 - golang.org/x/term v0.19.0 - golang.org/x/text v0.14.0 - golang.org/x/tools v0.20.0 + golang.org/x/term v0.21.0 + golang.org/x/text v0.16.0 + golang.org/x/tools v0.22.0 golang.org/x/vuln v1.0.4 - google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 + google.golang.org/grpc v1.64.0 + google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v2 v2.4.0 mvdan.cc/gofumpt v0.6.0 sigs.k8s.io/yaml v1.4.0 @@ -90,8 +91,10 @@ require ( require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240221180331-f05a6f4403ce.1 // indirect - connectrpc.com/connect v1.16.0 // indirect + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240508200655-46a4cf4ba109.2 // indirect + buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.2-20240610164129-660609bc46d3.1 // indirect + buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.2-20240610164129-660609bc46d3.2 // indirect + connectrpc.com/connect v1.16.2 // indirect connectrpc.com/otelconnect v0.7.0 // indirect cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect @@ -142,15 +145,16 @@ require ( github.com/breml/errchkjson v0.3.6 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect - github.com/bufbuild/protocompile v0.9.0 // indirect - github.com/bufbuild/protovalidate-go v0.6.0 // indirect - github.com/bufbuild/protoyaml-go v0.1.8 // indirect + github.com/bufbuild/protocompile v0.14.0 // indirect + github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee // indirect + github.com/bufbuild/protovalidate-go v0.6.2 // indirect + github.com/bufbuild/protoyaml-go v0.1.9 // indirect github.com/butuzov/ireturn v0.3.0 // indirect github.com/butuzov/mirror v1.1.0 // indirect github.com/calmh/randomart v1.1.0 // indirect github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect @@ -196,10 +200,10 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.2.0 // indirect - github.com/docker/cli v26.0.0+incompatible // indirect + github.com/docker/cli v26.1.4+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker v26.0.0+incompatible // indirect - github.com/docker/docker-credential-helpers v0.8.1 // indirect + github.com/docker/docker v27.0.0+incompatible // indirect + github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -217,7 +221,7 @@ require ( github.com/fzipp/gocyclo v0.6.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/ghostiam/protogetter v0.3.5 // indirect - github.com/go-chi/chi/v5 v5.0.12 // indirect + github.com/go-chi/chi/v5 v5.0.13 // indirect github.com/go-critic/go-critic v0.11.2 // indirect github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect @@ -225,7 +229,7 @@ require ( github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect @@ -241,11 +245,10 @@ require ( github.com/gobuffalo/helpers v0.6.7 // indirect github.com/gobuffalo/tags/v3 v3.1.4 // indirect github.com/gobuffalo/validate/v3 v3.3.3 // indirect - github.com/gobwas/glob v0.2.3 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect - github.com/gofrs/uuid/v5 v5.0.0 // indirect + github.com/gofrs/uuid/v5 v5.2.0 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.1.0 // indirect @@ -262,9 +265,9 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/cel-go v0.20.1 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/go-containerregistry v0.19.1 // indirect + github.com/google/go-containerregistry v0.19.2 // indirect github.com/google/go-dap v0.11.0 // indirect - github.com/google/pprof v0.0.0-20240327155427-868f304927ed // indirect + github.com/google/pprof v0.0.0-20240618054019-d3b898a103f8 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gorilla/css v1.0.0 // indirect @@ -308,7 +311,7 @@ require ( github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kisielk/errcheck v1.7.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect - github.com/klauspost/compress v1.17.7 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -454,14 +457,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.6.0 // indirect - golang.org/x/crypto v0.22.0 // indirect + golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.19.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index c8248cd6f8..093ef7498c 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,12 @@ 4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= 4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= 4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240221180331-f05a6f4403ce.1 h1:0nWhrRcnkgw1kwJ7xibIO8bqfOA7pBzBjGCDBxIHch8= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240221180331-f05a6f4403ce.1/go.mod h1:Tgn5bgL220vkFOI0KPStlcClPeOJzAv4uT+V8JXGUnw= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240508200655-46a4cf4ba109.2 h1:cFrEG/pJch6t62+jqndcPXeTNkYcztS4tBRgNkR+drw= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240508200655-46a4cf4ba109.2/go.mod h1:ylS4c28ACSI59oJrOdW4pHS4n0Hw4TgSPHn8rpHl4Yw= +buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.2-20240610164129-660609bc46d3.1 h1:PmSlGbLLyhKIAm46ROmzdGVaaYgDdFsQNA+VftjuCLs= +buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.2-20240610164129-660609bc46d3.1/go.mod h1:4ptL49VoWyYwajT6j4zu5vmQ/k/om4tGMB9atY2FhEo= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.2-20240610164129-660609bc46d3.2 h1:y1+UxFIWzj/eF2RCPqt9egR7Rt9vgQkXNUzSdmR6iEU= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.2-20240610164129-660609bc46d3.2/go.mod h1:psseUmlKRo9v5LZJtR/aTpdTLuyp9o3X7rnLT87SZEo= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -37,8 +41,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -connectrpc.com/connect v1.16.0 h1:rdtfQjZ0OyFkWPTegBNcH7cwquGAN1WzyJy80oFNibg= -connectrpc.com/connect v1.16.0/go.mod h1:XpZAduBQUySsb4/KO5JffORVkDI4B6/EYPi7N8xpNZw= +connectrpc.com/connect v1.16.2 h1:ybd6y+ls7GOlb7Bh5C8+ghA6SvCBajHwxssO2CGFjqE= +connectrpc.com/connect v1.16.2/go.mod h1:n2kgwskMHXC+lVqb18wngEpF95ldBHXjZYJussz5FRc= connectrpc.com/otelconnect v0.7.0 h1:ZH55ZZtcJOTKWWLy3qmL4Pam4RzRWBJFOqTPyAqCXkY= connectrpc.com/otelconnect v0.7.0/go.mod h1:Bt2ivBymHZHqxvo4HkJ0EwHuUzQN6k2l0oH+mp/8nwc= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= @@ -203,14 +207,16 @@ github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipus github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 h1:KdUfX2zKommPRa+PD0sWZUyXe9w277ABlgELO7H04IM= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/bufbuild/buf v1.30.1 h1:QFtanwsXodoGFAwzXFXGXpzBkb7N2u8ZDyA3jWB4Pbs= -github.com/bufbuild/buf v1.30.1/go.mod h1:7W8DJnj76wQa55EA3z2CmDxS0/nsHh8FqtE00dyDAdA= -github.com/bufbuild/protocompile v0.9.0 h1:DI8qLG5PEO0Mu1Oj51YFPqtx6I3qYXUAhJVJ/IzAVl0= -github.com/bufbuild/protocompile v0.9.0/go.mod h1:s89m1O8CqSYpyE/YaSGtg1r1YFMF5nLTwh4vlj6O444= -github.com/bufbuild/protovalidate-go v0.6.0 h1:Jgs1kFuZ2LHvvdj8SpCLA1W/+pXS8QSM3F/E2l3InPY= -github.com/bufbuild/protovalidate-go v0.6.0/go.mod h1:1LamgoYHZ2NdIQH0XGczGTc6Z8YrTHjcJVmiBaar4t4= -github.com/bufbuild/protoyaml-go v0.1.8 h1:X9QDLfl9uEllh4gsXUGqPanZYCOKzd92uniRtW2OnAQ= -github.com/bufbuild/protoyaml-go v0.1.8/go.mod h1:R8vE2+l49bSiIExP4VJpxOXleHE+FDzZ6HVxr3cYunw= +github.com/bufbuild/buf v1.34.0 h1:rZSVfYS5SakOe6ds9PDjbHVwOc+vBGVWNW9Ei+Rg/+c= +github.com/bufbuild/buf v1.34.0/go.mod h1:Fj+KBmY2ODYD2Ld02w4LH9Y3WiRH2203IjGJbKYK5Hc= +github.com/bufbuild/protocompile v0.14.0 h1:z3DW4IvXE5G/uTOnSQn+qwQQxvhckkTWLS/0No/o7KU= +github.com/bufbuild/protocompile v0.14.0/go.mod h1:N6J1NYzkspJo3ZwyL4Xjvli86XOj1xq4qAasUFxGups= +github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee h1:E6ET8YUcYJ1lAe6ctR3as7yqzW2BNItDFnaB5zQq/8M= +github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee/go.mod h1:HjGFxsck9RObrTJp2hXQZfWhPgZqnR6sR1U5fCA/Kus= +github.com/bufbuild/protovalidate-go v0.6.2 h1:U/V3CGF0kPlR12v41rjO4DrYZtLcS4ZONLmWN+rJVCQ= +github.com/bufbuild/protovalidate-go v0.6.2/go.mod h1:4BR3rKEJiUiTy+sqsusFn2ladOf0kYmA2Reo6BHSBgQ= +github.com/bufbuild/protoyaml-go v0.1.9 h1:anV5UtF1Mlvkkgp4NWA6U/zOnJFng8Orq4Vf3ZUQHBU= +github.com/bufbuild/protoyaml-go v0.1.9/go.mod h1:KCBItkvZOK/zwGueLdH1Wx1RLyFn5rCH7YjQrdty2Wc= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= @@ -228,8 +234,8 @@ github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQd github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -357,7 +363,6 @@ github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5X github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -403,14 +408,14 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/docker/cli v26.0.0+incompatible h1:90BKrx1a1HKYpSnnBFR6AgDq/FqkHxwlUyzJVPxD30I= -github.com/docker/cli v26.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v26.1.4+incompatible h1:I8PHdc0MtxEADqYJZvhBrW9bo8gawKwwenxRM7/rLu8= +github.com/docker/cli v26.1.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU= -github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= -github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= +github.com/docker/docker v27.0.0+incompatible h1:JRugTYuelmWlW0M3jakcIadDx2HUoUO6+Tf2C5jVfwA= +github.com/docker/docker v27.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= +github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -487,8 +492,8 @@ github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= -github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= -github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.13 h1:JlH2F2M8qnwl0N1+JFFzlX9TlKJYas3aPXdiuTmJL+w= +github.com/go-chi/chi/v5 v5.0.13/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-critic/go-critic v0.11.2 h1:81xH/2muBphEgPtcwH1p6QD+KzXl2tMSi3hXjBSxDnM= github.com/go-critic/go-critic v0.11.2/go.mod h1:OePaicfjsf+KPy33yq4gzv6CO7TEQ9Rom6ns1KsJnl8= github.com/go-delve/delve v1.21.0 h1:npcc8TZhdVxaMSJon+zqcE3bXM/ck8SSOOWw/id13jI= @@ -523,8 +528,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -606,8 +611,8 @@ github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14j github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= -github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= +github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM= +github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -701,8 +706,8 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/google/go-containerregistry v0.19.1 h1:yMQ62Al6/V0Z7CqIrrS1iYoA5/oQCm88DeNujc7C1KY= -github.com/google/go-containerregistry v0.19.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= +github.com/google/go-containerregistry v0.19.2 h1:TannFKE1QSajsP6hPWb5oJNgKe1IKjHukIKDUmvsV6w= +github.com/google/go-containerregistry v0.19.2/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= github.com/google/go-dap v0.9.1/go.mod h1:HAeyoSd2WIfTfg+0GRXcFrb+RnojAtGNh+k+XTIxJDE= github.com/google/go-dap v0.11.0 h1:SpAZJL41rOOvd85PuLCCLE1dteTQOyKNnn0H3DBHywo= github.com/google/go-dap v0.11.0/go.mod h1:HAeyoSd2WIfTfg+0GRXcFrb+RnojAtGNh+k+XTIxJDE= @@ -728,8 +733,8 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= -github.com/google/pprof v0.0.0-20240327155427-868f304927ed h1:n8QtJTrwsv3P7dNxPaMeNkMcxvUpqocsHLr8iDLGlQI= -github.com/google/pprof v0.0.0-20240327155427-868f304927ed/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20240618054019-d3b898a103f8 h1:ASJ/LAqdCHOyMYI+dwNxn7Rd8FscNkMyTr1KZU1JI/M= +github.com/google/pprof v0.0.0-20240618054019-d3b898a103f8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -873,8 +878,8 @@ github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ= github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8= github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= -github.com/jhump/protoreflect v1.15.6 h1:WMYJbw2Wo+KOWwZFvgY0jMoVHM6i4XIvRs2RcBj5VmI= -github.com/jhump/protoreflect v1.15.6/go.mod h1:jCHoyYQIJnaabEYnbGwyo9hUqfyUMTbJw/tAut5t97E= +github.com/jhump/protoreflect v1.16.0 h1:54fZg+49widqXYQ0b+usAFHbMkBGR4PpXrsHc8+TBDg= +github.com/jhump/protoreflect v1.16.0/go.mod h1:oYPd7nPvcBw/5wlDfm/AVmU9zH9BgqGCI469pGxfj/8= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= @@ -931,8 +936,8 @@ github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7 github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= -github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1275,8 +1280,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f 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/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= +github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= @@ -1363,8 +1368,8 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -1522,8 +1527,8 @@ go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhs go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.starlark.net v0.0.0-20220816155156-cfacd8902214/go.mod h1:VZcBMdr3cT3PnBoWunTabuSEXwVAH+ZJ5zxfs3AdASk= go.starlark.net v0.0.0-20231101134539-556fd59b42f6 h1:+eC0F/k4aBLC4szgOcjd7bDTEnpxADJyWJE0yowgM3E= go.starlark.net v0.0.0-20231101134539-556fd59b42f6/go.mod h1:LcLNIzVOMp4oV+uusnpk+VU+SzXaJakUuBjoCSWH5dM= @@ -1570,8 +1575,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1583,8 +1588,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= -golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= @@ -1617,8 +1622,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1674,8 +1679,8 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1794,8 +1799,8 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1806,8 +1811,8 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1820,8 +1825,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +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/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1900,8 +1905,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/vuln v1.0.4 h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I= golang.org/x/vuln v1.0.4/go.mod h1:NbJdUQhX8jY++FtuhrXs2Eyx0yePo9pF7nPlIjo9aaQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1971,10 +1976,10 @@ google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa h1:Jt1XW5PaLXF1/ePZrznsh/aAUvI7Adfc3LY1dAKlzRs= -google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:K4kfzHtI0kqWA79gecJarFtDn/Mls+GxQcg3Zox91Ac= -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/api v0.0.0-20240617180043-68d350f18fd4 h1:MuYw1wJzT+ZkybKfaOXKp5hJiZDn2iHaXRw0mRYdHSc= +google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4/go.mod h1:px9SlOOZBg1wM1zdnr8jEL4CNGUBZ+ZKYtNPApNQc4c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 h1:Di6ANFilr+S60a4S61ZM00vLdw0IrQOSMS2/6mrnOU0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1997,8 +2002,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2013,8 +2018,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/ignite/cmd/cmd.go b/ignite/cmd/cmd.go index 8375380b7d..012f4ad8da 100644 --- a/ignite/cmd/cmd.go +++ b/ignite/cmd/cmd.go @@ -16,6 +16,7 @@ import ( "github.com/ignite/cli/v28/ignite/pkg/cache" "github.com/ignite/cli/v28/ignite/pkg/cliui" uilog "github.com/ignite/cli/v28/ignite/pkg/cliui/log" + "github.com/ignite/cli/v28/ignite/pkg/dircache" "github.com/ignite/cli/v28/ignite/pkg/errors" "github.com/ignite/cli/v28/ignite/pkg/gitpod" "github.com/ignite/cli/v28/ignite/pkg/goenv" @@ -228,6 +229,9 @@ func newCache(cmd *cobra.Command) (cache.Storage, error) { if err := storage.Clear(); err != nil { return cache.Storage{}, err } + if err := dircache.ClearCache(); err != nil { + return cache.Storage{}, err + } } return storage, nil diff --git a/ignite/config/chain/base/config.go b/ignite/config/chain/base/config.go index f695df61cf..389ae72b9b 100644 --- a/ignite/config/chain/base/config.go +++ b/ignite/config/chain/base/config.go @@ -48,10 +48,6 @@ type Build struct { type Proto struct { // Path is the relative path of where app's proto files are located at. Path string `yaml:"path"` - - // ThirdPartyPath is the relative path of where the third party proto files are - // located that used by the app. - ThirdPartyPaths []string `yaml:"third_party_paths"` } // Client configures code generation for clients. @@ -204,8 +200,7 @@ func DefaultConfig() Config { return Config{ Build: Build{ Proto: Proto{ - Path: "proto", - ThirdPartyPaths: []string{"third_party/proto", "proto_vendor"}, + Path: "proto", }, }, Faucet: Faucet{ diff --git a/ignite/config/chain/v1/config_test.go b/ignite/config/chain/v1/config_test.go index 02538f06b7..4950851e14 100644 --- a/ignite/config/chain/v1/config_test.go +++ b/ignite/config/chain/v1/config_test.go @@ -29,8 +29,7 @@ func TestConfigDecode(t *testing.T) { Build: base.Build{ Binary: "evmosd", Proto: base.Proto{ - Path: "proto", - ThirdPartyPaths: []string{"third_party/proto", "proto_vendor"}, + Path: "proto", }, }, Accounts: []base.Account{ diff --git a/ignite/config/chain/v1/testdata/config.yaml b/ignite/config/chain/v1/testdata/config.yaml index 82ea30a3b8..8ff61ff2fe 100644 --- a/ignite/config/chain/v1/testdata/config.yaml +++ b/ignite/config/chain/v1/testdata/config.yaml @@ -3,9 +3,6 @@ build: binary: evmosd proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: diff --git a/ignite/config/chain/v1/testdata/config2.yaml b/ignite/config/chain/v1/testdata/config2.yaml index 38c2fe42c8..d83b87ad61 100644 --- a/ignite/config/chain/v1/testdata/config2.yaml +++ b/ignite/config/chain/v1/testdata/config2.yaml @@ -3,9 +3,6 @@ build: binary: evmosd proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: diff --git a/ignite/internal/analytics/analytics.go b/ignite/internal/analytics/analytics.go index 5a0e703cfd..b31403bb4f 100644 --- a/ignite/internal/analytics/analytics.go +++ b/ignite/internal/analytics/analytics.go @@ -12,6 +12,7 @@ import ( "github.com/manifoldco/promptui" "github.com/spf13/cobra" + "github.com/ignite/cli/v28/ignite/config" "github.com/ignite/cli/v28/ignite/pkg/gitpod" "github.com/ignite/cli/v28/ignite/pkg/matomo" "github.com/ignite/cli/v28/ignite/pkg/randstr" @@ -23,7 +24,6 @@ const ( envDoNotTrack = "DO_NOT_TRACK" envCI = "CI" envGitHubActions = "GITHUB_ACTIONS" - igniteDir = ".ignite" igniteAnonIdentity = "anon_identity.json" ) @@ -106,14 +106,15 @@ func checkDNT() (anonIdentity, error) { return anonIdentity{DoNotTrack: true}, nil } - home, err := os.UserHomeDir() + globalPath, err := config.DirPath() if err != nil { return anonIdentity{}, err } - if err := os.Mkdir(filepath.Join(home, igniteDir), 0o700); err != nil && !os.IsExist(err) { + if err := os.Mkdir(globalPath, 0o700); err != nil && !os.IsExist(err) { return anonIdentity{}, err } - identityPath := filepath.Join(home, igniteDir, igniteAnonIdentity) + + identityPath := filepath.Join(globalPath, igniteAnonIdentity) data, err := os.ReadFile(identityPath) if err != nil && !os.IsNotExist(err) { return anonIdentity{}, err diff --git a/ignite/pkg/cosmosanalysis/app/app.go b/ignite/pkg/cosmosanalysis/app/app.go index 3501b4f327..444c0a662e 100644 --- a/ignite/pkg/cosmosanalysis/app/app.go +++ b/ignite/pkg/cosmosanalysis/app/app.go @@ -237,7 +237,6 @@ func discoverRuntimeAppModules(chainRoot string) ([]string, error) { } return nil }) - if err != nil { return nil, err } diff --git a/ignite/pkg/cosmosanalysis/cosmosanalysis.go b/ignite/pkg/cosmosanalysis/cosmosanalysis.go index 868d5aa63a..796ba0aef5 100644 --- a/ignite/pkg/cosmosanalysis/cosmosanalysis.go +++ b/ignite/pkg/cosmosanalysis/cosmosanalysis.go @@ -53,7 +53,6 @@ func DeepFindImplementation(modulePath string, interfaceList []string) (found [] found = append(found, currFound...) return nil }) - if err != nil { return nil, err } @@ -267,7 +266,6 @@ func FindAppFilePath(chainRoot string) (path string, err error) { return nil }) - if err != nil { return "", err } diff --git a/ignite/pkg/cosmosbuf/buf.go b/ignite/pkg/cosmosbuf/buf.go index dec67c6e8f..51937d127e 100644 --- a/ignite/pkg/cosmosbuf/buf.go +++ b/ignite/pkg/cosmosbuf/buf.go @@ -3,53 +3,44 @@ package cosmosbuf import ( "context" "fmt" - "os" "path/filepath" - "strings" + "github.com/gobwas/glob" "golang.org/x/sync/errgroup" + "github.com/ignite/cli/v28/ignite/pkg/cache" "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" - "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/dircache" "github.com/ignite/cli/v28/ignite/pkg/errors" "github.com/ignite/cli/v28/ignite/pkg/goenv" - "github.com/ignite/cli/v28/ignite/pkg/protoanalysis" "github.com/ignite/cli/v28/ignite/pkg/xexec" "github.com/ignite/cli/v28/ignite/pkg/xos" ) -type ( - // Command represents a high level command under buf. - Command string - - // Buf represents the buf application structure. - Buf struct { - path string - sdkProtoDir string - cache *protoanalysis.Cache - } -) - const ( - binaryName = "buf" - flagTemplate = "template" - flagOutput = "output" - flagErrorFormat = "error-format" - flagLogFormat = "log-format" - flagOnly = "only" - fmtJSON = "json" + binaryName = "buf" + flagTemplate = "template" + flagOutput = "output" + flagErrorFormat = "error-format" + flagLogFormat = "log-format" + flagIncludeImports = "include-imports" + flagIncludeWellKnownTypes = "include-wkt" + flagPath = "path" + fmtJSON = "json" // CMDGenerate generate command. CMDGenerate Command = "generate" CMDExport Command = "export" - CMDMod Command = "mod" + CMDDep Command = "dep" + + specCacheNamespace = "generate.buf" ) var ( commands = map[Command]struct{}{ CMDGenerate: {}, CMDExport: {}, - CMDMod: {}, + CMDDep: {}, } // ErrInvalidCommand indicates an invalid command name. @@ -59,15 +50,94 @@ var ( ErrProtoFilesNotFound = errors.New("no proto files found") ) +type ( + // Command represents a high level command under buf. + Command string + + // Buf represents the buf application structure. + Buf struct { + path string + cache dircache.Cache + } + + // genOptions used to configure code generation. + genOptions struct { + excluded []glob.Glob + flags map[string]string + fileByFile bool + includeImports bool + includeWKT bool + } + + // GenOption configures code generation. + GenOption func(*genOptions) +) + +func newGenOptions() genOptions { + return genOptions{ + flags: make(map[string]string), + excluded: make([]glob.Glob, 0), + fileByFile: false, + includeWKT: false, + includeImports: false, + } +} + +// WithFlag provides flag options for the buf generate command. +func WithFlag(flag, value string) GenOption { + return func(o *genOptions) { + o.flags[flag] = value + } +} + +// ExcludeFiles exclude file names from the generate command using glob. +func ExcludeFiles(patterns ...string) GenOption { + return func(o *genOptions) { + for _, pattern := range patterns { + o.excluded = append(o.excluded, glob.MustCompile(pattern)) + } + } +} + +// IncludeImports also generate all imports except for Well-Known Types. +func IncludeImports() GenOption { + return func(o *genOptions) { + o.includeImports = true + } +} + +// IncludeWKT also generate Well-Known Types. +// Cannot be set without IncludeImports. +func IncludeWKT() GenOption { + return func(o *genOptions) { + o.includeImports = true + o.includeWKT = true + } +} + +// FileByFile runs the generate command for each proto file. +func FileByFile() GenOption { + return func(o *genOptions) { + o.fileByFile = true + } +} + // New creates a new Buf based on the installed binary. -func New() (Buf, error) { +func New(cacheStorage cache.Storage, goModPath string) (Buf, error) { path, err := xexec.ResolveAbsPath(filepath.Join(goenv.Bin(), binaryName)) if err != nil { return Buf{}, err } + + bufCacheDir := filepath.Join("buf", goModPath) + c, err := dircache.New(cacheStorage, bufCacheDir, specCacheNamespace) + if err != nil { + return Buf{}, err + } + return Buf{ path: path, - cache: protoanalysis.NewCache(), + cache: c, }, nil } @@ -78,62 +148,36 @@ func (c Command) String() string { // Update updates module dependencies. // By default updates all dependencies unless one or more dependencies are specified. -func (b Buf) Update(ctx context.Context, modDir string, dependencies ...string) error { - var flags map[string]string - if dependencies != nil { - flags = map[string]string{ - flagOnly: strings.Join(dependencies, ","), - } +func (b Buf) Update(ctx context.Context, modDir string) error { + files, err := xos.FindFilesExtension(modDir, xos.ProtoFile) + if err != nil { + return err + } + if len(files) == 0 { + return errors.Errorf("%w: %s", ErrProtoFilesNotFound, modDir) } - cmd, err := b.generateCommand(CMDMod, flags, "update", modDir) + cmd, err := b.command(CMDDep, nil, "update", modDir) if err != nil { return err } - return b.runCommand(ctx, cmd...) } // Export runs the buf Export command for the files in the proto directory. func (b Buf) Export(ctx context.Context, protoDir, output string) error { - // Check if the proto directory is the Cosmos SDK one - // TODO(@julienrbrt): this whole custom handling can be deleted - // after https://github.com/cosmos/cosmos-sdk/pull/18993 in v29. - if strings.Contains(protoDir, cosmosver.CosmosSDKRepoName) { - if b.sdkProtoDir == "" { - // Copy Cosmos SDK proto path without the Buf workspace. - // This is done because the workspace contains a reference to - // a "orm/internal" proto folder that is not present by default - // in the SDK repository. - d, err := copySDKProtoDir(protoDir) - if err != nil { - return err - } - - b.sdkProtoDir = d - } - - // Split absolute path into an absolute prefix and a relative suffix - paths := strings.Split(protoDir, "/proto") - if len(paths) < 2 { - return errors.Errorf("invalid Cosmos SDK mod path: %s", protoDir) - } - - // Use the SDK copy to resolve SDK proto files - protoDir = filepath.Join(b.sdkProtoDir, paths[1]) - } - specs, err := xos.FindFiles(protoDir, xos.ProtoFile) + files, err := xos.FindFilesExtension(protoDir, xos.ProtoFile) if err != nil { return err } - if len(specs) == 0 { + if len(files) == 0 { return errors.Errorf("%w: %s", ErrProtoFilesNotFound, protoDir) } + flags := map[string]string{ flagOutput: output, } - - cmd, err := b.generateCommand(CMDExport, flags, protoDir) + cmd, err := b.command(CMDExport, flags, protoDir) if err != nil { return err } @@ -144,61 +188,79 @@ func (b Buf) Export(ctx context.Context, protoDir, output string) error { // Generate runs the buf Generate command for each file into the proto directory. func (b Buf) Generate( ctx context.Context, - protoDir, + protoPath, output, template string, - excludeFilename ...string, + options ...GenOption, ) (err error) { - var ( - excluded = make(map[string]struct{}) - flags = map[string]string{ - flagTemplate: template, - flagOutput: output, - flagErrorFormat: fmtJSON, - flagLogFormat: fmtJSON, - } - ) - for _, file := range excludeFilename { - excluded[file] = struct{}{} + opts := newGenOptions() + for _, apply := range options { + apply(&opts) } - // TODO(@julienrbrt): this whole custom handling can be deleted - // after https://github.com/cosmos/cosmos-sdk/pull/18993 in v29. - if strings.Contains(protoDir, cosmosver.CosmosSDKRepoName) { - if b.sdkProtoDir == "" { - b.sdkProtoDir, err = copySDKProtoDir(protoDir) - if err != nil { - return err - } - } - dirs := strings.Split(protoDir, "/proto/") - if len(dirs) < 2 { - return errors.Errorf("invalid Cosmos SDK mod path: %s", dirs) - } - protoDir = filepath.Join(b.sdkProtoDir, dirs[1]) + // find all proto files into the path. + foundFiles, err := xos.FindFilesExtension(protoPath, xos.ProtoFile) + if err != nil || len(foundFiles) == 0 { + return err } - pkgs, err := protoanalysis.Parse(ctx, b.cache, protoDir) - if err != nil { + // check if already exist a cache for the template. + key, err := b.cache.CopyTo(protoPath, output, template) + if err != nil && !errors.Is(err, dircache.ErrCacheNotFound) { return err + } else if err == nil { + return nil } - g, ctx := errgroup.WithContext(ctx) - for _, pkg := range pkgs { - for _, file := range pkg.Files { - if _, ok := excluded[filepath.Base(file.Path)]; ok { - continue + // remove excluded and cached files. + protoFiles := make([]string, 0) + for _, file := range foundFiles { + okExclude := false + for _, g := range opts.excluded { + if g.Match(file) { + okExclude = true + break } + } + if !okExclude { + protoFiles = append(protoFiles, file) + } + } + if len(protoFiles) == 0 { + return nil + } - specs, err := xos.FindFiles(protoDir, "proto") - if err != nil { - return err - } - if len(specs) == 0 { - continue - } + flags := map[string]string{ + flagTemplate: template, + flagOutput: output, + flagErrorFormat: fmtJSON, + flagLogFormat: fmtJSON, + } + for k, v := range opts.flags { + flags[k] = v + } + if opts.includeImports { + flags[flagIncludeImports] = "true" + } + if opts.includeWKT { + flags[flagIncludeWellKnownTypes] = "true" + } - cmd, err := b.generateCommand(CMDGenerate, flags, file.Path) + if !opts.fileByFile { + cmd, err := b.command(CMDGenerate, flags, protoPath) + if err != nil { + return err + } + for _, file := range protoFiles { + cmd = append(cmd, fmt.Sprintf("--%s=%s", flagPath, file)) + } + if err := b.runCommand(ctx, cmd...); err != nil { + return err + } + } else { + g, ctx := errgroup.WithContext(ctx) + for _, file := range protoFiles { + cmd, err := b.command(CMDGenerate, flags, file) if err != nil { return err } @@ -208,16 +270,12 @@ func (b Buf) Generate( return b.runCommand(ctx, cmd...) }) } + if err := g.Wait(); err != nil { + return err + } } - return g.Wait() -} -// Cleanup deletes temporary files and directories. -func (b Buf) Cleanup() error { - if b.sdkProtoDir != "" { - return os.RemoveAll(b.sdkProtoDir) - } - return nil + return b.cache.Save(output, key) } // runCommand run the buf CLI command. @@ -228,8 +286,8 @@ func (b Buf) runCommand(ctx context.Context, cmd ...string) error { return exec.Exec(ctx, cmd, execOpts...) } -// generateCommand generate the buf CLI command. -func (b Buf) generateCommand( +// command generate the buf CLI command. +func (b Buf) command( c Command, flags map[string]string, args ...string, @@ -251,25 +309,3 @@ func (b Buf) generateCommand( } return command, nil } - -// findSDKProtoPath finds the Cosmos SDK proto folder path. -func findSDKProtoPath(protoDir string) string { - paths := strings.Split(protoDir, "@") - if len(paths) < 2 { - return protoDir - } - version := strings.Split(paths[1], "/")[0] - return fmt.Sprintf("%s@%s/proto", paths[0], version) -} - -// copySDKProtoDir copies the Cosmos SDK proto folder to a temporary directory. -// The temporary directory must be removed by the caller. -func copySDKProtoDir(protoDir string) (string, error) { - tmpDir, err := os.MkdirTemp("", "proto-sdk") - if err != nil { - return "", err - } - - srcPath := findSDKProtoPath(protoDir) - return tmpDir, xos.CopyFolder(srcPath, tmpDir) -} diff --git a/ignite/pkg/cosmosbuf/buf_test.go b/ignite/pkg/cosmosbuf/buf_test.go deleted file mode 100644 index 68187bf165..0000000000 --- a/ignite/pkg/cosmosbuf/buf_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package cosmosbuf - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestFindSDKPath(t *testing.T) { - testCases := []struct { - name string - protoDir string - want string - }{ - { - name: "full path", - protoDir: "/mod/github.com/cosmos/cosmos-sdk@v0.47.2/test/path/proto", - want: "/mod/github.com/cosmos/cosmos-sdk@v0.47.2/proto", - }, - { - name: "simple path", - protoDir: "myproto@v1/test/proto/animo/sdk", - want: "myproto@v1/proto", - }, - { - name: "only version", - protoDir: "test/myproto@v1", - want: "test/myproto@v1/proto", - }, - { - name: "semantic version", - protoDir: "test/myproto@v0.3.1/test/proto", - want: "test/myproto@v0.3.1/proto", - }, - { - name: "no version (local)", - protoDir: "test/myproto/test/proto", - want: "test/myproto/test/proto", - }, - } - - for _, tt := range testCases { - t.Run(tt.name, func(t *testing.T) { - got := findSDKProtoPath(tt.protoDir) - require.Equal(t, tt.want, got) - }) - } -} diff --git a/ignite/pkg/cosmosgen/cosmosgen.go b/ignite/pkg/cosmosgen/cosmosgen.go index 8a3dd8412e..7f3917d3d7 100644 --- a/ignite/pkg/cosmosgen/cosmosgen.go +++ b/ignite/pkg/cosmosgen/cosmosgen.go @@ -17,7 +17,6 @@ import ( // generateOptions used to configure code generation. type generateOptions struct { - includeDirs []string useCache bool updateBufModule bool ev events.Bus @@ -90,14 +89,6 @@ func WithOpenAPIGeneration(out string) Option { } } -// IncludeDirs configures the third party proto dirs that used by app's proto. -// relative to the projectPath. -func IncludeDirs(dirs []string) Option { - return func(o *generateOptions) { - o.includeDirs = dirs - } -} - // UpdateBufModule enables Buf config proto dependencies update. // This option updates app's Buf config when proto packages or // Buf modules are found within the Go dependencies. @@ -120,7 +111,7 @@ type generator struct { cacheStorage cache.Storage appPath string protoDir string - gomodPath string + goModPath string opts *generateOptions sdkImport string sdkDir string @@ -141,19 +132,17 @@ func (g *generator) cleanup() { // Generate generates code from protoDir of an SDK app residing at appPath with given options. // protoDir must be relative to the projectPath. -func Generate(ctx context.Context, cacheStorage cache.Storage, appPath, protoDir, gomodPath string, options ...Option) error { - b, err := cosmosbuf.New() +func Generate(ctx context.Context, cacheStorage cache.Storage, appPath, protoDir, goModPath string, options ...Option) error { + b, err := cosmosbuf.New(cacheStorage, goModPath) if err != nil { return err } - defer b.Cleanup() - g := &generator{ buf: b, appPath: appPath, protoDir: protoDir, - gomodPath: gomodPath, + goModPath: goModPath, opts: &generateOptions{}, thirdModules: make(map[string][]module.Module), thirdModuleIncludes: make(map[string]protoIncludes), diff --git a/ignite/pkg/cosmosgen/generate.go b/ignite/pkg/cosmosgen/generate.go index a9a3908456..8da6d7ca8f 100644 --- a/ignite/pkg/cosmosgen/generate.go +++ b/ignite/pkg/cosmosgen/generate.go @@ -212,12 +212,7 @@ func (g *generator) setup(ctx context.Context) (err error) { } func (g *generator) getProtoIncludeFolders(modPath string) []string { - // Add default protoDir and default includeDirs - includePaths := []string{filepath.Join(modPath, g.protoDir)} - for _, dir := range g.opts.includeDirs { - includePaths = append(includePaths, filepath.Join(modPath, dir)) - } - return includePaths + return []string{filepath.Join(modPath, g.protoDir)} } func (g *generator) findBufPath(modpath string) (string, error) { @@ -330,7 +325,7 @@ func (g generator) updateBufModule(ctx context.Context) error { // When a Buf config with name is available add it to app's dependencies // or otherwise export the proto files to a vendor directory. if includes.BufPath != "" { - if err := g.resolveBufDependency(ctx, pkgName, includes.BufPath); err != nil { + if err := g.resolveBufDependency(pkgName, includes.BufPath); err != nil { return err } } else { @@ -339,10 +334,16 @@ func (g generator) updateBufModule(ctx context.Context) error { } } } + if err := g.buf.Update( + ctx, + filepath.Dir(g.appIncludes.BufPath), + ); err != nil && !errors.Is(err, cosmosbuf.ErrProtoFilesNotFound) { + return err + } return nil } -func (g generator) resolveBufDependency(ctx context.Context, pkgName, bufPath string) error { +func (g generator) resolveBufDependency(pkgName, bufPath string) error { // Open the dependency Buf config to find the BSR package name f, err := os.Open(bufPath) if err != nil { @@ -361,13 +362,13 @@ func (g generator) resolveBufDependency(ctx context.Context, pkgName, bufPath st // When dependency package has a Buf config name try to add it to app's // dependencies. Name is optional and defines the BSR package name. if cfg.Name != "" { - return g.addBufDependency(ctx, cfg.Name) + return g.addBufDependency(cfg.Name) } // By default just vendor the proto package return g.vendorProtoPackage(pkgName, filepath.Dir(bufPath)) } -func (g generator) addBufDependency(ctx context.Context, depName string) error { +func (g generator) addBufDependency(depName string) error { // Read app's Buf config path := g.appIncludes.BufPath bz, err := os.ReadFile(path) @@ -413,8 +414,11 @@ func (g generator) addBufDependency(ctx context.Context, depName string) error { events.Icon(icons.OK), ) - // Update Buf lock so it contains the new dependency - return g.buf.Update(ctx, filepath.Dir(path), depName) + // TODO: Update Buf lock so it contains the new dependency, the new + // buf dep update command cannot be called by dependency name anymore. + // return g.buf.Update(ctx, filepath.Dir(path), depName) + + return nil } func (g generator) vendorProtoPackage(pkgName, protoPath string) (err error) { diff --git a/ignite/pkg/cosmosgen/generate_go.go b/ignite/pkg/cosmosgen/generate_go.go index 8df674f10f..25a820bf6a 100644 --- a/ignite/pkg/cosmosgen/generate_go.go +++ b/ignite/pkg/cosmosgen/generate_go.go @@ -7,6 +7,7 @@ import ( "github.com/otiai10/copy" + "github.com/ignite/cli/v28/ignite/pkg/cosmosbuf" "github.com/ignite/cli/v28/ignite/pkg/errors" ) @@ -18,41 +19,19 @@ func (g *generator) pulsarTemplate() string { return filepath.Join(g.appPath, g.protoDir, "buf.gen.pulsar.yaml") } -func (g *generator) generateGoGo(ctx context.Context) error { - // create a temporary dir to locate generated code under which later only some of them will be moved to the - // app's source code. this also prevents having leftover files in the app's source code or its parent dir - when - // command executed directly there - in case of an interrupt. - tmp, err := os.MkdirTemp("", "") - if err != nil { - return err - } - defer os.RemoveAll(tmp) - - protoPath := filepath.Join(g.appPath, g.protoDir) - - // code generate for each module. - err = g.buf.Generate(ctx, protoPath, tmp, g.gogoTemplate(), "module.proto") - if err != nil { - return err - } - - // move generated code for the app under the relative locations in its source code. - generatedPath := filepath.Join(tmp, g.gomodPath) - - _, err = os.Stat(generatedPath) - if err == nil { - err = copy.Copy(generatedPath, g.appPath) - if err != nil { - return errors.Wrap(err, "cannot copy path") - } - } else if !os.IsNotExist(err) { - return err - } +func (g *generator) protoPath() string { + return filepath.Join(g.appPath, g.protoDir) +} - return nil +func (g *generator) generateGoGo(ctx context.Context) error { + return g.generate(ctx, g.gogoTemplate(), g.goModPath, "*/module.proto") } func (g *generator) generatePulsar(ctx context.Context) error { + return g.generate(ctx, g.pulsarTemplate(), "") +} + +func (g *generator) generate(ctx context.Context, template, fromPath string, excluded ...string) error { // create a temporary dir to locate generated code under which later only some of them will be moved to the // app's source code. this also prevents having leftover files in the app's source code or its parent dir - when // command executed directly there - in case of an interrupt. @@ -62,18 +41,21 @@ func (g *generator) generatePulsar(ctx context.Context) error { } defer os.RemoveAll(tmp) - protoPath := filepath.Join(g.appPath, g.protoDir) - // code generate for each module. - err = g.buf.Generate(ctx, protoPath, tmp, g.pulsarTemplate()) - if err != nil { + if err := g.buf.Generate( + ctx, + g.protoPath(), + tmp, + template, + cosmosbuf.ExcludeFiles(excluded...), + ); err != nil { return err } // move generated code for the app under the relative locations in its source code. - _, err = os.Stat(tmp) - if err == nil { - err = copy.Copy(tmp, g.appPath) + path := filepath.Join(tmp, fromPath) + if _, err := os.Stat(path); err == nil { + err = copy.Copy(path, g.appPath) if err != nil { return errors.Wrap(err, "cannot copy path") } diff --git a/ignite/pkg/cosmosgen/generate_openapi.go b/ignite/pkg/cosmosgen/generate_openapi.go index 00fdec7d1c..b75077c852 100644 --- a/ignite/pkg/cosmosgen/generate_openapi.go +++ b/ignite/pkg/cosmosgen/generate_openapi.go @@ -6,11 +6,14 @@ import ( "os" "path/filepath" "sort" + "strings" + "github.com/blang/semver/v4" "github.com/iancoleman/strcase" "github.com/ignite/cli/v28/ignite/pkg/cache" "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/cosmosbuf" "github.com/ignite/cli/v28/ignite/pkg/dirchange" "github.com/ignite/cli/v28/ignite/pkg/errors" "github.com/ignite/cli/v28/ignite/pkg/nodetime" @@ -58,14 +61,16 @@ func (g *generator) generateOpenAPISpec(ctx context.Context) error { // gen generates a spec for a module where it's source code resides at src. // and adds needed swaggercombine configure for it. - gen := func(src string, m module.Module) (err error) { + gen := func(appPath, protoDir, name string) error { + name = strcase.ToCamel(name) + protoPath := filepath.Join(appPath, protoDir) + dir, err := os.MkdirTemp("", "gen-openapi-module-spec") if err != nil { return err } - checksumPaths := append([]string{m.Pkg.Path}, g.opts.includeDirs...) - checksum, err := dirchange.ChecksumFromPaths(src, checksumPaths...) + checksum, err := dirchange.ChecksumFromPaths(appPath, protoDir) if err != nil { return err } @@ -80,16 +85,31 @@ func (g *generator) generateOpenAPISpec(ctx context.Context) error { if err := os.WriteFile(specPath, existingSpec, 0o644); err != nil { return err } - return conf.AddSpec(strcase.ToCamel(m.Pkg.Name), specPath, true) + return conf.AddSpec(name, specPath) } hasAnySpecChanged = true - err = g.buf.Generate(ctx, m.Pkg.Path, dir, g.openAPITemplate(), "module.proto") - if err != nil { - return err + if err = g.buf.Generate( + ctx, + protoPath, + dir, + g.openAPITemplate(), + cosmosbuf.ExcludeFiles( + "*/module.proto", + "*/testutil/*", + "*/testdata/*", + "*/cosmos/orm/*", + "*/cosmos/reflection/*", + "*/cosmos/app/v1alpha1/*", + "*/cosmos/tx/config/v1/config.proto", + "*/cosmos/msg/textual/v1/textual.proto", + ), + cosmosbuf.FileByFile(), + ); err != nil { + return errors.Wrapf(err, "failed to generate openapi spec %s, probally you need to exclude some proto files", protoPath) } - specs, err := xos.FindFiles(dir, xos.JSONFile) + specs, err := xos.FindFilesExtension(dir, xos.JSONFile) if err != nil { return err } @@ -102,7 +122,7 @@ func (g *generator) generateOpenAPISpec(ctx context.Context) error { if err := specCache.Put(cacheKey, f); err != nil { return err } - if err := conf.AddSpec(strcase.ToCamel(m.Pkg.Name), spec, true); err != nil { + if err := conf.AddSpec(name, spec); err != nil { return err } } @@ -115,22 +135,27 @@ func (g *generator) generateOpenAPISpec(ctx context.Context) error { // after add their path and config to swaggercombine.Config so we can combine them // into a single spec. - add := func(src string, modules []module.Module) error { - for _, m := range modules { - if err := gen(src, m); err != nil { - return err - } - } - return nil - } - // protoc openapi generator acts weird on concurrent run, so do not use goroutines here. - if err := add(g.appPath, g.appModules); err != nil { + if err := gen(g.appPath, g.protoDir, g.goModPath); err != nil { return err } - for src, modules := range g.thirdModules { - if err := add(src, modules); err != nil { + doneMods := make(map[string]struct{}) + for _, modules := range g.thirdModules { + if len(modules) == 0 { + continue + } + var ( + m = modules[0] + path = extractRootModulePath(m.Pkg.Path) + ) + + if _, ok := doneMods[path]; ok { + continue + } + doneMods[path] = struct{}{} + + if err := gen(path, "", m.Name); err != nil { return err } } @@ -195,12 +220,12 @@ func (g *generator) generateModuleOpenAPISpec(ctx context.Context, m module.Modu return err } - err = g.buf.Generate(ctx, m.Pkg.Path, dir, g.openAPITemplateForSTA(), "module.proto") + err = g.buf.Generate(ctx, m.Pkg.Path, dir, g.openAPITemplateForSTA(), cosmosbuf.ExcludeFiles("module.proto")) if err != nil { return err } - specs, err := xos.FindFiles(dir, xos.JSONFile) + specs, err := xos.FindFilesExtension(dir, xos.JSONFile) if err != nil { return err } @@ -209,7 +234,7 @@ func (g *generator) generateModuleOpenAPISpec(ctx context.Context, m module.Modu if err != nil { return err } - if err := conf.AddSpec(strcase.ToCamel(m.Pkg.Name), spec, false); err != nil { + if err := conf.AddSpec(strcase.ToCamel(m.Pkg.Name), spec); err != nil { return err } } @@ -221,7 +246,6 @@ func (g *generator) generateModuleOpenAPISpec(ctx context.Context, m module.Modu // generate specs for each module and persist them in the file system // after add their path and config to swaggercombine.Config so we can combine them // into a single spec. - add := func(modules []module.Module) error { for _, m := range modules { if err := gen(m); err != nil { @@ -246,3 +270,21 @@ func (g *generator) generateModuleOpenAPISpec(ctx context.Context, m module.Modu // combine specs into one and save to out. return swaggercombine.Combine(ctx, conf, command, out) } + +func extractRootModulePath(fullPath string) string { + var ( + segments = strings.Split(fullPath, "/") + modulePath = "/" + ) + + for _, segment := range segments { + modulePath = filepath.Join(modulePath, segment) + segmentName := strings.Split(segment, "@") + if len(segmentName) > 1 { + if _, err := semver.ParseTolerant(segmentName[1]); err == nil { + return modulePath + } + } + } + return fullPath +} diff --git a/ignite/pkg/cosmosgen/generate_openapi_test.go b/ignite/pkg/cosmosgen/generate_openapi_test.go new file mode 100644 index 0000000000..eca07b518d --- /dev/null +++ b/ignite/pkg/cosmosgen/generate_openapi_test.go @@ -0,0 +1,57 @@ +package cosmosgen + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_extractRootModulePath(t *testing.T) { + tests := []struct { + name string + path string + want string + }{ + { + name: "test cosmos-sdk path", + path: "/Users/ignite/Desktop/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/proto/cosmos/distribution/v1beta1", + want: "/Users/ignite/Desktop/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6", + }, + { + name: "test cosmos-sdk module proto path", + path: "/Users/ignite/Desktop/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/bank", + want: "/Users/ignite/Desktop/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6", + }, + { + name: "test ibc path", + path: "/Users/ignite/Desktop/go/pkg/mod/github.com/cosmos/ibc-go/v8@v8.2.0/proto/ibc/applications/interchain_accounts/controller/v1", + want: "/Users/ignite/Desktop/go/pkg/mod/github.com/cosmos/ibc-go/v8@v8.2.0", + }, + { + name: "test chain path", + path: "/Users/ignite/Desktop/go/src/github.com/ignite/venus", + want: "/Users/ignite/Desktop/go/src/github.com/ignite/venus", + }, + { + name: "test module path without version", + path: "/Users/ignite/Desktop/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/proto/applications", + want: "/Users/ignite/Desktop/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/proto/applications", + }, + { + name: "test module path with broken version", + path: "/Users/ignite/Desktop/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.$/controller", + want: "/Users/ignite/Desktop/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.$/controller", + }, + { + name: "test module path with v2 version", + path: "/Users/ignite/Desktop/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@v2.19.1/proto/files", + want: "/Users/ignite/Desktop/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@v2.19.1", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := extractRootModulePath(tt.path) + require.Equal(t, tt.want, got) + }) + } +} diff --git a/ignite/pkg/cosmosgen/generate_typescript.go b/ignite/pkg/cosmosgen/generate_typescript.go index 1fbad56f41..314b0e8409 100644 --- a/ignite/pkg/cosmosgen/generate_typescript.go +++ b/ignite/pkg/cosmosgen/generate_typescript.go @@ -106,7 +106,7 @@ func (g *tsGenerator) generateModuleTemplates(ctx context.Context) error { gg.Go(func() error { cacheKey := m.Pkg.Path - paths := append([]string{m.Pkg.Path, g.g.opts.jsOut(m)}, g.g.opts.includeDirs...) + paths := []string{m.Pkg.Path, g.g.opts.jsOut(m)} // Always generate module templates by default unless cache is enabled, in which // case the module template is generated when one or more files were changed in diff --git a/ignite/pkg/cosmosgen/generate_vuex.go b/ignite/pkg/cosmosgen/generate_vuex.go index bcb29f34db..a9c9f5d7db 100644 --- a/ignite/pkg/cosmosgen/generate_vuex.go +++ b/ignite/pkg/cosmosgen/generate_vuex.go @@ -69,7 +69,6 @@ func (g *generator) updateVueDependencies() error { tsClientName: fmt.Sprintf("file:%s", tsClientVueRelPath), }, }) - if err != nil { return errors.Errorf("failed to link ts-client dependency to the Vue app: %w", err) } @@ -136,7 +135,6 @@ func (g *generator) updateVuexDependencies() error { tsClientName: fmt.Sprintf("file:%s", tsClientVuexRelPath), }, }) - if err != nil { return errors.Errorf("failed to link ts-client dependency to the Vuex stores: %w", err) } diff --git a/ignite/pkg/dircache/cache.go b/ignite/pkg/dircache/cache.go new file mode 100644 index 0000000000..d4158a94be --- /dev/null +++ b/ignite/pkg/dircache/cache.go @@ -0,0 +1,111 @@ +package dircache + +import ( + "crypto/sha256" + "fmt" + "os" + "path/filepath" + + "github.com/otiai10/copy" + + "github.com/ignite/cli/v28/ignite/config" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/dirchange" + "github.com/ignite/cli/v28/ignite/pkg/errors" +) + +var ErrCacheNotFound = errors.New("cache not found") + +type Cache struct { + path string + storageCache cache.Cache[string] +} + +// New creates a new Buf based on the installed binary. +func New(cacheStorage cache.Storage, dir, specNamespace string) (Cache, error) { + path, err := cachePath() + if err != nil { + return Cache{}, err + } + path = filepath.Join(path, dir) + if err := os.MkdirAll(path, 0o755); err != nil && !os.IsExist(err) { + return Cache{}, err + } + + return Cache{ + path: path, + storageCache: cache.New[string](cacheStorage, specNamespace), + }, nil +} + +// ClearCache remove the cache path. +func ClearCache() error { + path, err := cachePath() + if err != nil { + return err + } + return os.RemoveAll(path) +} + +// cachePath returns the cache path. +func cachePath() (string, error) { + globalPath, err := config.DirPath() + if err != nil { + return "", err + } + return filepath.Join(globalPath, "cache"), nil +} + +// cacheKey create the cache key. +func cacheKey(src string, keys ...string) (string, error) { + checksum, err := dirchange.ChecksumFromPaths(src, "") + if err != nil { + return "", err + } + + h := sha256.New() + if _, err := h.Write(checksum); err != nil { + return "", err + } + for _, key := range keys { + if _, err := h.Write([]byte(key)); err != nil { + return "", err + } + } + return fmt.Sprintf("%x", h.Sum(nil)), nil +} + +// CopyTo gets the cache folder based on the cache key from the storage and copies the folder to the output. +func (c Cache) CopyTo(src, output string, keys ...string) (string, error) { + key, err := cacheKey(src, keys...) + if err != nil { + return key, err + } + + cachedPath, err := c.storageCache.Get(key) + if errors.Is(err, cache.ErrorNotFound) { + return key, ErrCacheNotFound + } else if err != nil { + return key, err + } + + if err := copy.Copy(cachedPath, output); err != nil { + return "", errors.Wrapf(err, "get dir cache cannot copy path %s to %s", cachedPath, output) + } + return key, nil +} + +// Save copies the source to the cache folder and saves the path into the storage based on the key. +func (c Cache) Save(src, key string) error { + path := filepath.Join(c.path, key) + if err := os.Mkdir(path, 0o700); os.IsExist(err) { + return nil + } else if err != nil { + return err + } + + if err := copy.Copy(src, path); err != nil { + return errors.Wrapf(err, "save dir cache cannot copy path %s to %s", src, path) + } + return c.storageCache.Put(key, path) +} diff --git a/ignite/pkg/dircache/cache_test.go b/ignite/pkg/dircache/cache_test.go new file mode 100644 index 0000000000..ac3c0b5740 --- /dev/null +++ b/ignite/pkg/dircache/cache_test.go @@ -0,0 +1,87 @@ +package dircache + +import ( + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ignite/cli/v28/ignite/pkg/errors" +) + +func Test_cacheKey(t *testing.T) { + wd, err := os.Getwd() + require.NoError(t, err) + wd = filepath.Join(wd, "testdata") + + type args struct { + src string + keys []string + } + tests := []struct { + name string + args args + want string + err error + }{ + { + name: "no keys", + args: args{ + src: wd, + }, + want: "78f544d2184b8076ac527ba4728822de1a7fc77bf2d6a77e44d0193cb63ed26e", + }, + { + name: "one key", + args: args{ + src: wd, + keys: []string{"test"}, + }, + want: "5701099a1fcc67cd8b694295fbdecf537edcc8733bcc3adae0bdd7e65e28c8e5", + }, + { + name: "two keys", + args: args{ + src: wd, + keys: []string{"test1", "test2"}, + }, + want: "6299c9bd405a1c073fa711006f8aadf6420cf522ef446e36fc01586354726095", + }, + { + name: "duplicated keys", + args: args{ + src: wd, + keys: []string{"test", "test"}, + }, + want: "b9eb1b01931deccc44a354ab5aeb52337a465e5559069eb35b71ea0cbfe3c87f", + }, + { + name: "many keys", + args: args{ + src: wd, + keys: []string{"test1", "test2", "test3", "test4", "test5", "test6", "test6"}, + }, + want: "bbe74cfd33ba4d1244e8d0ea3e430081d06ed55be12c7772d345d3117a4dfc90", + }, + { + name: "invalid source", + args: args{ + src: "invalid_source", + }, + err: errors.New("no file in specified paths"), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := cacheKey(tt.args.src, tt.args.keys...) + if tt.err != nil { + require.Error(t, err) + require.Equal(t, tt.err.Error(), err.Error()) + return + } + require.NoError(t, err) + require.Equal(t, tt.want, got) + }) + } +} diff --git a/ignite/pkg/dircache/testdata/subdata/subfile b/ignite/pkg/dircache/testdata/subdata/subfile new file mode 100644 index 0000000000..41823eb5b1 --- /dev/null +++ b/ignite/pkg/dircache/testdata/subdata/subfile @@ -0,0 +1 @@ +subtest \ No newline at end of file diff --git a/ignite/pkg/dircache/testdata/testfile b/ignite/pkg/dircache/testdata/testfile new file mode 100644 index 0000000000..30d74d2584 --- /dev/null +++ b/ignite/pkg/dircache/testdata/testfile @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/ignite/pkg/nodetime/programs/swagger-combine/swagger-combine.go b/ignite/pkg/nodetime/programs/swagger-combine/swagger-combine.go index 285f229e46..32ca26528b 100644 --- a/ignite/pkg/nodetime/programs/swagger-combine/swagger-combine.go +++ b/ignite/pkg/nodetime/programs/swagger-combine/swagger-combine.go @@ -2,7 +2,10 @@ package swaggercombine import ( "context" + "crypto/md5" + "encoding/hex" "encoding/json" + "fmt" "io" "os" "regexp" @@ -39,7 +42,7 @@ type OperationIDs struct { var opReg = regexp.MustCompile(`(?m)operationId.+?(\w+)`) // AddSpec adds a new OpenAPI spec to Config by path in the fs and unique id of spec. -func (c *Config) AddSpec(id, path string, makeUnique bool) error { +func (c *Config) AddSpec(id, path string) error { // make operationId fields unique. f, err := os.Open(path) if err != nil { @@ -52,16 +55,13 @@ func (c *Config) AddSpec(id, path string, makeUnique bool) error { return err } + hash := hex.EncodeToString(md5.New().Sum([]byte(path))) ops := opReg.FindAllStringSubmatch(string(content), -1) rename := make(map[string]string, len(ops)) for _, op := range ops { o := op[1] - if makeUnique { - rename[o] = id + o - } else { - rename[o] = o - } + rename[o] = fmt.Sprintf("%s_%s_%s", id, o, hash) } // add api with replaced operation ids. diff --git a/ignite/pkg/repoversion/repoversion.go b/ignite/pkg/repoversion/repoversion.go index 4428a5d41b..f2f3e560ec 100644 --- a/ignite/pkg/repoversion/repoversion.go +++ b/ignite/pkg/repoversion/repoversion.go @@ -50,7 +50,6 @@ func Determine(path string) (v Version, err error) { return nil }) - if err != nil { return Version{}, err } @@ -94,7 +93,6 @@ func Determine(path string) (v Version, err error) { return nil }) - if err != nil { return Version{}, err } diff --git a/ignite/pkg/xos/files.go b/ignite/pkg/xos/files.go index 60eb6e4a0e..0ef8ea661c 100644 --- a/ignite/pkg/xos/files.go +++ b/ignite/pkg/xos/files.go @@ -11,7 +11,21 @@ const ( ProtoFile = "proto" ) -func FindFiles(directory, extension string) ([]string, error) { +func FindFiles(directory string) ([]string, error) { + files := make([]string, 0) + return files, filepath.Walk(directory, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + if !info.IsDir() { + files = append(files, path) + } + return nil + }) +} + +func FindFilesExtension(directory, extension string) ([]string, error) { files := make([]string, 0) return files, filepath.Walk(directory, func(path string, info os.FileInfo, err error) error { if err != nil { diff --git a/ignite/pkg/xos/files_test.go b/ignite/pkg/xos/files_test.go index d5da93e5e5..020e2b2454 100644 --- a/ignite/pkg/xos/files_test.go +++ b/ignite/pkg/xos/files_test.go @@ -26,6 +26,13 @@ func TestFindFiles(t *testing.T) { want: []string{"file1.json", "file3.json", "file4.json"}, err: nil, }, + { + name: "test 3 json files with subfolder", + files: []string{"testdata/file1.json", "file2.txt", "foo/file3.json", "file4.json"}, + extension: "json", + want: []string{"testdata/file1.json", "foo/file3.json", "file4.json"}, + err: nil, + }, { name: "test 1 txt files", files: []string{"file1.json", "file2.txt", "file3.json", "file4.json"}, @@ -59,12 +66,13 @@ func TestFindFiles(t *testing.T) { for _, filename := range tt.files { filePath := filepath.Join(tempDir, filename) + require.NoError(t, os.MkdirAll(filepath.Dir(filePath), 0o755)) file, err := os.Create(filePath) require.NoError(t, err) require.NoError(t, file.Close()) } - gotFiles, err := xos.FindFiles(tempDir, tt.extension) + gotFiles, err := xos.FindFilesExtension(tempDir, tt.extension) if tt.err != nil { require.Error(t, err) require.ErrorIs(t, err, tt.err) @@ -76,7 +84,7 @@ func TestFindFiles(t *testing.T) { for i, filename := range tt.want { want[i] = filepath.Join(tempDir, filename) } - require.EqualValues(t, want, gotFiles) + require.ElementsMatch(t, want, gotFiles) }) } } diff --git a/ignite/services/chain/chain.go b/ignite/services/chain/chain.go index eeae83dcc3..54288d92a8 100644 --- a/ignite/services/chain/chain.go +++ b/ignite/services/chain/chain.go @@ -34,7 +34,6 @@ var appBackendSourceWatchPaths = []string{ "cmd", "x", "proto", - "third_party", } type ( diff --git a/ignite/services/chain/generate.go b/ignite/services/chain/generate.go index 66bda129e6..8178660ecd 100644 --- a/ignite/services/chain/generate.go +++ b/ignite/services/chain/generate.go @@ -162,10 +162,7 @@ func (c *Chain) Generate( c.ev.Send("Building proto...", events.ProgressUpdate()) - options := []cosmosgen.Option{ - cosmosgen.CollectEvents(c.ev), - cosmosgen.IncludeDirs(conf.Build.Proto.ThirdPartyPaths), - } + options := []cosmosgen.Option{cosmosgen.CollectEvents(c.ev)} if targetOptions.isGoEnabled { options = append(options, cosmosgen.WithGoGeneration()) diff --git a/ignite/services/chain/init.go b/ignite/services/chain/init.go index c681acc645..067acded3d 100644 --- a/ignite/services/chain/init.go +++ b/ignite/services/chain/init.go @@ -9,7 +9,7 @@ import ( "github.com/imdario/mergo" chainconfig "github.com/ignite/cli/v28/ignite/config/chain" - "github.com/ignite/cli/v28/ignite/internal/plugin" + plugininternal "github.com/ignite/cli/v28/ignite/internal/plugin" chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner" "github.com/ignite/cli/v28/ignite/pkg/cliui/view/accountview" "github.com/ignite/cli/v28/ignite/pkg/confile" diff --git a/ignite/services/scaffolder/scaffolder.go b/ignite/services/scaffolder/scaffolder.go index 3d765de913..1968d9b381 100644 --- a/ignite/services/scaffolder/scaffolder.go +++ b/ignite/services/scaffolder/scaffolder.go @@ -92,7 +92,6 @@ func protoc(ctx context.Context, cacheStorage cache.Storage, projectPath, gomodP options := []cosmosgen.Option{ cosmosgen.UpdateBufModule(), cosmosgen.WithGoGeneration(), - cosmosgen.IncludeDirs(conf.Build.Proto.ThirdPartyPaths), } // Generate Typescript client code if it's enabled or when Vuex stores are generated diff --git a/ignite/templates/app/files/go.mod.plush b/ignite/templates/app/files/go.mod.plush index 61e6a32310..761682af4e 100644 --- a/ignite/templates/app/files/go.mod.plush +++ b/ignite/templates/app/files/go.mod.plush @@ -27,7 +27,7 @@ require ( <%= if (IsConsumerChain) { %> github.com/cosmos/interchain-security/v5 v5.0.0 <% } %> - github.com/bufbuild/buf v1.30.1 + github.com/bufbuild/buf v1.34.0 github.com/cometbft/cometbft v0.38.8 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 @@ -39,13 +39,13 @@ require ( github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.18.2 + github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - golang.org/x/tools v0.20.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa - google.golang.org/grpc v1.63.2 + golang.org/x/tools v0.22.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 + google.golang.org/grpc v1.64.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 - google.golang.org/protobuf v1.34.1 -) + google.golang.org/protobuf v1.34.2 +) \ No newline at end of file diff --git a/ignite/templates/app/files/proto/buf.lock b/ignite/templates/app/files/proto/buf.lock index 77287f75ce..1ac5cf1729 100644 --- a/ignite/templates/app/files/proto/buf.lock +++ b/ignite/templates/app/files/proto/buf.lock @@ -8,24 +8,30 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: 954f7b05f38440fc8250134b15adec47 + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba - remote: buf.build owner: cosmos repository: ics23 - commit: 3c44d8daa8b44059ac744cd17d4a49d7 + commit: a9ee7c290ef34ee69d3f141b9b44dcee + digest: shake256:255dbee3e92a370723bf4d72b34868b18e7570543f30f79c0c8c10a5a332d230175e0c29cb7ebcb8020706312e3cd37c23974df0bacfb60a4afb968fee4c1afc - remote: buf.build owner: googleapis repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 + commit: 09703837a2ed48dbbbb3fdfbe6a84f5c + digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95 - remote: buf.build owner: protocolbuffers repository: wellknowntypes - commit: 44e83bc050a4497fa7b36b34d95ca156 + commit: 3186086b2a8e44d9acdeeef2423c5de7 + digest: shake256:3b9dc2f56d9ed2e4001f95b701985fd803f7e2559b19b6a18d5f4e792cfdde320e765638de69fff037edc202b0006532d7ff19eab9465526b5ec628e4a5e5a1a \ No newline at end of file diff --git a/integration/app/proto_test.go b/integration/app/proto_test.go index 5c0eb04b44..4b3c03921a 100644 --- a/integration/app/proto_test.go +++ b/integration/app/proto_test.go @@ -8,8 +8,9 @@ import ( "strings" "testing" - envtest "github.com/ignite/cli/v28/integration" "github.com/stretchr/testify/require" + + envtest "github.com/ignite/cli/v28/integration" ) // TestGenerateAppCheckBufPulsarPath tests scaffolding a new chain and checks if the buf.gen.pulsar.yaml file is correct diff --git a/integration/doctor/testdata/config-need-migrate.txt b/integration/doctor/testdata/config-need-migrate.txt index e63ad504c4..ce11ac5fd0 100644 --- a/integration/doctor/testdata/config-need-migrate.txt +++ b/integration/doctor/testdata/config-need-migrate.txt @@ -35,9 +35,6 @@ version: 1 build: proto: path: proto - third_party_paths: - - third_party/proto - - proto_vendor accounts: - name: alice coins: diff --git a/integration/doctor/testdata/missing-tools.go.txt b/integration/doctor/testdata/missing-tools.go.txt index 766163d9b8..a3e3a552b6 100644 --- a/integration/doctor/testdata/missing-tools.go.txt +++ b/integration/doctor/testdata/missing-tools.go.txt @@ -17,7 +17,7 @@ version: 1 module github.com/ignite/cli require ( - github.com/bufbuild/buf v1.30.1 + github.com/bufbuild/buf v1.34.0 ) go 1.20 diff --git a/integration/relayer/cmd_relayer_test.go b/integration/relayer/cmd_relayer_test.go index a3b15f813e..4dcbf7d0b0 100644 --- a/integration/relayer/cmd_relayer_test.go +++ b/integration/relayer/cmd_relayer_test.go @@ -40,8 +40,7 @@ var ( Version: 1, Build: base.Build{ Proto: base.Proto{ - Path: "proto", - ThirdPartyPaths: []string{"third_party/proto", "proto_vendor"}, + Path: "proto", }, }, Accounts: []base.Account{ @@ -91,8 +90,7 @@ var ( Version: 1, Build: base.Build{ Proto: base.Proto{ - Path: "proto", - ThirdPartyPaths: []string{"third_party/proto", "proto_vendor"}, + Path: "proto", }, }, Accounts: []base.Account{