go-kratos / kratos

Your ultimate Go microservices framework for the cloud-native era.
https://go-kratos.dev
MIT License
23.13k stars 3.99k forks source link

[Feature] (cmd/kratos) CLI tool should read multiple args for "kratos proto" command #2806

Closed shiw-yang closed 6 months ago

shiw-yang commented 1 year ago

Example

Question

以上命令都应该生效并达成目标效果,但是在实际应用中这些代码都不能达到其效果,都只能接受并处理第一个参数,想请问为什么在设计中只考虑接受一个参数的情况呢?

我个人理解的话,对于这种创建微服务的工具,应该是在创建微服务前我就定义好了应该会使用n个proto文件,然后使用该微服务工具一起将文件创建出来,之后再对生成好的文件进行填空,如此这样的话这两个函数理应接收多个参数,然而在实际的实现中并不如我预想的情况:

add.go server.go内只接受第一个参数 https://github.com/go-kratos/kratos/blob/520b321fe99bb2d79572539e91cbac448e3c9149/cmd/kratos/internal/proto/add/add.go#L23-L27

https://github.com/go-kratos/kratos/blob/520b321fe99bb2d79572539e91cbac448e3c9149/cmd/kratos/internal/proto/server/server.go#L30-L34

然而,如果是统一设计语言,把所有proto下的命令都设置成只接受一个参数的函数的话,对应的kratos proto client命令却能接受多个参数:

https://github.com/go-kratos/kratos/blob/520b321fe99bb2d79572539e91cbac448e3c9149/cmd/kratos/internal/proto/client/client.go#L108-L112

History

在去年六月就有人提出了这个问题并提交了一个pr: #2129 ,虽然该pr也有一些问题,但是好像还没有人注意到该pr并提出修改意见。

dosubot[bot] commented 10 months ago

Hi, @shiw-yang! I'm Dosu, and I'm here to help the kratos team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you opened this issue requesting that the "kratos proto" command in the CLI tool should be able to accept multiple arguments. You provided examples and questioned why the design only considers accepting one argument. You also mentioned that the "kratos proto client" command is able to accept multiple arguments, which seems inconsistent.

At the moment, this issue remains unresolved, and there hasn't been any activity or comments on it. Before we proceed, we would like to confirm if this issue is still relevant to the latest version of the kratos repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.

Thank you for your understanding, and we appreciate your contribution to the kratos project. If you have any further questions or concerns, please don't hesitate to reach out.

shiw-yang commented 10 months ago

Hello, @dosubot,

I am shiw-yang, the one who opened this issue. I believe that the issue is still present and warrants further discussion and resolution. The problem persists in the latest version of Kratos, and I am willing to contribute the necessary improvements and a pull request (PR). However, since posting the issue, there has been no outreach or discussion with me, which is why I have not submitted any further content until it was marked as stale. I would appreciate it if the core team could take notice and get in touch with me. If the issue is deemed valid, I am ready to submit a PR to address the improvements needed for this issue.

Thank you for managing the backlog, and I look forward to a collaborative effort to resolve this.

Hi, @shiw-yang! I'm Dosu, and I'm here to help the kratos team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you opened this issue requesting that the "kratos proto" command in the CLI tool should be able to accept multiple arguments. You provided examples and questioned why the design only considers accepting one argument. You also mentioned that the "kratos proto client" command is able to accept multiple arguments, which seems inconsistent.

At the moment, this issue remains unresolved, and there hasn't been any activity or comments on it. Before we proceed, we would like to confirm if this issue is still relevant to the latest version of the kratos repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.

Thank you for your understanding, and we appreciate your contribution to the kratos project. If you have any further questions or concerns, please don't hesitate to reach out.

dosubot[bot] commented 10 months ago

@shenqidebaozi Could you please help @shiw-yang with this issue? They have indicated that the problem still exists in the latest version of Kratos and are willing to contribute improvements and a pull request. Thank you!

shenqidebaozi commented 9 months ago

I haven't figured out the positioning of kratos proto yet. It seems that many people are using buf to build proto now. Kratos proto service seems to simply generate a template. If it can solve the real problem, you can consider making specific modifications. Otherwise, it seems to support multiple files, and the actual effect is still very small.

shenqidebaozi commented 9 months ago

It seems that we need a more complete plan to make command-line tools better serve the business.

dosubot[bot] commented 6 months ago

Hi, @shiw-yang

I'm helping the Kratos team manage their backlog and am marking this issue as stale. From what I understand, you opened this issue requesting the "kratos proto" command to accept multiple arguments for creating microservices from multiple proto files. There was a previous pull request (#2129) that addressed the issue but did not receive much attention. You expressed willingness to contribute improvements and a pull request, and another user, shenqidebaozi, mentioned the usage of buf for building proto and the need for a more complete plan to enhance the command-line tools.

Could you please let us know if this issue is still relevant to the latest version of the Kratos repository? If it is, please feel free to let the Kratos team know by commenting on the issue. Otherwise, you are welcome to close the issue yourself, or it will be automatically closed in 7 days. Thank you!