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: create a message for authenticate buf for generate ts-client (backport #4322) #4332

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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 @@ -6,6 +6,7 @@

- [#4292](https://github.com/ignite/cli/pull/4292) Bump Cosmos SDK to `v0.50.9`
- [#4309](https://github.com/ignite/cli/pull/4309) Fix chain id for chain simulations
- [#4322](https://github.com/ignite/cli/pull/4322) Create a message for authenticate buf for generate ts-client

### Fixes

Expand Down
16 changes: 16 additions & 0 deletions ignite/cmd/generate_typescript_client.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
package ignitecmd

import (
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"

<<<<<<< HEAD

Check failure on line 7 in ignite/cmd/generate_typescript_client.go

View workflow job for this annotation

GitHub Actions / test network on ubuntu-latest

missing import path

Check failure on line 7 in ignite/cmd/generate_typescript_client.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

missing import path

Check failure on line 7 in ignite/cmd/generate_typescript_client.go

View workflow job for this annotation

GitHub Actions / test network on macos-latest

missing import path
"github.com/ignite/cli/v28/ignite/pkg/cliui"
"github.com/ignite/cli/v28/ignite/pkg/cliui/icons"
"github.com/ignite/cli/v28/ignite/services/chain"
=======
"github.com/ignite/cli/v29/ignite/pkg/cliui"
"github.com/ignite/cli/v29/ignite/pkg/cliui/icons"
"github.com/ignite/cli/v29/ignite/pkg/errors"
"github.com/ignite/cli/v29/ignite/services/chain"
>>>>>>> 7ff4b5d1 (feat: create a message for authenticate buf for generate ts-client (#4322))
)

const (
flagUseCache = "use-cache"
msgBufAuth = "Generate ts-client depends on a 'buf.build' remote plugin, and as of August 1, 2024, Buf will begin limiting remote plugin requests from unauthenticated users on 'buf.build'. If you send more than ten unauthenticated requests per hour using remote plugins, you’ll start to see rate limit errors. Please authenticate before running ts-client command using 'buf registry login' command and follow the instructions. For more info, check https://buf.build/docs/generate/auth-required."
)

func NewGenerateTSClient() *cobra.Command {
Expand Down Expand Up @@ -48,6 +57,13 @@
session := cliui.New(cliui.StartSpinnerWithText(statusGenerating))
defer session.End()

if err := session.AskConfirm(msgBufAuth); err != nil {
if errors.Is(err, promptui.ErrAbort) {
return errors.New("buf not auth")
}
return err
}

c, err := chain.NewWithHomeFlags(
cmd,
chain.WithOutputer(session),
Expand Down
2 changes: 2 additions & 0 deletions integration/cosmosgen/cosmosgen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
)

func TestCosmosGenScaffold(t *testing.T) {
t.Skip("skip till we add a buf token into the CI")

var (
env = envtest.New(t)
app = env.Scaffold("github.com/test/blog")
Expand Down
Loading