ignite/cli

Importing proto definition of local module results to prefixed module with `cosmossdk.io/api`

PanGan21 opened this issue · 2 comments

Describe the bug
When importing a proto definition of a local module to another local module, then the generated .pulsar file the import is prefixed with cosmossdk.io/api.
Ignite cli protobuf generation should allow to import from another local module without prefixing like previous versions of Ignite.

This happened during the migration from v0.27.2 to v0.28.0

To reproduce
Steps to reproduce the behavior:
I made a repository that reproduces this issue: https://github.com/PanGan21/bufrepro
Module modb imports the base.proto from moda. https://github.com/PanGan21/bufrepro/blob/d81839e135226f79457468664065703a3ee6232e/proto/bufrepro/modb/extension.proto#L6
Then after generating proto with ignite it results to the following file which has the prefix:
https://github.com/PanGan21/bufrepro/blob/d81839e135226f79457468664065703a3ee6232e/api/bufrepro/modb/extension.pulsar.go#L5

What version are you using?

Provide the output of the ignite version command.

ignite version
⬆️ Ignite CLI v28.4.0 is available! To upgrade: https://docs.ignite.com/welcome/install#upgradeIgnite CLI version:               v28.0.0
Ignite CLI build date:          2023-12-06T08:52:35Z
Ignite CLI source hash:         936476c9358bcda4a67475ea521f1c4a39759dbe
Ignite CLI config version:      v1
Cosmos SDK version:             v0.50.1
Your OS:                        darwin
Your arch:                      amd64
Your Node.js version:           v21.2.0
Your go version:                go version go1.21.3 darwin/amd64
Your uname -a:                  Darwin panagiotissmbp2.kpn 21.6.0 Darwin Kernel Version 21.6.0: Mon Feb 19 20:24:34 PST 2024; root:xnu-8020.240.18.707.4~1/RELEASE_X86_64 x86_64

This bug is valid, and we shouldn't set the default prefix in https://github.com/ignite/cli/blob/main/ignite/templates/app/files/%7B%7BprotoDir%7D%7D/buf.gen.pulsar.yaml#L10.

It looks like we may need some changes in the protos in the SDK and tag another api module.