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: use buf.build binary to generate the proto files #3476

Merged
merged 72 commits into from
Jul 3, 2023
Merged

Conversation

Pantani
Copy link
Collaborator

@Pantani Pantani commented Mar 30, 2023

close #3458

  • Scaffold a chain:
ignite s chain github.com/ignite/earth && cd earth
  • You can also try to generate the profiles automatically. Ignite will install the buf binary for you:
buf generate --template proto/buf.gen.gogo.yaml

@Pantani Pantani self-assigned this Mar 30, 2023
@Pantani Pantani marked this pull request as ready for review April 25, 2023 19:20
@Pantani Pantani changed the title refactor: use buf.build binary to generate the proto files feat: use buf.build binary to generate the proto files Apr 25, 2023
Pantani added 8 commits April 25, 2023 16:40
# Conflicts:
#	ignite/cmd/model/chain_debug.go
#	ignite/cmd/model/chain_serve.go
#	ignite/pkg/cmdrunner/cmdrunner.go
#	ignite/pkg/cosmosgen/generate.go
#	ignite/pkg/cosmosgen/generate_openapi.go
#	ignite/pkg/cosmosgen/install.go
#	ignite/pkg/protoc/data/include/gogoproto/gogo.proto
#	ignite/templates/app/files/go.mod.plush
#	integration/doctor/testdata/config-ok.txt
#	integration/doctor/testdata/existing-tools.go.txt
#	integration/doctor/testdata/missing-tools.go.txt
Copy link
Member

@ilgooz ilgooz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had an error with ignite g ts-client when running it on the latest commit of SPN. Looks like related to buf. Can you please take a look?

Also on SPN, shouldn't fundraising module auto discovered and added to the generated buf files?

@Pantani
Copy link
Collaborator Author

Pantani commented Jun 23, 2023

The Buf migration was missing for the generate tools. It's fixed now

@Pantani Pantani requested a review from ilgooz June 23, 2023 13:39
// can't download this folder because is unused as a dependency. We need to
// change the workspace copying the files to another folder and generate the
// files.
if strings.Contains(protoDir, cosmosSDKModulePath) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if strings.Contains(protoDir, cosmosSDKModulePath) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilgooz, I made a double-check here. We can't remove this validation. Buf will solve the dependencies for the proto files. But we still need to go one by one of the Golang project dependencies and compile the proto files for the ts-client and open API spec generation. This workaround solves the issue regarding the invalid proto path (orm/internal) download into the go mod for cosmos-sdk buf workspace

@Pantani Pantani requested a review from ilgooz June 26, 2023 22:02
ignite/cmd/chain.go Outdated Show resolved Hide resolved
ignite/pkg/buf/buf.go Outdated Show resolved Hide resolved
ignite/pkg/buf/buf.go Outdated Show resolved Hide resolved
@Pantani Pantani requested review from ilgooz and jeronimoalbi June 29, 2023 18:42
@ilgooz ilgooz merged commit f7acf08 into main Jul 3, 2023
@ilgooz ilgooz deleted the feat/buf-build branch July 3, 2023 12:39
jmastr added a commit to planetmint/planetmint-go that referenced this pull request Jul 4, 2023
- Code generation using protoc is only supported by Ignite CLI v0.26.1
or older

Wait til ignite/cli#3476 is released

Signed-off-by: Julian Strobl <[email protected]>
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
* build buf pkg

* fix go.mod

* comment xbug pkg and bump buf versions

* generate proto from buf and remove protoc and plugins

* add proto ts and api generation

* add changelog

* fix proto and template path

* fix wrong template for ts generation

* fix api out path

* fix ts out path and remove unused log

* fix go.mod ident and sort

* remove unused method

* fix lint

* fix wrong lint comment

* remove unused tools

* fix doctor for tools pkg

* add missing tool dependency

* add missing import

* add global protoanalysis.NewCache to buf structure

* fix proto module name

* update go.mod

* Update ignite/pkg/cosmosgen/generate_go.go method name

Co-authored-by: Jerónimo Albi <[email protected]>

* Update ignite/pkg/buf/buf.go remove unused ctx

Co-authored-by: Jerónimo Albi <[email protected]>

* fix wrong method call

* fix deep tools

* fix ignite doctor

* fix buf.gen files

* fix proto gen files

* remove 3thrparty  mod

* thr modules openapi

* add xos copy commands

* fix wrong proto tmp path

* remove unused method

* update tools for the doctor command

* unhlanded error

* check if the buf files exists

* remove unused ctx

* fix changelog merge

* fix unit tests and make more dynamic

* Update changelog

Co-authored-by: İlker G. Öztürk <[email protected]>

* fix ts script generation and remove pulsar buf files

* fix changelog

* fix changelog

* add migration for scaffold and generate commands

* fix pre handler

* fix rance condition

* fix wrong app path for tools migrations

* fix lint

* rollback draft changes

* fix ineffassign lint

* fix wrong path

* move buf pkg to cosmosbuf

* increase test timeout

---------

Co-authored-by: Jerónimo Albi <[email protected]>
Co-authored-by: İlker G. Öztürk <[email protected]>
Co-authored-by: Danilo Pantani <[email protected]>
Co-authored-by: Pantani <Pantani>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: use buf.build binary to generate the proto files
3 participants