Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve buf rate limit #4133

Merged
merged 32 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9663523
draft improvements
May 8, 2024
0389eb2
use --path flag mutilple times
May 9, 2024
b86760e
remove `Build.Proto.ThirdPartyPaths` from the config
May 9, 2024
11c162e
add logic for run buf by folder or by file
May 11, 2024
46ce071
update cosmos-sdk
May 13, 2024
9cc7c19
Merge branch 'main' into feat/improve-buf-rate
Pantani May 13, 2024
121fe26
fix exclude files for swagger
May 13, 2024
8a792a8
fix buf cache
May 13, 2024
9e5b7a0
Merge branch 'main' into feat/improve-buf-rate
Pantani May 13, 2024
fab3e8e
add changelog
May 13, 2024
23f30da
update buf deps
May 13, 2024
697c1bf
fix unit test
May 13, 2024
f0195ec
fix wrong proto go path
May 13, 2024
c044a5b
clear buf cache
May 14, 2024
94966e3
Merge branch 'main' into feat/improve-buf-rate
Pantani May 14, 2024
4acabf3
fix doctor tests and remove `third_party_paths` from the docs
May 14, 2024
0233929
Merge remote-tracking branch 'origin/main' into feat/improve-buf-rate
May 14, 2024
b647f09
improve Test_extractRootModulePath test cases
May 14, 2024
b458d83
Merge branch 'main' into feat/improve-buf-rate
Pantani May 15, 2024
22c0400
Update ignite/pkg/cosmosbuf/cache.go
Pantani May 16, 2024
5495846
Merge branch 'main' into feat/improve-buf-rate
Pantani May 16, 2024
9d9d807
fix changelog.md
Pantani May 16, 2024
a909515
improve cache logic
May 16, 2024
d2f2c5f
Merge remote-tracking branch 'origin/main' into feat/improve-buf-rate
May 16, 2024
d11942a
create a dircache pkg
May 16, 2024
bd94345
add comments
May 16, 2024
c72bbcb
Merge branch 'main' into feat/improve-buf-rate
Pantani May 16, 2024
f6aeed7
rename methods `CopyCache` to `CopyTo` and `SaveCache` to `Save`
May 17, 2024
b3486aa
Merge branch 'main' into feat/improve-buf-rate
Pantani May 17, 2024
bb834c1
Merge branch 'main' into feat/improve-buf-rate
Pantani May 18, 2024
cb7463c
Merge branch 'main' into feat/improve-buf-rate
Pantani May 20, 2024
a8be808
Merge branch 'main' into feat/improve-buf-rate
Pantani May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [#4077](https://github.com/ignite/cli/pull/4077) Merge the swagger files manually instead use nodetime `swagger-combine`
- [#4100](https://github.com/ignite/cli/pull/4100) Set the `proto-dir` flag only for the `scaffold chain` command and use the proto path from the config
- [#4111](https://github.com/ignite/cli/pull/4111) Remove vuex generation
- [#4133](https://github.com/ignite/cli/pull/4133) Improve buf rate limit
- [#4113](https://github.com/ignite/cli/pull/4113) Generate chain config documentation automatically
- [#4131](https://github.com/ignite/cli/pull/4131) Support `bytes` as data type in the `scaffold` commands

Expand Down
6 changes: 0 additions & 6 deletions docs/docs/02-guide/06-ibc.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,6 @@ version: 1
build:
proto:
path: proto
third_party_paths:
- third_party/proto
- proto_vendor
accounts:
- name: alice
coins:
Expand Down Expand Up @@ -463,9 +460,6 @@ version: 1
build:
proto:
path: proto
third_party_paths:
- third_party/proto
- proto_vendor
accounts:
- name: alice
coins:
Expand Down
6 changes: 0 additions & 6 deletions docs/docs/02-guide/07-interchange/02-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ version: 1
build:
proto:
path: proto
third_party_paths:
- third_party/proto
- proto_vendor
accounts:
- name: alice
coins:
Expand Down Expand Up @@ -164,9 +161,6 @@ version: 1
build:
proto:
path: proto
third_party_paths:
- third_party/proto
- proto_vendor
accounts:
- name: alice
coins:
Expand Down
11 changes: 0 additions & 11 deletions docs/docs/08-references/02-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion docs/versioned_docs/version-v0.25/kb/03-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ build:
| Key | Required | Type | Description |
| ----------------- | -------- | --------------- | ------------------------------------------------------------------------------------------ |
| path | N | String | Path to protocol buffer files. Default: `"proto"`. |
| third_party_paths | N | List of Strings | Path to third-party protocol buffer files. Default: `["third_party/proto", "proto_vendor"]`. |

## client

Expand Down
8 changes: 0 additions & 8 deletions docs/versioned_docs/version-v0.25/kb/06-proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,3 @@ Third-party proto files, including those of Cosmos SDK and Tendermint, are bundl
```protobuf
import "cosmos/base/query/v1beta1/pagination.proto";
```

You can also manually add third-party proto files. By default, Ignite CLI imports proto files from these directories: `third_party/proto` and `proto_vendor`. You can define third-party paths of the import directory in `config.yml`:

```yaml
build:
proto:
third_party_paths: ["my_third_party_proto"]
```
4 changes: 4 additions & 0 deletions ignite/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ignite/cli/v29/ignite/pkg/cache"
"github.com/ignite/cli/v29/ignite/pkg/cliui"
uilog "github.com/ignite/cli/v29/ignite/pkg/cliui/log"
"github.com/ignite/cli/v29/ignite/pkg/dircache"
"github.com/ignite/cli/v29/ignite/pkg/errors"
"github.com/ignite/cli/v29/ignite/pkg/gitpod"
"github.com/ignite/cli/v29/ignite/pkg/goenv"
Expand Down Expand Up @@ -275,6 +276,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
Expand Down
7 changes: 1 addition & 6 deletions ignite/config/chain/base/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,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" doc:"Relative path where the application's proto files are located."`

// 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" doc:"Relative paths to third-party proto files used by the application."`
}

// Client configures code generation for clients.
Expand Down Expand Up @@ -174,8 +170,7 @@ func DefaultConfig() Config {
return Config{
Build: Build{
Proto: Proto{
Path: defaults.ProtoDir,
ThirdPartyPaths: []string{"third_party/proto", "proto_vendor"},
Path: defaults.ProtoDir,
},
},
Faucet: Faucet{
Expand Down
3 changes: 1 addition & 2 deletions ignite/config/chain/v1/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,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{
Expand Down
3 changes: 0 additions & 3 deletions ignite/config/chain/v1/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ build:
binary: evmosd
proto:
path: proto
third_party_paths:
- third_party/proto
- proto_vendor
accounts:
- name: alice
coins:
Expand Down
3 changes: 0 additions & 3 deletions ignite/config/chain/v1/testdata/config2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ build:
binary: evmosd
proto:
path: proto
third_party_paths:
- third_party/proto
- proto_vendor
accounts:
- name: alice
coins:
Expand Down
9 changes: 5 additions & 4 deletions ignite/internal/analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"

"github.com/ignite/cli/v29/ignite/config"
"github.com/ignite/cli/v29/ignite/pkg/gacli"
"github.com/ignite/cli/v29/ignite/pkg/gitpod"
"github.com/ignite/cli/v29/ignite/pkg/randstr"
Expand All @@ -23,7 +24,6 @@ const (
envDoNotTrack = "DO_NOT_TRACK"
envCI = "CI"
envGitHubActions = "GITHUB_ACTIONS"
igniteDir = ".ignite"
igniteAnonIdentity = "anon_identity.json"
)

Expand Down Expand Up @@ -79,14 +79,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
Expand Down
Loading
Loading